监听表格加载完整事件
$table.on(‘post-body.bs.table‘, function(e, settings, json, xhr) {
$(".table_locate_btn").each(function(){
$(this).text("定位");
let rowData = $("#table12").bootstrapTable(‘getData‘)[$(this).attr(‘data-row-index‘)];
var rowid=rowData.id;
if(inspection_watch_isshow.indexOf(rowid)!=-1)
{
$(this).text("隐藏");
}
});
}
表单按钮代码
{field: ‘operate‘, title: __(‘Operate‘), table: $table, buttons: [ {name: ‘ajax‘, title: ‘定位‘, text:‘定位‘, classname: ‘btn btn-xs btn-info btn-status table12_locate_btn‘ }, { name:‘adjust‘,text: ‘详情‘,title:‘详情‘,icon:‘‘, classname:‘btn btn-xs btn-info table12_detail_btn‘ }, { name: ‘pipedata‘, title: ‘数据‘, text:‘数据‘, classname: ‘btn btn-xs btn-data table12_data_btn‘ }, { name: ‘delete‘, text: ‘删除‘, title: ‘删除‘, icon: ‘‘, classname: ‘btn btn-xs btn-success btn-ajax‘, confirm: ‘确定删除该项吗?‘, url: ‘pipeline/del‘, success:function(data, ret){ console.log(data); $table.bootstrapTable(‘refresh‘); hideSingleKmlData(data); }, error:function(err){ console.log(err); } } ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}
原文:https://www.cnblogs.com/kiyomi7/p/14609340.html