Note the use of easyui-datagrid

1, clear all the rows and all the columns

$('#dgJGQuery').datagrid({ columns: [], url: '', data: [] });

2, the display using datagrid-groupview packet, ungroup display.

 datagrid view using a packet based display attribute, the attribute is set to groupview view to show packets. When ungroup need to view DefaultView property is set to a variable, but the DefaultView easyui itself is not exposed. When it is necessary to load the interface, the default view of the storage datagrid then, to view variable assignment in the ungroup operation.

var gridDefaultView; 
// After loading events form 
$ (function () { 
    // store default view for flush packets view 
    gridDefaultView = $ ( '# dgJGQuery') DataGrid ( 'Options') View;.. 
}); 

// total packet 
function ShowGroupView (Data) { 
        . $ ( '# dgJGQuery') DataGrid ({ 
            the GroupField: groupCol, 
            View: groupview, 
            groupFormatter: function (value, rows) { 
                return value; 
            } 
        }); 
} 

// ungroup 
unGroupView function () { 
     $ ( '# dgJGQuery') DataGrid ({. 
             URL: '***', 
             Method: 'GET',  
             View: gridDefaultView,
             onLoadSuccess: function (Data) {
                *****
            }
        });
}

  

Guess you like

Origin www.cnblogs.com/xbqn-ss/p/11960634.html