Opened 8 years ago
Closed 7 years ago
#18142 closed task (fixed)
DnD item disappears when drop in Tree with betweenthreshold...
Reported by: | overtune | Owned by: | bill |
---|---|---|---|
Priority: | undecided | Milestone: | 1.11 |
Component: | Dijit | Version: | 1.10.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Hi!
I'm having some problem with getting DnD to work correctly with a Tree component. The problem occurs when dropping an item between two other (with betweenthreshold). The problem seems to exist in the demo-application of the Tree component to: http://dojotoolkit.org/reference-guide/1.10/dijit/Tree.html#betweenthreshold
Start the demo and drag and drop "Africa" between "Oceania" and "Europe". This causes "Africa" to disappear...
Change History (4)
comment:1 Changed 8 years ago by
comment:2 Changed 7 years ago by
Probably it's just a "bug" in the example code. As https://github.com/dojo/dijit/blob/master/tree/ObjectStoreModel.js says:
To support drag and drop, besides implementing getChildren() and dojo/store/Observable, the store must support the parent option to put(). And in order to have child elements ordered according to how the user dropped them, put() must support the before option.
I don't see the example code doing the support for "before" and IIRC the Memory store doesn't support it natively.
PS: Looks like I messed up the example in https://github.com/dojo/docs/commit/a21f591bf351a93385c2be040dc0fb5de4908274. Probably it was working before that change, running against the old ItemFileWriteStore? instead of dojo/store/Memory.
comment:3 Changed 7 years ago by
Milestone: | tbd → 1.11 |
---|---|
Owner: | set to bill |
Status: | new → assigned |
Type: | defect → task |
OK, for I'll revert the example in the doc to when it was working, against dojo/data.
If you want to support betweenThreshold against a dojo/store (rather than against a dojo/data), you'll need to make the store's put() method handle the before
option. Therefore, I think you'll need for each parent to keep a list of its children rather than each child having a reference to its parent.
comment:4 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Anyone else having this problem? It can be recreated in the latest releases of Firefox/Chrome/Safari? on the Mac. In IE I can't seem to get any demos on dojotoolkit to work right now (it only opens up a white popup). But when I test the Drag n drop locally I get the same "disappearing bug" on IE as well.