EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: crosemffet on November 25, 2012, 04:12:47 PM



Title: datagrid resize
Post by: crosemffet on November 25, 2012, 04:12:47 PM
I have one collapsible panel with one search form in it.
inside, there's one datagrid, that shows 10 records obtained from the search operation.
the idea is when panel collapse, the datagrid extend its size to show 30 records.
the problem is I can't get the datagrid resize operation.
my code is:
<table class="easyui-datagrid" id="logAgents" style="height:410px" data-options="pageSize:20,fitColumns:true,singleSelect:false,pagination:true,url:'....'">
then:
<div id="sub1" class="easyui-panel" style="width:auto;height:160px;padding:0px 0px 0px 0px;" data-options="collapsible:true,fit:true,iconCls:'icon-save',tools:'#tools',onCollapse:function(){$('#logAgents').datagrid('resize',600);}" title:'xx'>
thanks in advance for your support,


Title: Re: datagrid resize
Post by: stworthy on November 25, 2012, 11:32:09 PM
The statement below is illegal.
$('#logAgents').datagrid('resize',600);

To resize the datagrid, the width or height property must be passed to the 'resize' method.
Code:
$('#logAgents').datagrid('resize',{
  width: 600
});