-
12 Jan 2012 11:40 AM #11
-
13 Jan 2012 1:48 AM #12
-
19 Jan 2012 2:30 AM #13
I have had some trouble figuring out where to put the override in an Ext 4 MVC application. The launch method of Ext.application seems to be a good place, so:
PHP Code:,launch: function() {
//... some other stuff here
Ext.view.DropZone.override({
onNodeDrop : function (node, dragZone, e, data) { var me = this,
dropHandled = false,
// Create a closure to perform the operation which the event handler may use.
// Users may now set the wait parameter in the beforedrop handler, and perform any kind
// of asynchronous processing such as an Ext.Msg.confirm, or an Ajax request,
// and complete the drop gesture at some point in the future by calling either the
// processDrop or cancelDrop methods.
dropHandlers = {
wait : false,
processDrop : function () {
me.invalidateDrop();
me.handleNodeDrop(data, me.overRecord, me.currentPosition);
dropHandled = true;
me.fireViewEvent('drop', node, data, me.overRecord, me.currentPosition);
},
cancelDrop : function () {
me.invalidateDrop();
dropHandled = true;
}
},
performOperation = false;
if (me.valid) {
performOperation = me.fireViewEvent('beforedrop', node, data, me.overRecord, me.currentPosition, dropHandlers);
if (dropHandlers.wait) {
return;
}
if (performOperation !== false) {
// If either of the drop handlers were called in the event handler, do not do it again.
if (!dropHandled) {
dropHandlers.processDrop();
}
}
}
return performOperation;
}
});
//... some other stuff here
Use the scope, Luke.
-
26 Mar 2012 3:14 PM #14
Thanks annette and timriedel! I couldn't get to the ticket since I don't have premium, but timriedel's solution worked. Everywhere I seemed to put it just did not work at all.
Success! Looks like we've fixed this one. According to our records the fix was applied for
a bug in our system
in
a recent build.



Reply With Quote