PDA

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



blueworld
Apr 05, 2013, 9:48 AM
Hi

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?

Daniil
Apr 05, 2013, 11:24 AM
Hi @blueworld,

It can look something like this.

Example

var recIds = [],
i;

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.