Threaded View

  1. #1
    Sencha User fabio.policeno's Avatar
    Join Date
    Sep 2010
    Location
    Curitiba - PR / Brasil
    Posts
    304
    Answers
    15
    Vote Rating
    5
    fabio.policeno is on a distinguished road

      0  

    Default Answered: Don't allow drop of record grid (gridviewdragdrop)

    Answered: Don't allow drop of record grid (gridviewdragdrop)


    Hello
    I need to block the line of the grid drop if the value of column1 is 0, for this example: http://docs.sencha.com/ext-js/4-0/#!...d_to_grid.html

    I tried like this, but I view returns the error dropZone is not defined(view.dropZone.lock()).

    Code:
    viewConfig: {
               ...
                listeners: {
                    ...
                    beforedrop: function(node, data, dropRec, dropPosition) {
                        if(data.records[0].get('column1') == 0)
                        {
                            data.view.dropZone.lock();
                        }
                        else
                        {
                            data.view.dropZone.unlock();
                        }
                    }
                }
            },
    Thank's!

  2. If you want to cancel a drop, return false in the beforedrop. before events should all be cancelable by returning false.

Thread Participants: 1