Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    drop unique records

    i am trying to drag/drop unique number of rows from one listgrid to the other by the function recordDrop.
    Code:
     
    recordDrop: function(dropRecords, targetRecord, index, sourceWidget){
    
    //i traverse through dropRecords and if the target listgrid has the row already dont copy it.
    for(var i=0; i<dropRecords.length; i++){
    if(theListGrid.data.find("fieldname", dropRecords.get(i).fieldname)==null){
         datasourceds.add(dropRecords.get(i))
    }
    }
    }
    The problem is if i drop only one row it works as expected no matter how many rows i drop afterwords it doesnt add data. However if i initially drop multiple rows for all of them the above find returns null and all of them get added to the listgrid. subsequent drops are not added as expected.
    after calling first add operation shouldnt the next theListGrid.data.find return the added value, initially theListGrid is empty?

    SmartClient_v82p_2012-06-12
Working...
X