PDA

View Full Version : [SOLVED]Gridpanel + height + bbar



maquejp
9 Mar 2010, 11:28 PM
Hi,

I have a strange behaviour (bug?) with my gridpanel. When I set the height property, the pagingtoolbar disapear (FF and IE).

var gp_lopdata = new Ext.grid.GridPanel({
id: 'gp_lopdata',
ds: ds_lop,
cm: cm_lop,
frame: true,
border: false,
autoScroll: true,
loadMask: new Ext.LoadMask(Ext.getBody(), {
msg: 'Please wait...'
}),
sm: new Ext.grid.RowSelectionModel({
singleSelect: true
}),
viewConfig: {
forceFit: true
},
listeners: {
'cellcontextmenu': function(grid, row, col, e){
myMenu.showAt(e.getXY());
Ext.getCmp('myMenuLabel').setText('(' + row + ',' + col + ')');
e.stopEvent();
}
},
bbar: new Ext.PagingToolbar({
id: 'pgb_gp_lop',
pageSize: gridlinebypage,
store: ds_lop,
displayInfo: true,
displayMsg: 'Displaying records {0} - {1} of {2}',
emptyMsg: "No records to display",
items: [new Ext.Toolbar.Separator(), {
xtype: 'label',
text: 'Adonis'
}, {
xtype: 'numberfield',
id: 'lookthisadonis',
fieldLabel: 'Adonis',
allowDecimals: false,
allowNegative: false,
maxValue: 999999,
enableKeyEvents: true
}, {
xtype: 'button',
id: 'btn_filterlop',
icon: 'images/find.png',
tooltip: 'Search specific ADONIS',
handler: function(){
if (Ext.getCmp('lookthisadonis').getValue()) {
ds_lop.baseParams = {};
Ext.apply(Ext.getCmp('gp_lopdata').getStore().baseParams, {
filters: 'Adonis',
Adonis_eq: Ext.getCmp('lookthisadonis').getValue()
});
Ext.getCmp('gp_lopdata').getStore().load({
params: {
start: 0,
limit: gridlinebypage,
useralias: loc_useralias,
userprofile: loc_userprofile
}
});
}
}
}, {
xtype: 'button',
id: 'btn_clearfilterlop',
icon: 'images/reload16.png',
tooltip: 'Clear filter/Show all adonis',
handler: function(){
Ext.getCmp('gp_lopdata').getStore().baseParams = {};
Ext.getCmp('lookthisadonis').setValue('');
Ext.getCmp('gp_lopdata').getStore().load({
params: {
start: 0,
limit: gridlinebypage,
useralias: loc_useralias,
userprofile: loc_userprofile
}
});
}
}]
})
});




Another point that with this config (without the height) when I search (btn_filterlop) it returns 1 result and the grid is automatically resized which is not a problem itself. The problem is when I clear the search (btn_clearfilterlop) the grid is not automatically resized and there is no vertical scrollbar. The data is well loaded.

Animal
10 Mar 2010, 2:11 AM
Can you read that code?

Format it properly, and someone might help/

steffenk
10 Mar 2010, 2:34 AM
i think we need a button with "JAVASCRIPT CODE" insted of "#"- users post code in very strange ways :)

maquejp
10 Mar 2010, 8:26 AM
Can you read that code?

Format it properly, and someone might help/
hum strange indeed...

Animal
10 Mar 2010, 8:36 AM
Erugh! Rendering. No layouts. The usual.

maquejp
10 Mar 2010, 10:56 PM
var p_bodycenter = new Ext.Panel({
id: 'p_bodycenter',
layout: 'card',
region: 'center',
loadMask: new Ext.LoadMask(Ext.getBody(), {
msg: 'Please wait...'
}),
border: false,
frame: true,
autoScroll: true
});
...
var p_lopdata = new Ext.Panel({
id: 'p_lopdata',
autoScroll: true,
items: [gp_lopdata, tp_lopdata]
});
p_bodycenter.add(p_lopdata);
....
var vp_bodyviewport = new Ext.Viewport({
id: 'VP_BodyViewPort',
layout: 'border',
frame: false,
border: true,
items: [p_bodyright, p_bodycenter],
renderTo: 'container'
});
p_bodycenter.getLayout().setActiveItem('fp_login');

My grid is set on a panel that is part of a viewport.

Animal
11 Mar 2010, 12:25 AM
var p_lopdata = new Ext.Panel({
id: 'p_lopdata',
autoScroll: true,
items: [gp_lopdata, tp_lopdata]
});


How do you think p_lopdata is going to size and position those two child items?

maquejp
11 Mar 2010, 1:02 AM
I should think sleeping more ... What ever...


var gp_lopdata = ... (
{...
region:'north',
height:200,...
});
var tp_lopdata = ... (
{...
region:'center',...
});
var p_lopdata = new Ext.Panel({
id: 'p_lopdata',
autoScroll: true,
layout:'border',
items: [gp_lopdata, tp_lopdata]
});


Sorry for your time lost on this...
ALLWAYS SET THE RIGHT LAYOUT PROPERTY