PDA

View Full Version : Disable Refresh-Button in Grid Ext.PagingToolbar



flashg0101
21 Jul 2009, 11:44 PM
Good Morning,
I have read the article for the 2.0 version, but I didn't get it working.
I want to disable the refresh-button in the Grid footer...

I have tried the following code after grid.render('content_container').
No success.



grid.bbar.refresh.hideParent = true;
grid.bbar.refresh.hide();


My Grid-code:



var grid = new Ext.grid.GridPanel({
id: 'lk_grid',
store: store,
columns: [
expander,
{header: 'Nachname', width: 150, sortable: true, dataIndex: 'nachname'},
{header: 'Vorname', width: 120, sortable: true, dataIndex: 'vorname'},
{header: 'PLZ', width: 50, sortable: true, dataIndex: 'plz'},
{header: 'Wohnort', width: 150, sortable: true, dataIndex: 'wohnort'}
],
width:510,
height:400,
columnLines: true,
collapsible: true,
animCollapse: false,
plugins: expander,
iconCls: 'icon-grid',
title:'Datenbank',
bbar: new Ext.PagingToolbar({
pageSize: 14,
store: store,
displayInfo: true,
displayMsg: 'Angezeigte Personen {0} - {1} von {2}',
emptyMsg: "Keine Personen zum Anzeigen",
beforePageText: "Seite",
afterPageText: "von {0}"
})

});




Thanks and best Regards

Gordon

Condor
21 Jul 2009, 11:58 PM
Which Ext version are you using?

In Ext 3.0 the button is called 'refresh', but in Ext 2.x the button was called 'loading'.

flashg0101
22 Jul 2009, 12:05 AM
Hi Condor,
I'm using Version 3.0.
I call it after the render function,
but I get bbar.refresh is Null or no object...

thx Gordon

Condor
22 Jul 2009, 12:13 AM
Your code should work for Ext 3.0.0, but only after layout (try adding your code to the afterlayout event).

flashg0101
22 Jul 2009, 1:33 AM
Sorry...didn't get it running....

I created an afterlayout event after rendering...



grid.on("afterlayout", function() {
bbar.refresh.hideParent = true;
bbar.refresh.hide();

});

No errors, but also no effect...
Thx

jakeext
25 Aug 2009, 12:53 PM
I was looking into this as well and found this to work for me:



grid.on("afterrender", function(component) {
component.getBottomToolbar().refresh.hideParent = true;
component.getBottomToolbar().refresh.hide();
});