PDA

View Full Version : Howto extend Ext.PagingToolbar?



anj
2 Apr 2007, 11:16 AM
Hi,

im trying to extend the PagingToolbar, but Im running into some problems. These are my tries: At the moment, i just want to override the onClick function ...



Ext.peppyPagingToolbar = function(el, ds, config){
Ext.peppyPagingToolbar.superclass.constructor.call(this, el, ds, config);
this.ds = ds;
this.cursor = 0;
this.render(this.el);
this.bind(ds);
};
Ext.extend(Ext.peppyPagingToolbar, Ext.PagingToolbar, {

onClick : function(which){
// my override ...
}
});




The problem is that i don't want to call the "root" class, but rathen to call the parent class: PagingToolbar



Ext.peppyPagingToolbar.superclass.constructor.call(this, el, ds, config);


anyone can help me with this?

rodiniz
2 Apr 2007, 1:05 PM
Have a look at my NumberPagingToolbar class
http://www.rodrigodiniz.qsh.eu/scripts/gridextension.js
see it in action
http://www.rodrigodiniz.qsh.eu/YahooGrid.aspx

tryanDLS
2 Apr 2007, 2:14 PM
Not sure what you're really trying to:
This line will call the pagingToolbar constructor

Ext.peppyPagingToolbar.superclass.constructor.call(this, el, ds, config);

and the PagingToolbar constructor calls the Toolbar constructor. Are you trying to avoid calling the root constructor?

JeffHowden
2 Apr 2007, 4:58 PM
im trying to extend the PagingToolbar, but Im running into some problems. These are my tries: At the moment, i just want to override the onClick function

I hope you're not doing it just so you can send additional parameters to the server or anything. ;) If so, stop right where you are and go read this:

http://extjs.com/forum/showthread.php?t=2767