PDA

View Full Version : How to change row style of items(gridpanel) in tabpanel.



Manoj Parida
17 Dec 2012, 12:51 AM
Hi All,

I have two gridpanels as item in Tabpanel,these gridpanels having no of rows,
If i click on any row in activetab,row color is changed by below style

#abc .x-grid3-row-selected{
background-color: #FFFF00 !important;
}

Then in next tab,i would like to get same color change in same row without activate this tab,
When this tab is activated,then it will show.

Can anybody give some suggestion about this.
Any help appreciated.


Thanks & Regards
Manoj Parida

Manoj Parida
19 Dec 2012, 7:13 AM
Yes!!!got the way to acheive this.

When row is selected from one grid,firing 'rowselect' event and get the row index,pass this index to other tab by tabchange evnt of tabpanel.
//grid selection
this.gridPanel.getSelectionModel().on('rowselect', function(sm, row, r){
var rowIndex = row;
}, this);


//TabPanel
tabPanel = new Ext.TabPanel({
activeTab: 0,
width: '100%',
layoutOnTabChange: true,
items: [ gridPanel,gridpanel1 ],
listeners: {
tabchange: function(tabPanel, activePnl) {
var activeTabIndex = tabPanel.items.findIndex('id', activePnl.id);

if(!Ext.isEmpty(rowIndex)) {
if(((activeTabIndex === 1) ) {
activePnl.getSelectionModel().selectRow(eval("'"+r owIndex+"'"));
} else {
return;
}
}
},
scope:this
}
});


Hopes,this will be helpful to someone.


Thanks & Regards
Manoj Parida