PDA

View Full Version : How to get multiple selections from GridPanel in EXTJS4.0



poojagarg89
31 Oct 2011, 4:50 AM
I have a GridPanel where I want to get the values of multiple selected rows where I used getSelections() method and its giving error that



var l_id=new Array();
var count=Ext.getCmp('grid1').getSelectionModel().getCount();
var lst=Ext.getCmp('grid1').getSelectionModel().getSelections();


ERROR:


Ext.getCmp("grid1").getSelectionModel().getSelections is not a function


can anyone help me out with the method to be used in place of getSelections() in extjs4.0 version....?

davidcfox
31 Oct 2011, 5:17 AM
Instead of "getSelections()", you need to use "getSelection()". This will return an array of all of the selected rows.

poojagarg89
31 Oct 2011, 5:50 AM
hey thankz
Its working now :)