js中設(shè)置列的屬性 editable :
{type : 'text',//數(shù)據(jù)顯示在文本框內(nèi)emptytext : "--",//數(shù)據(jù)為空時顯示validate : function(value) {if ($.trim(value) == '') {return '不能為空';//修改是數(shù)據(jù)為空 顯示}}}js中設(shè)置bootstrop-table加載數(shù)據(jù)時屬性
onEditableSave : function(field, row, oldValue, $el) {$('#id').bootstrapTable('resetView');row = dataWarp(row, field);// 編輯時重新包裝數(shù)據(jù) 可寫可不寫$.ajax({type : "post",url : 路徑,data : row,//行內(nèi)修改后的數(shù)據(jù)dataType : 'JSON',success : function(data, status) {if (status == "success") {Modal.alert({msg : "編輯成功!"});}},error : function() {Modal.alert({msg : "編輯失敗!"});$('#id').bootstrapTable('refresh');// 數(shù)據(jù)加載成功后刷新},complete : function() {}});}以上所述是小編給大家介紹的bootstrap table 數(shù)據(jù)表格行內(nèi)修改的實現(xiàn)代碼,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對武林網(wǎng)網(wǎng)站的支持!
新聞熱點
疑難解答