jQWidgets Forums

jQuery UI Widgets Forums Navigation Tree "removeItem" method bug?

This topic contains 2 replies, has 2 voices, and was last updated by  aorlic 11 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • "removeItem" method bug? #25399

    aorlic
    Member

    Hi!

    Before I initialize my Tree widget, I “decorate” each item with some custom-data that I need later in code (for example, the item’s “id”. This was working fine, even the update, till I try to remove an item.

    I use the following typical code to remove the selected item:

    ...
    var item = $('#Tree').jqxTree('getSelectedItem');
    $('#tree').jqxTree('removeItem', item);
    ...

    The problem is that the item is not fully removed. It remains in the tree, but the label is renamed to oneof these custom attributes I’ve added – id.

    Do you have some idea about this?
    Is there some better way to attach some data to each tree item?

    Thank you,

    Aleks.

    "removeItem" method bug? #25400

    Peter Stoev
    Keymaster

    Hi,

    Each item in the Tree has id. If you change it in some way, that may lead to unexpected results. For removing items correctly see this sample: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxtree/settings.htm?web

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    "removeItem" method bug? #25466

    aorlic
    Member

    Ok, thank you Peter. I’ll have to rename my own “id” and it should fix it.

    On the other side, it would make your great product even greater, if you could have these things and restrictions documented. I was sure the problem is in the “decoration” attributes and could never imagine that there are some “reserved” words.

    Thanks once more and good bye.

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

You must be logged in to reply to this topic.