PDA

View Full Version : grid Table drop item issue



sarabjeetd
9 Apr 2012, 6:01 AM
I have a 2 grid panels. I am dragging an item from one grid panel to another. I am using DragZone and DropZone for this feature.
Inside the onNodeDrop method, When I add the dropped record to the grid, it fires an itemUpdate event which sends an afterEdit(update) event to the store which is backing the grid. In this case, I donot want the store to do anything. This happends repeatedly which causes the following exception:

Ext.define.onUpdateextjs/src/view/Table.js:674 (http://localhost:8080/lwdiag/extjs/src/view/Table.js)
fireext-debug.js:12981 (http://localhost:8080/lwdiag/extjs/ext-debug.js)
Ext.define.continueFireEventObservable.js:282 (http://localhost:8080/lwdiag/extjs/src/util/Observable.js?_dc=1333979139621)
Ext.define.fireEventObservable.js:255 (http://localhost:8080/lwdiag/extjs/src/util/Observable.js?_dc=1333979139621)
Ext.define.afterEditAbstractStore.js:770 (http://localhost:8080/lwdiag/extjs/src/data/AbstractStore.js?_dc=1333979140292)
Ext.define.callStoreModel.js:1391 (http://localhost:8080/lwdiag/extjs/src/data/Model.js?_dc=1333979139543)
Ext.define.afterEditModel.js:1351 (http://localhost:8080/lwdiag/extjs/src/data/Model.js?_dc=1333979139543)
Ext.define.setModel.js:916 (http://localhost:8080/lwdiag/extjs/src/data/Model.js?_dc=1333979139543)
Ext.define.onNodeDropapp/view/desktop/shared/MetricDropZone.js:91 (http://www.sencha.com/forum/chrome-devtools://devtools/app/view/desktop/shared/MetricDropZone.js)
Ext.define.notifyDropextjs/src/dd/DropZone.js:246 (http://localhost:8080/lwdiag/extjs/src/dd/DropZone.js)
Ext.define.onDragDrop

The code for onNodeDrop is as follows:



// Process the drop event if we have previously ascertained that a drop is OK.
onNodeDrop: function(target, dd, e, dragData) {
debugger;
if (this.dropOK) {
target.record.set(dragData.metricData.name, dragData.metricData.value);
return true;
}
}


I have looked at the examples at drag-drop examples at
http://dev.sencha.com/deploy/ext-4.0.7-gpl/docs/index.html#!/example

from where I got the idea of using dropZone.

I am using Ext JS 4.1.0 Beta 2a

sarabjeetd
9 Apr 2012, 6:03 AM
The exception is : Uncaught Type Error: Cannot call method 'hasCls' of null : Table.js line 674