2
votes
Ext.namespace('Moca');
.....

Moca.LaGrid = new Ext.grid.GridPanel({
store : Moca.Stores.LaStore,
ddGroup: 'GridDD',
enableDragDrop: true,
.....


  var ddrow = new Ext.dd.DropTarget(Moca.LaGrid.getView().mainBody, {
            ddGroup : 'GridDD',
            copy:false,
            notifyDrop : function(dd, e, data){
                var sm=Moca.LaGrid.getSelectionModel();
                var rows=sm.getSelections();
                var ds = Moca.LaGrid.store;
                var cindex=dd.getDragData(e).rowIndex;
                for (i = 0; i < rows.length; i++) {
                    rowData=c.getById(rows[i].id);
                    if(!this.copy) {
                        ds.remove(ds.getById(rows[i].id));
                        ds.insert(cindex,rowData);
                    }
                };
            }
        });  

it is giving this.el is null ext-all.js (line7)

pls help?

1
At what point is the error being thrown?Keylan

1 Answers

1
votes

First guess would be that Moca.LaGrid has not been rendered to its container at the time ddrow was created, thus Moca.LaGrid.getView().mainBody would be null. Try creating ddrow after the GridPanel has been attached to its container.