您当前的位置: 首页 >  ui

漏刻有时

暂无认证

  • 0浏览

    0关注

    717博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

layui组件table定时刷新的解决方案

漏刻有时 发布时间:2021-01-30 18:11:06 ,浏览量:0

构建ranks的容器

layui調用表格组件
    /*layui調用*/
    layui.use(['table', 'carousel', 'layer'], function () {
        var table = layui.table, carousel = layui.carousel;
        table.render({
            elem: '#ranks'
            , url: 'api/api.php?act=getRank&token=3cab7ce4142608c0f40c785b5ab5ca24'
            , id: 'searchTable'
            , loading: false
            , cols: [[
                {type: 'numbers'}
                , {field: 'store_area', title: '地區'}
                , {field: 'trans_store', title: '門店'}
                , {field: 'trans_deal', title: '訂單量', sort: true}
                , {field: 'trans_quantity', title: '銷售量', sort: true}
                , {field: 'trans_total', title: '總金額', sort: true}
            ]]
        });

        var $ = layui.$, active = {
            reload: function () {
                var tableData = $('#tableData');
                table.reload('searchTable', {});
            }
        };

        $('#layTable').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    });
定时模拟单击按钮
function getLayuiTable() {
    $("#layTable").click();
}

lockdatav done!

关注
打赏
1661217259
查看更多评论
立即登录/注册

微信扫码登录

0.0544s