多应用+插件架构,代码干净,支持一键云编译,码云点赞13K star,4.8-4.12 预售价格198元 广告
``` lastIndex = $("#bootstrap-table").bootstrapTable("getData").length; if(lastIndex>0){ $("#bootstrap-table").bootstrapTable('append', [{ name: '<span style="font-size:20px;">合计</span>', card: '<span style="font-size:20px;color:red;">'+priceSum+'</span>' }]); } ``` updateByUniqueId ``` //bootstrapTable('getSelections'); 获取当前被选中的行 var ids = $.map($table.bootstrapTable('getSelections'), function(row) { return row.id; }); $table.bootstrapTable('updateByUniqueId', { id: ids, row: { id: ids, position: 1, type: 0, status: 1, } }); ``` 拓展行:第三个参数设置为true则是拓展行 $table.bootstrapTable(id,row={},true) ## **动态添加(bootstrap-editable插件)** columnsDefined()  处需要加行内编辑的可这么设置 ~~~ { title : '备注', field : 'remark', formatter : function(value, row, index){ if(value == null){ return "添加"; }else{ return value; } }, editable:{ title : '添加备注', type : "text" } }, ~~~ 所需的样式和js文件: [https://pan.baidu.com/s/1eSAKzyM](https://pan.baidu.com/s/1eSAKzyM)密码: s3wh ~~~ onEditableSave: function (field, row, oldValue, $el) { $.ajax({ type: "POST", url: home + editUrl,(此处根据自己项目的配置填,反正就是目标请求url) data:{"param" : JSON.stringify(row)}, success: function (data, status) { if (data == "success") { swal("修改成功"); }else if(data == "failure"){ swal("修改失败"); }else{ $("#bootstrapTable").bootstrapTable('refresh'); swal("修改失败"); } }, error: function () { $("#bootstrapTable").bootstrapTable('refresh'); swal("修改失败"); }, complete: function () { // $("#bootstrapTable").bootstrapTable('refresh'); } }); } ~~~