[CLOSED] How to loop through dragged records in grid

  1. #1

    [CLOSED] How to loop through dragged records in grid

    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.get('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?
    Last edited by Daniil; Apr 09, 2013 at 4:12 AM. Reason: [CLOSED]
  2. #2
    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.get('Position'), recIds);
    Also change the signature of the ChangePosition method using "string[]" instead of "string" for the ids parameter.

Similar Threads

  1. [CLOSED] How to loop through grouped grid with checkboxselectionmodel
    By blueworld in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 28, 2013, 11:16 AM
  2. Replies: 3
    Last Post: Jun 26, 2012, 2:32 PM
  3. Replies: 4
    Last Post: Jun 08, 2012, 10:05 AM
  4. How to get Grid records in code behind
    By Jeevaraj K in forum 1.x Help
    Replies: 5
    Last Post: May 20, 2011, 11:56 AM
  5. [CLOSED] Grid Values Loop
    By majunior in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Apr 15, 2011, 1:34 PM

Tags for this Thread

Posting Permissions