layui-soul-table icon indicating copy to clipboard operation
layui-soul-table copied to clipboard

子表高度问题

Open lintao1990720 opened this issue 5 years ago • 2 comments

如果子表有分页,设置的高度,分页会往下移动 image 如果子表没有设置高度的话,变成这样 image

代码如下 layui.use(['layer', 'form', 'element','table','soulTable'], function(){ var table = layui.table; var soulTable = layui.soulTable;

            table.render({
                elem: '#myTable'
                ,url: 'Demo1.aspx'
                ,where: {
                    type: "list"
                }
                ,request: {
                    pageName: 'index' ,
                    limitName:'size'
                }
                ,parseData: function(res){ 
                    return {
                        "code": res.result_state,
                        "msg": res.msg,
                        "count": res.count,
                        "data": res.list
                    };
                }
                ,response: {
                    statusCode: 1
                }
                ,height:$(document).height() - $('#myTable').offset().top - 20
                ,page: true
                ,limit: 30
                ,limits: [30, 50, 100]
                ,done:function(){
                    soulTable.render(this)
                }
                ,cols:[[
                    {
                        title:'#',
                        width:50,
                        childTitle: false,
                        children:function(row){
                            return [
                              {
                                url:'Demo1.aspx'
                                ,where: {
                                    type: "sublist",
                                    parentid: row.Id,
                                    watchNum: '1667'
                                }
                                ,request: {
                                    pageName: 'index' ,
                                    limitName:'size'
                                }
                                ,parseData: function(res){ 
                                    return {
                                        "code": res.result_state,
                                        "msg": res.msg,
                                        "count": res.count,
                                        "data": res.list
                                    };
                                }
                                ,response: {
                                    statusCode: 1
                                }
                                //,height:300
                                ,page: true
                                ,limit: 30
                                ,limits: [30, 50, 100]
                                ,done:function(){
                                    soulTable.render(this)
                                }
                                ,cols:[[
                                    {
                                        field: 'Sbmc',
                                        title: '商标名称',
                                        align: 'center',
                                        width: 200, 
                                        sort: true, 
                                        filter: true
                                    }
                                    ,{
                                        field: 'WatchNum',
                                        title: '期数',
                                        align: 'center',
                                        width: 200, 
                                        sort: true, 
                                        filter: true
                                    }
                                    ,{
                                        field: 'RegNo',
                                        title: '注册号',
                                        align: 'center',
                                        width: 200, 
                                        sort: true, 
                                        filter: true
                                    }
                                    ,{
                                        field: 'IntCls',
                                        title: '类别',
                                        align: 'center',
                                        width: 200, 
                                        sort: true, 
                                        filter: true
                                    }
                                ]]
                              }  
                            ];
                        }
                    }
                    ,{
                        field: 'TmName',
                        title: '商标名称',
                        align: 'center',
                        width: 200, 
                        sort: true, 
                        filter: true
                    }
                    ,{
                        field: 'Applicant',
                        title: '权利人',
                        align: 'center',
                        width: 200, 
                        sort: true, 
                        filter: true
                    }
                    ,{
                        field: 'RegNo',
                        title: '注册号',
                        align: 'center',
                        width: 200, 
                        sort: true, 
                        filter: true
                    }
                    ,{
                        field: 'IntCls',
                        title: '类别',
                        align: 'center',
                        width: 200, 
                        sort: true, 
                        filter: true
                    }
                ]]
            });
        });

请问作者该如何解决这样高度问题

lintao1990720 avatar Oct 25 '19 09:10 lintao1990720

我也遇到同样的问题,感觉是js里高度设置的原因。div class="layui-form layui-border-box layui-table-view"

radzhang avatar Nov 01 '19 16:11 radzhang

请问该问题修复了没。我看演示示例也还存在该问题

JackieLieu avatar Feb 14 '23 05:02 JackieLieu