layerui.table的使用和一些问题总结

先加一个table

<table class="layui-hide" id="tbUser" lay-filter="demo"></table>

<script>

layui.use('table', function () {
                var table = layui.table;
                table.render({
                    elem: '#tbUser'
                    , method: "get"
                    , height: 322
                    , id: 'listReload'
                    ,url:"@Url.Action("方法", "控制器")",
                    , where: {
                        liushuihao: '1',
                        projectname: '1',
                        faqiren: '1',
                        zuzhi: '1'
                    }
                    , parseData: function (data) {
                        return {
                            "code": 0
                            , "msg": ""
                            , "count": 10
                            , data: data
                        }
                    }
                    , cellMinWidth: 80
                    , cols: [[ //标题栏
                        { checkbox: true, LAY_CHECKED: false, align: 'center', width: 87 } //默认全选
                        , { field: 'ProcInstID', title: '流水号', align: 'center', width: 127 }
                        , { field: 'Entryname', title: '项目名称', align: 'center', width: 187 }
                        , { field: 'AgentName', title: '发起人', align: 'center', width: 100 }
                        , { field: 'AllOrgPath', title: '组织', align: 'center', width: 247 }
                    ]]
                    , skin: 'row' //表格风格
                    , even: true
                    //, page: true //是否显示分页
                   // , limits: [6, 12, 18]
                    , limit: 1000 //每页默认显示的数量
                    //1
                });

点击按钮更新table表格访问后台数据
                $("#landselects").on("click", function () {
                   // alert(0);
                    table.reload('listReload', {
                         url:"@Url.Action("方法", "控制器")",
                         where: {
                            liushuihao: $("#liushuihao").val(),
                            projectname: $("#projectname").val(),
                            faqiren: $("#faqiren").val(),
                            zuzhi: $("#zuzhi").val()
                        }
                    })
                });
            });

</script>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值