layui定时刷新表格不闪动并停留在当前页(不重新渲染)

layui定时刷新表格不闪动并停留在当前页(不重新渲染)

󰅡 技术学院   󰃄 2021-12-21   
转载出处:https://blog.csdn.net/ab17171313/article/details/110630241?spm=1001.2014.3001.5502

表格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);



吐槽区


1 条评论
  一个好像很凶很凶的神秘人


超赞的一个分享!!!
  2021-10-15



󰄫
󰆣
󰆦