PDA

View Full Version : Sometimes getSelectionModel().getSelection() not getting all selected rows in treePan



Nimmy
24 Jul 2015, 5:44 AM
I want to force the RootNode selection in ExtJS TreePanel, then I do some operation in the the selectionchange event of treepanel. After that I want to get the selected rows from the treepanel and pass it as an event parameter. I'm able to achieve it with the given code, but sometimes 'selModel.getSelection()' not getting all the selected rows. Probably before completing selectionchange event it is excecuting the next line.

var tree = this.getTree();var selModel = tree.getSelectionModel();selModel.select(tree.getRootNode()); // fires selectionchange eventvar selectedRows = selModel.getSelection(); if (selectedRows.length > 0) {//Here I fire another event by passing selectedRows as parameter}selectionchange: function(){//some looping operation}Would be great if anyone can help me on this. Thanks

mitchellsimoens
28 Jul 2015, 7:58 AM
Can I get a simple test case to reproduce the issue?