1. #1
    Ext JS Premium Member
    Join Date
    Sep 2009
    Posts
    86
    Vote Rating
    5
    HyGy is on a distinguished road

      0  

    Thumbs up Unanswered: grid to grouping grid drag n drop, remove item

    Unanswered: grid to grouping grid drag n drop, remove item


    Hi!

    I made 2 grids, drop from first grid to second. Second grid is grouping grid. On the second group there is a property (multiple), if it is false, the group can contain only one element, so when a drop happened, I need to remove the other element from the group.

    If I first time drop an item from first to second grid, then it is working. But the second time, it is not working, because, the index is copied too from the first grid.

    this is the event:
    drop: this.onDropToApproverArea,

    This is the drop handler:

    PHP Code:
        onDropToApproverArea: function(nodedatadropRecdropPosition
        {
         
    this.changedTheGrid=true;

          if (
    data.records[0].get('multiple')=='false')
          {
           var 
    removeIndex=dropRec.index;
           if (
    dropPosition=='before') { removeIndex++; } else { removeIndex--; }
           
    this.getStoreMaintainApproverListsApproverAreaStore().removeAt(removeIndex);
          } 
    How can I make this work, after the second drop event?

    thanks

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    81
    Answers
    102
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    if you have a reference to the dropped record ( dropRec), you can use dropRec.store.remove(dropRec)

  3. #3
    Ext JS Premium Member
    Join Date
    Sep 2009
    Posts
    86
    Vote Rating
    5
    HyGy is on a distinguished road

      0  

    Default


    thank's, it is working!

Thread Participants: 1

Tags for this Thread