View Full Version : ExtJS replacements for tree dropZone's onNodeOver etcpp.

Jan (HL)
21 Nov 2011, 6:28 AM
With Ext JS 3, we could register/override within "ddConfig" methods like onNodeEnter, onNodeOver. Because real callbacks weren't available this was the only possibility to make things like: Render the current target/drop node's background red if dropping not allowed ("extended" text) or a custom check if the drop is allowed (in a special context, e.g. a grid's account row from the right aren't allowed to drop on the left tree's customers node). Earlier, the grid's drag configuration supported a dynamic getter callback generating a custom drag text.
Actually, I would prefer a better official and public callback api. However, it'd worked.

Now with Ext JS 4, the stuff moved into views' plugins and it seems impossible -- or not easy without breaking something -- to extend the drag and drop functionality. Some initializations only use some props or fixed types.

Beforedrop does not solve anything, because it checks only AFTER dropping. But for an UI I have to check BEFORE the user (can) drop(s).

Small notice: The drag and drop guide of the documentation isn't up to date and doesn't handle the table (grid/tree) plugins drag/drop.

21 Nov 2011, 9:01 AM
I honestly couldn't agree more that we need a better public API with correct events (with correct behavior) and template methods that could be overridden.

21 Nov 2011, 9:59 AM
I am doing a deep dive into DnD today from DOM to Tree and am noticing much of the same. I remember something about the Sencha Team had ambition to rewriting the DnD framework but could not due to time constraints.

That said, I will be writing a lot about this in the next ext js in action edition. DnD is a huge library and choosing the right path is absolutely essential for success. For example, using DDProxy with the same ddGroup as a DropZone will not work!

Jan (HL)
21 Nov 2011, 10:13 AM
What do you mean, did I have a chance to make a proper solution based on official apis now? I'd chosen the api way in ExtJS 3, meaning only configure via ddConfig. No elements ops, no direct DOM manipulations (except an addCls/removeCls).
I thought that the dd.* stuff is too low leveled (in relation to grids and trees).

(The drag and drop feature is nice and wonderful, but the our current upgrade process up to 4 has so many issues that this has a lower priority right now.)