Opened 10 years ago

Last modified 10 years ago

#11877 closed defect

TreeStoreModel: incorrect insertion of new items — at Version 1

Reported by: Eric Pasquier Owned by:
Priority: high Milestone: 1.6
Component: Dijit Version: 1.5
Keywords: Tree TreeStoreModel Cc:
Blocked By: Blocking:

Description (last modified by bill)

The newItem function of TreeStoreModel is trying to pass an insertIndex parameter to store.newItem, which do not follow the dojo.data.api.write specification, and is not used by the store. This is making all new items created at the end of the children list.

The Model should managed the insert position after the creation of the new item.

For example, pasteItem can be used to move the position of the new Item :

// Create new item in the tree, based on the drag source.
LnewItem=this.store.newItem(args, pInfo);

// Move the new item to the insertIndex position
if (LnewItem && (insertIndex!=undefined)){
  this.pasteItem(LnewItem, parent, parent, false, insertIndex);
}

Change History (1)

comment:1 Changed 10 years ago by bill

Description: modified (diff)

I agree, looks like a bug. Are you seeing this problem when dropping external items onto the Tree in a specified position (where that horiziontal bar shows up to indicate drop position)?

Note: See TracTickets for help on using tickets.