My ExtJS grid is attached with action tbar, now in the handler of the toolbar buttons I need to have the grid instance. One way I can do it using
this.findByParentByType("grid"). Is there any better way that I can get the grid instance??
My ExtJS grid is attached with action tbar, now in the handler of the toolbar buttons I need to have the grid instance. One way I can do it using
this.findByParentByType("grid"). Is there any better way that I can get the grid instance??
You can also use the ownerCt var to access the parent element. Based on the nesting level you will minimal need ownerCt.ownerCt from the button instance to access the grid. FindParentByType does basicly the same and checks each type. Firebug and console.log will help you with further debuging. EDIT:I forgot the Ext.getCmp that can be used to find an object by it's id.