PDA

View Full Version : How to remove rerfresh button in grid toolbar



hudi1
28 May 2013, 11:19 PM
Hi,

I have grid with pagingtoolbar:

How I can remove refresh button using just configuration ? I know that this should works:


pagingToolbar.loading.hide();

but I have no variable pagingToolbar


items : [ {
xtype : 'gridpanel',
itemId : 'person_list',
autoScroll : true,
header : false,
title : 'Person List',
store : 'People',
columns : [ {
xtype : 'numbercolumn',
hidden : true,
dataIndex : 'id',
text : 'Id',
flex : 1
}, {
xtype : 'gridcolumn',
dataIndex : 'firstName',
text : 'First Name',
flex : 2
}, {
xtype : 'gridcolumn',
dataIndex : 'lastName',
text : 'Last Name',
flex : 2
}, {
xtype : 'datecolumn',
dataIndex : 'dateOfBirth',
text : 'Date of Birth',
flex : 1,
format : 'd.m.Y'
}, {
xtype : 'gridcolumn',
dataIndex : 'ssn',
text : 'SSN',
flex : 1
}, {
xtype : 'gridcolumn',
dataIndex : 'gender',
text : 'Gender',
flex : 1
} ],
dockedItems : [ {
xtype : 'pagingtoolbar',
dock : 'bottom',
width : 360,
displayInfo : true,
store : 'People'
} ]
} ]

slemmon
30 May 2013, 12:38 PM
There's not a config to prevent the refresh button from being rendered, but you might do something like the following (I looked at the paging toolbar's source to see that the refresh button has an itemId of 'refresh' which is undocumented and could change in future framework builds without warning):



dockedItems: [{
xtype: 'pagingtoolbar',
store: store, // same store GridPanel is using
dock: 'bottom',
displayInfo: true,
listeners: {
beforerender: function () {
this.down('#refresh').hide();
}
}
}]