如何使用bootstrap实现点击按钮增加或删除一行列表如果有更新更好啦,部分代码如下,页面如图
<buttontype="button"class="btnbtn-primary"onclick="">添加明细</button><buttontype="button...
<button type="button" class="btn btn-primary" onclick="">添加明细</button> <button type="button" class="btn btn-success" onclick="">删除明细</button> <button type="submit" class="btn">提交</button> <button type="button" class="btn btn-info pull-right" onclick="window.location.href='${pageContext.request.contextPath }/jsp/detail_history.jsp'">查看历史账单 </button> <hr> <div class="panel panel-default " id=""> <div class="panel-heading" align="center">消费详情</div> <!-- Table --> <table class="table table-striped table-hover table-bordered"> <tr> <th>id</th> <th>detail</th> <th>price</th> <th>other</th> </tr> </table> </div>
展开
1个回答
展开全部
//批量删除
function btn_del()
{
//使用getSelections即可获得,row是json格式的数据
var row = $('#test-table').bootstrapTable('getSelections');
if(row.length !=0)
{
var ids ="";
for(var i=0;i<row.length;i++)
{
ids = ids +row[i].carid+",";
}
alert(ids);
}
添加明细,你可以走态山巧一个保存帆键,或者参考唯缓网页链接
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询