PDA

View Full Version : pageSize plugin in the wrong position of bbar



sdd0
23 Apr 2014, 1:47 AM
I used a bbar in a grid, I also add a pageSize plugin on it. This plugin code comes from here (http://www.elvishsu66.com/2011/05/pagesize-plugin-for-paging-toolbar-for.html#.U1eI7lWSz-U).




bbar: {
xtype: 'pagingtoolbar',
store: this.store,
displayInfo: true,
displayMsg: this.displayText,
plugins: new Ext.ux.grid.PageSize(),
listeners: {
afterrender : function() {
this.child('#refresh').hide();
}
}
}




I expect the pageSize combobox to be put at the left side of bbar.

48804

but the combobox is at the right side ><

48803

Does anyone know what's wrong with this plugin?

jsakalos
23 Apr 2014, 2:16 AM
It is placed after info (last). You need to insert it after last separator on the left.

sdd0
23 Apr 2014, 6:40 PM
Hi jsakalos,

Thank you for your reply, but I still don't know how to change plugin's position. Is there any method for the bbar to do this?

jsakalos
24 Apr 2014, 9:14 AM
This line in the plugin's code:



paging.add('-', this.beforeText, this, this.afterText);

always adds it at the end of toolbar. You need to insert it in between.

sdd0
24 Apr 2014, 5:29 PM
Thank you very much, it works!
The code "paging.insert('-', this.beforeText, this, this.afterText);" in the plugin has been replaced by



paging.insert(10,this.beforeText);
paging.insert(11,this);
paging.insert(12,this.afterText);