开发者

Can I add a node to a tree without adding it to the dataProvider?

开发者 https://www.devze.com 2022-12-21 13:11 出处:网络
I\'ve got a couple trees that I allow a user to drag and drop from one to another, works great except one apparent limitation. I\'m picking up where they drop it in the list and adding it to the dataP

I've got a couple trees that I allow a user to drag and drop from one to another, works great except one apparent limitation. I'm picking up where they drop it in the list and adding it to the dataProvider manually. The user can drop it everywhere except after the last child of any particular node it seems, since it reads that position as being between the node and it's next sibling.

It seems the 开发者_开发技巧best way to deal with this is to add something like a dummy leaf so the user has something to drop the item in front of. I don't want this leaf in the dataProvider, so is it possible to add a leaf (or a folder) to the tree without adding it to the dataProvider? if so how?


Unfortunately, that is not possible.


Thanks Gabriel, I worked around the issue by adding the item when a node is opened, removing it when the node is closed, also loop through and remove it all before data is committed to the DB.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号