-
8 Oct 2008 5:26 PM #1
GridPanel autoHeight fit problem
GridPanel autoHeight fit problem
Hi.
I have a GridPanel within the layout 'fit' but I want it to fit a dynamic number of rows into the current visible area and not just i.e 10 rows if the continer is big enough to hold say 20 rows. I do not want scrollbars since I have a PagingToolbar, which also would need its pageSize dynamicly updated whenever the GridPanels container set/change size.
It is only okey for a scrollbar to show up if a plugin like RowExpander is used and someone expands a row.
Whenever the GridPanel container resize I want it to dynamicly update the number of visible rows and the PagingToolbars pageSize.
Can someone help me figure out how to make this happend?
Thanks in advance
//venoll
-
25 Oct 2012 8:48 AM #2
Hi i had the same issue and then i used doLayout to solve the issue, after you add all the records to the parent grid call the doLayout () like this
This fixed my issueCode:var mychildGrid = Ext.create('Ext.grid.Panel', { width: 940, store: childstore, disableSelection: true, minHeight: 10, columns: [ { header: "Col1", dataIndex: "Col1", sortable: false, hidden: true }, { header: "Col 2", width: 570, dataIndex: "COl 2", sortable: false } ], collapsible: false, animCollapse: false, hideHeaders: true, stripeRows: true, listeners: { viewready: function (grid) { myParentGrid.doLayout(); } }, renderTo: 'ChildGrid' + Row1 });
listeners: {
viewready: function (grid) {
myParentGrid.doLayout();
}
},


Reply With Quote