PDA

View Full Version : Return from interceptor



AndreKR
15 May 2010, 5:43 PM
Hi,

I want to intercept Ext.tree.TreeDropZone.onNodeOver() only in the case that the drag source is a grid. I cannot use createInterceptor (Can I?) because I have to return from the function.

So I tried this which does not work:



listeners: { afterrender: function(tp) {
var orig_fnc = tp.dropZone.onNodeOver;
tp.dropZone.onNodeOver = function (nodeData, source, e, data) {
/*
if (source.grid) {
if (source.dragData.selections.length == 1)
return Ext.dd.StatusProxy.prototype.dropAllowed;
}
*/
return orig_fnc(nodeData, source, e, data);
};
}}
Apparently the original function has to be called in another scope.

What is the correct way to do this?

Regards,
André