本文共 1241 字,大约阅读时间需要 4 分钟。
表格render,重点是page属性中的refresh按钮和loading属性为false
table.render({ elem: "#LAY-admin-manage", url: url, method: 'post', where: { str:'' }, cols: [[{ type: "checkbox", fixed: "left" }, { field: "ID", width: 100, title: "ID", sort: !0 }, { field: "Name", title: "名称", width: 100 }]], page: { layout: ['prev', 'page', 'next', 'skip', 'count', 'limit', 'refresh'] }, limit: 10, loading: false, height: "full-220", text: "对不起,加载出现异常!", done: function (res, curr, count) { } })
定时器定义,定时调用refresh点击事件
var timer2 = setInterval(function () { $(".layui-icon-refresh").click();}, 5000);
转载地址:http://chpfb.baihongyu.com/