EasyUI Forum

General Category => General Discussion => Topic started by: catpaw on February 04, 2015, 01:37:25 PM



Title: Group Rows in DataGrid collapse
Post by: catpaw on February 04, 2015, 01:37:25 PM
hi

in the demo section there are a option Group Rows in DataGrid

How do I can do to make the groups appear collapsed from the beginning ?

                                        view: detailview,
               detailFormatter:function(indext,rowt){
                  return '<div style=\'padding:2px\'><table id=\'ddz-'+indext+'\'></table></div>';
               },
               onExpandRow: function(indext,rowt){               
                  var d = $('#ddz-'+indext);
                  d.datagrid({
                     title:'Accesos: '+rowt.area,
                     url:'source/get.php?area='+rowt.area+'&topic='+rowt.topic,
                     fitColumns:false,
                     singleSelect:true,
                     rownumbers:true,
                     nowrap:false,
                     width:700,
                     height:'auto',
                     collapsible:true,
                     view:groupview,
                     groupField:'topicDesc',
                     groupFormatter:function(value,rows){
                        var rowx = rows[0];
                        return value+' ('+rowx.total+')';
                     },
                     columns:[[
                        {field:'topicDesc',title:'Topic',width:450,sortable:true},
                        //{field:'modulos',title:'Modulos',width:100,sortable:true},
                        {field:'datestr',title:'Date',width:150,sortable:true}
                     ]],
                     onResize:function(){
                        $('#ddv'+indext).datagrid('fixDetailRowHeight',indext);
                     },
                     onLoadSuccess:function(data){
                        setTimeout(function(){
                           $('#ddv'+indext).datagrid('fixDetailRowHeight',indext);
                        },0);
                        $('.totp_po').tooltip({ 
                           position: 'top'
                        });                  
                     }
                  });
                  $('#ddv'+indext).datagrid('fixDetailRowHeight',indext);
               },
               onLoadSuccess:function(data){
                  setTimeout(function(){
                     $('#dg1').datagrid('fixDetailRowHeight',index);
                  },0);
                  $('.totp_po').tooltip({ 
                     position: 'top'
                  });
               }

please help


Title: Re: Group Rows in DataGrid collapse
Post by: jarry on February 04, 2015, 04:53:23 PM
Please refer to this topic http://www.jeasyui.com/forum/index.php?topic=3846.0


Title: Re: Group Rows in DataGrid collapse
Post by: catpaw on February 05, 2015, 08:25:19 AM
works perfect!

thanks