PDA

View Full Version : PagingToolbar vanishes when size of grid change.



Romit
23 Feb 2010, 5:52 AM
Hi,

Could some one please help me on this.

I am using PagingToolbar in grid. But when i minimize or maximize the browser or change the size of grid , PagingToolbar disappears.

Thanks
Romit.

jay@moduscreate.com
24 Feb 2010, 4:32 PM
how is the grid setup? are you properly configuring it's parent's layout

Romit
25 Feb 2010, 10:09 AM
Thanks for replying.

I am not using any layout for grid panel.Do I need to configure any layout ?
Here is my code:

PagingToolBar
---------------
var bar = new Ext.PagingToolbar( {
pageSize : 10,
store : dataStore,
displayInfo : true,
autoHeight : true,
autoWidth : true,
displayMsg : 'Displaying documents {0} - {1} of {2}',
emptyMsg : "No documents to display"
});

GridPanel
-----------------
var grid = new Ext.grid.GridPanel( {
el : 'document-grid',
id : 'document-grid',
height : mainTabPanel.getSize().height - 27,
viewConfig : {
forceFit : true
},
ds : modelStoreFn.fn(),
cm : columnModel,
sm : sm,

bbar : bar,
ddGroup : 'GridDD',
enableDragDrop : true
});
grid.render();

TabPanel
------------------
mainTabPanel = new Ext.TabPanel(
{
region : 'center',
id : 'mainTabPanel',
enableTabScroll : true,
deferredRender : false,
autoHeight:true,
activeTab : 1,
items : [
{
el : 'document-grid',
title : 'Assets',
autoScroll : true
} ]
});
On resize i am calling syncGridLayout
----------------------------------------
mainTabPanel.on('resize', syncGridLayout);

function syncGridLayout()
{
grid.setHeight(mainTabPanel.getSize().height - 27);
grid.setWidth(mainTabPanel.getSize().width);
}

Thanks
Romit.

tobiu
25 Feb 2010, 10:37 AM
when the grid is inside a tab, i strongly recommend to use

layout:'fit'
and remove configs for height and width of the grid.

then the layout manager resizes the grid automatically.


kind regards,
tobiu

daiei27
2 Apr 2010, 10:27 AM
when the grid is inside a tab, i strongly recommend to use

layout:'fit'and remove configs for height and width of the grid.

then the layout manager resizes the grid automatically.


kind regards,
tobiu
Thanks! That fixed the hidden pagingtoolbar issue for me.

As a side effect, the GridPanel does not automatically expand so now I get scrollbars (in the grid) when opening a row using the RowExpander plugin.

I tried various methods like .doLayout, .syncSize, and .setHeight on the GridPanel, but haven't found anything that resizes the panel to remove the scrollbars.

Any ideas on how to update the grid layout?

daiei27
8 Apr 2010, 1:43 PM
Can anyone help?