layui框架中左樹右表只刷新數據不刷新頁面的方法
table.render({
elem: '#userdata'
,url: '/fjcj/jcxxMst/pageQuery'
,method:'post'
,cols: [[
{type: 'numbers', title: '序號', width: '40'}
,{field: 'xm', width: 100, title: '姓名'}
,{field: 'acc', width: 100, title: '輔警賬號'}
,{field: 'xb', width: 100, title: '性別', width: 90,templet:'#userSex'}
,{field: 'sfzh', width: 100, title: '身份證號',width: '180'}
,{field: 'ryzt', title: '狀態', width: 60, templet:'#userStatus'}
,{title: '操作', align: 'center', width: '200', toolbar: '#table-system-user'}
]]
,page: true
,limit: 10
,limits: [10, 20, 30 ,40 ,50]
,text: {none: '暫無數據'}
,done: function(){
element.render('progress')
}
});
table.on('tool(userdata)', function(obj){
var data = obj.data;
if(obj.event === "del"){
layer.confirm("你確定要刪除該用戶嗎?",{btn:['是','否']},
function(){
$.post("/fjcj/jcxxMst/delete",{"id":data.id},function (res){
if(res.success){
layer.msg("刪除成功",{time: 400},function(){
obj.del();
dataReload(data);