View Full Version : [CLOSED] How to loop through dragged records in grid

Apr 05, 2013, 10:48 AM

I have a grid that uses the drag drop plugin in order to change an internal position value.
So far this works fine, except that it does only work for one record.

I would like to be able to reorder more then one row at once.

This is the signature of my reordering serverside method:

<Drop Handler="App.direct.ChangePosition(dropPosition,overModel.g et('Position'),data.records[0].get('Id'))" />

Instead of data.records[0].get('Id'), I would need a list of all 'dragged' Ids that I can pass as a parameter

I couldnt find something in the demos.

Any idea how to generate that list?

Apr 05, 2013, 12:24 PM
Hi @blueworld,

It can look something like this.


var recIds = [],

for (i = 0; i < records.length; i++) {
recIds[i] = records[i].getId();

App.direct.ChangePosition(dropPosition,overModel.g et('Position'), recIds);

Also change the signature of the ChangePosition method using "string[]" instead of "string" for the ids parameter.