PDA

View Full Version : Reuse Grid Header panel in different tabs



tangalla
6 Nov 2012, 6:18 AM
Hi,
I have to 6 tabs with same header (which had a menu and a button ). I am extending the grid panel which has a header for all tabs. In the controller when the tab is rendered i am doing some thing like this..

init: function() {
this.control({
'gridcomponent': {
render: this.onTabGridsRendered
}
});
},
ontabGridsRendered: function() {
//Grid filter
this.getGridFilterPanel().onSettingFilters(this.onSettingFilters,this);
his.getGridFilterPanel().onApplyFilters(this.applyFilterHandler,this);
this.getGridFilterPanel().onRemoveFilter(this.clearFilterHandler,this);

this.getGridMenuOptions().onSaveViewButtonClick(this.saveViewHandler, this);
this.getGridMenuOptions().onSaveAsButtonClick(this.saveAsHandler, this);
this.getGridMenuOptions().onSavedViewsButtonClick(this.savedviewHandler, this);
this.getGridMenuOptions().onDownloadAsButtonClick(this.downloadHandler, this);
this.getGridMenuOptions().onPrintButtonClick(this.printHandler, this);
}

This works for the first activated grid not for all grids. I know i am doing some thing wrong but i couldn't figure out how to resolve this.
Thanks

tvanzoelen
6 Nov 2012, 6:58 AM
I do not fully understand your situation but...

Aint it better to put the listeners in the gridpanel class? For example in the initComponent of the gridcomponent you register the listeners and attach the functions of the controller to handle the required events. Now you do this in the controller.