PDA

View Full Version : Gridview subclass problems



sdetweil
24 Apr 2008, 11:49 AM
I am fixing up the LiveGrid bufferedGrid code, and need to change the column sort behavior.
My subclass of the GridView.js cannot seem to find the menu item and my parent handler doesn't get called.



in Gridview.renderUI

if(g.enableHdMenu !== false){
if(g.enableColumnHide !== false){
this.colMenu = new Ext.menu.Menu({id:g.id + "-hcols-menu"});
this.colMenu.on("beforeshow", this.beforeColMenuShow, this);
this.colMenu.on("itemclick", this.handleHdMenuClick, this);
}
this.hmenu = new Ext.menu.Menu({id: g.id + "-hctx"});
this.hmenu.add(
{id:"asc", text: this.sortAscText, cls: "xg-hmenu-sort-asc"},
{id:"desc", text: this.sortDescText, cls: "xg-hmenu-sort-desc"}
);
if(g.enableColumnHide !== false){
this.hmenu.add('-',
{id:"columns", text: this.columnsText, menu: this.colMenu, iconCls: 'x-cols-icon'}
);
}
this.hmenu.on("itemclick", this.handleHdMenuClick, this);

//g.on("headercontextmenu", this.handleHdCtx, this);
}



I need to unregister and reregister the event handlers.. but I can't find 'hmenu' in any data structure..

or do I need to do the raw getEl({id:g.id + "-hcols-menu"}) to get this?

thanks..

Sam