PDA

View Full Version : problem tab listener getting grid.hasselection() extjs 4.2



snipper
14 Jan 2014, 5:43 AM
hello, first of all, thanks for your support.

i have a viewport with a treepanel, gridpanel and tabpanel. when i try to know if the grid hasselection method on beforeactivate tab listener, always got a false result. but if i get treepanel hasselection method, i got the real result(true or false when select or deselect a node).

thanks in advance.

code for the grid hasselection on tab listener(wrong result):

listeners:{
beforeactivate: function(tab){
if (Ext.getCmp('gridInfoId').getSelectionModel().hasSelection()
{
console.log(tab.title);
}
}
} //always got false

code for the treepanel hasselection on tab listener(good result):

listeners:{
beforeactivate: function(tab){
if (Ext.getCmp('treeInfoId').getSelectionModel().hasSelection()
{
console.log(tab.title);
}
}
} //true or false. good!!

Gary Schlosberg
14 Jan 2014, 12:21 PM
In which version are you seeing this issue? It seems similar to this issue, which was resolved in 4.2.2:
http://www.sencha.com/forum/showthread.php?258739

If you don't think that is the issue, can you post a test case which recreates the problem?