easyui subGrid实现

      1. $(function(){
        $('#dg').datagrid({
        view: detailview,
        detailFormatter:function(index,row){
        return '<div style="padding:2px"><table class="table"></table></div>';
        },
        onExpandRow: function(index,row){
        var $table = $(this).datagrid('getRowDetail',index).find('table.table');
        $table.datagrid({
        url:'dg.do?id='+row.id,
        fitColumns:true,
        singleSelect:true,
        rownumbers:false,
        pageSize:10,
            pageList:[ 5, 10, 20],
        pagination:true,
        loadMsg:'加载中。。。',
        height:'auto',
        columns:[[
        {field:'id',title:'id',width:50,align:'center'},
        {field:'repaymentNo',title:'名称',width:100,align:'center'},

        ]],
        onResize:function(){
        $('#dg').datagrid('fixDetailRowHeight',index);
        },
        onLoadSuccess:function(){
        setTimeout(function(){
        $('#dg').datagrid('fixDetailRowHeight',index);
        },0);
        }
        });
        $('#dg').datagrid('fixDetailRowHeight',index);
        }
        });
        });

posted on 2018-07-05 14:21  旅行记忆  阅读(232)  评论(0编辑  收藏  举报

导航