jQuery UI Widgets Forums Navigation Tree Removing items from jqxTree

This topic contains 9 replies, has 6 voices, and was last updated by  Bogdan W. 6 years, 11 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
  • Removing items from jqxTree #5930

    Antony
    Member

    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.
    Removing items from jqxTree #5940

    Peter Stoev
    Keymaster

    Hi Antony,

    To clear all tree items, you can do this:

    $(“#jqxTree”).find(‘ul:first’)[0].innerHTML = “”;

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Removing items from jqxTree #5943

    Antony
    Member

    Hi 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
    Antony

    Removing items from jqxTree #5955

    Antony
    Member

    Hi Peter,

    Please help me to get removeItem working. As mentioned earlier after setting innerHTML=””, getItems still returns all removed items.

    Removing items from jqxTree #5957

    Peter Stoev
    Keymaster

    Hi Antony,

    To remove the items array, you can do this:

    $(‘#jqxTree’).find(‘ul:first’)[0].innerHTML = “”;
    $(‘#jqxTree’).jqxTree({ items: [] });

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Removing items from jqxTree #10263

    Igor
    Participant

    Hi 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.

    Removing items from jqxTree #10274

    Peter Stoev
    Keymaster

    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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Removing items from jqxTree #11845

    kingdomp
    Participant

    Hi have the same problem with the Remove-getItems,

    Do you have temporary solution to work around this problem ?

    Regards

    Removing items from jqxTree #12846

    akerbeltz
    Member

    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

    Removing items from jqxTree #98231

    Bogdan W.
    Participant

    Has this issue been resolve?
    I ran into it and … it is 2018 now!
    If there is any workaround it please let me know.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.