layui Table回调


   layui.use(['form', 'laydate', 'table', 'element'], function () {
            var form = layui.form;
            var laydate = layui.laydate;
            table = layui.table;
            var element = layui.element;
            var layedit = layui.layedit
            setTimeout(function () {
                DataTable = table.render({
                    elem: '#facilities_Grid_List_DataTable'
                    , height: $(".layui-card").height() - 100
                    , cellMinWidth: 120
                    , url: "" //数据接口
                    , page: true //开启分页
                    , cols: [[ //表头
                        { type: 'checkbox', fixed: 'left' }
                        , { field: 'Name', title: '网格名称', sort: true }
                        , { field: 'Number', title: '网格编号', sort: true }
                        , { field: 'DescribeStr', title: '说明', sort: true }
                    ]]
                    , done: function (res, curr, count) {
                        console.log(res);
                    }
                });
                table.on('rowDouble(facilities_Grid_List_DataTable)', function (obj) {
                    var index = layer.open({
                        type: 2
                        , title: '项目信息'
                        , resize: false
                        , content: '' 
                        , btn: ['保存', '取消']
                        , yes: function (index, layero) {
                             
                        }
                        , btn2: function (index, layero) {
                        
                        }
                    });
                    //标注选中样式
                    obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');
                    layer.full(index);
                });
                form.render();
            }, 500)

        });

 

你可能感兴趣的:(js)