衣兜里通过本文主要向大家介绍了bootstrap table 数据,bootstrap table表格,bootstrap table,bootstrap table样式,bootstraptable api等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
js中设置列的属性 editable :
{ type : 'text',//数据显示在文本框内 emptytext : "--",//数据为空时显示 validate : function(value) { if ($.trim(value) == '') { return '不能为空';//修改是数据为空 显示 } } }</div>
js中设置bootstrop-table加载数据时属性
onEditableSave : function(field, row, oldValue, $el) { $('#id').bootstrapTable('resetView'); row = dataWarp(row, field);// 编辑时重新包装数据 可写可不写 $.ajax({ type : "post", url : 路径, data : row,//行内修改后的数据 dataType : 'JSON', success : function(data, status) { if (status == "success") { Modal.alert({ msg : "编辑成功!" }); } }, error : function() { Modal.alert({ msg : "编辑失败!" }); $('#id').bootstrapTable('refresh');// 数据加载成功后刷新 }, complete : function() { } }); }</div>
以上所述是小编给大家介绍的bootstrap table 数据表格行内修改的实现代码,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
</div>