jQuery UI Widgets › Forums › Navigation › Tree › Removing items from jqxTree
Tagged: #jquery-tree, javascript tree, jqxtree, removing node
This topic contains 9 replies, has 6 voices, and was last updated by Bogdan W. 5 years, 4 months ago.
-
Author
-
I tried the following code:
var items = $('#jqxTree').find('li'); for (i=0; i<items.length; i++) { $('#jqxTree').jqxTree("removeItem", items[i]); } But items are not removed. Would you please tell me where I have gone wrong.
- This topic was modified 10 years, 11 months ago by Antony.
- This topic was modified 10 years, 11 months ago by Antony.
- This topic was modified 10 years, 11 months ago by Peter Stoev. Reason: Moved to Tree Forum
Hi Antony,
To clear all tree items, you can do this:
$(“#jqxTree”).find(‘ul:first’)[0].innerHTML = “”;
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
Thank you very much for your reply. I tried the code provided by you. The tree gets empty, but ‘getItems’ method still returns the removed children also.
Thanks and regards
AntonyHi Peter,
Please help me to get removeItem working. As mentioned earlier after setting innerHTML=””, getItems still returns all removed items.
Hi Antony,
To remove the items array, you can do this:
$(‘#jqxTree’).find(‘ul:first’)[0].innerHTML = “”;
$(‘#jqxTree’).jqxTree({ items: [] });Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi all.
How can I remove a single item with the children?
I use$('#jqxTree').jqxTree('removeItem', treeItems[b].element);
, but
$("#jqxTree").jqxTree('getItems')
returns me a list with a removed element.
Hi Igor,
By using the removeItem method, the UI element is physically removed from jqxTree, but unfortunately, the item’s data isn’t removed from the items array. That’s an issue which is logged into our bug tracking system. We’ll do our best to resolve it in a future version of jQWidgets. Thank you for the provided feedback!
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi have the same problem with the Remove-getItems,
Do you have temporary solution to work around this problem ?
Regards
Hi,
similar issue here…
When deleting an element, the getSelectedItem keeps returning the deleted element.
Anyway to workaround it in the meantime we wait for the solution?Thanks in advance
Has this issue been resolve?
I ran into it and … it is 2018 now!
If there is any workaround it please let me know. -
AuthorPosts
You must be logged in to reply to this topic.