layui弹出响应式table

这里写自定义目录标题

layui弹出响应式table

 $.post("数据请求路径", data, function (data) {
    
    
                var obj = eval('(' + data + ')');
                if (obj.code == 0) {
    
    

                    //第一个实例
                    table.render({
    
    
                        elem: '#openProductTable'
                        , data: obj.data //数据
                        , page: true //开启分页
                        , limit: 30
                        , cellMinWidth: 100
                        , cols: [[ //表头
                            {
    
     field: 'ItemId', title: '商品编号', width: 100 }
                            , {
    
     field: 'ItemName', title: '商品名称' }
                            , {
    
     field: 'ItemType', title: '商品规格' }
                            , {
    
     field: 'ItemCount', title: '商品数量', width: 100 }
                            , {
    
     field: 'ItemPrice', title: '商品单价', width: 100 }
                            , {
    
     field: 'ItemMoney', title: '订单金额', width: 100 }
                        ]]
                    });

                    var detail = layer.open({
    
    
                        type: 1,
                        maxmin: true,
                        content: $('#openProductBox'),
                        area: ['100%', '100%'],//宽高
                        shade: 0.5,
                        success: function (layero, index) {
    
    
                        }
                    });

                    layer.full(detail);
                    table.resize('openProductTable');

                } else {
    
    
                    layer.msg('查询数据失败:' + obj.msg, {
    
     icon: 5 })
                };
            }).error(function () {
    
    
                layer.msg('查询失败', {
    
     icon: 5 })
            });

Guess you like

Origin blog.csdn.net/qq_42455262/article/details/118788194
Recommended