PDA

View Full Version : [CLOSED] How can I get all selectedIds from gridpanel?



ViDom
May 10, 2013, 10:10 AM
Hi,

I had code written in v1.5:


for (var id in #{gridPanel}.selectedIds) { return true; }; Ext.Msg.alert('alert', 'alert.'); return false;


what is equivalent .selectedIds in v2.x ?

Thanks,
ViDom

geoffrey.mcgill
May 10, 2013, 10:31 AM
I don't remember there ever being a .selectedIds property on the GridPanel. At least not as part of the public API.

Can you link to that property in the docs?

You should be able to get an array of selected records with the following:


#{GridPanel1}.getSelectionModel().getSelection()

http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.selection.Model-method-getSelection

Once you have an array of selected records, you can loop through and get individual data elements from each.

Hope this helps.

ViDom
May 10, 2013, 10:44 AM
But getSelection() give only selected items from current page I need to get it from all pages (SelectionMemomy="true")

I doesn't found this in docs.

here is answer of @Daniil on my previous question on March 2011. Post (http://forums.ext.net/showthread.php?15510-CLOSED-How-get-Selected-IDs-from-GridView&p=65546&viewfull=1#post65546)

Daniil
May 10, 2013, 10:52 AM
Hi,

That functionality was organized as a SelectionMemory plugin. Please use:

grid.getSelectionMemory().selectedIds

ViDom
May 10, 2013, 11:54 AM
That's exactly what I asked about :)
Thanks Guys for help;) thread can be closed