Ticket #6445 (new task)

Opened 8 months ago

Last modified 2 months ago

[patch] [cla] Tree: support dropping between items

Reported by: bill Owned by: bill
Priority: normal Milestone: 1.3
Component: Dijit Version: 1.1.0
Severity: normal Keywords: alex
Cc:

Description

Currently tree can only support dropping onto the parent item, not dropping between two child items.

Taken from Alex's email.

Attachments

dndBetween.patch (9.7 kB) - added by cwalters 2 months ago.

Change History

Changed 3 months ago by Matt Sgarlata

Does anyone have an idea when this might be fixed? This is a major feature of our application.

Changed 3 months ago by Matt Sgarlata

I'd like to point out this is working in dojo 0.4. Is there any chance this could be moved up to the 1.2 milestone?

Without this feature we may have to downgrade, or load both the old and new versions of dojo at the same time =/

Changed 3 months ago by cwalters

Bill, I'm going to take a look at developing this functionality. If there are any considerations or advice that you're able to share, that would be great. :-)

Changed 3 months ago by bill

Oh that would be great. I think it's the onMouseMove() function in dijit/_tree/dndSource.js (search for "allowBetween"), and you can compare against dojo/dnd/Source.js (same function), since IIRC between-dropping works on a normal DnD source.

When you drop between the ordering info also needs to be communicated back to the data store (on drop). I think currently it puts the element last in the list.

Changed 2 months ago by cwalters

Changed 2 months ago by cwalters

This patch permits drops above and below nodes as well as the existing drop into functionality within the same tree. (External drop support seems to require changes to the store.newItem, and I didn't want to mess with that)

Single and multi-node reordering within a tree should now work as expected.

Changed 2 months ago by bill

  • milestone changed from 1.4 to 1.3

Hi cwalters, thanks for the patch! Can you file a CLA though (or if your company has a CCLA too that's fine), and let me know, so that I can look at this? Also, if you are signed onto IRC dojo let me know your id there (I'm wild.bill).

Changed 2 months ago by cwalters

Bill, the company I work for, Spider Strategies, has a CCLA. My IRC id is cwa1ters.

Changed 2 months ago by bill

  • summary changed from Tree: support dropping between items to [patch] [cla] Tree: support dropping between items

Great, OK, thanks for the patch!

Note: See TracTickets for help on using tickets.