jQWidgets Forums

jQuery UI Widgets Forums General Discussions Navigation Tree added event jqxtree

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • added event jqxtree #28951

    markcarpe
    Member

    Can you tell me how to get the newly added item/element of a jqxtree with the following constraints?

    – Item is added using addto method, and can be added anywhere in the target tree nested hierarchy.
    – Item label and value can be duplicates in target tree so cannot use them as unique identifiers
    – Added event returns array of items but in list order, not order of creation
    – The id of the selected element in the target, after which new item will be placed, cannot be used as search parameter in looking through the Added event array for the next item (the id gets changed)

    I can think of some hacks but was wondering how you would do it.

    e.g. set disable to true in source, look for true in target and then set disable to false again. In my case disable is not used in the tree.

    Any ideas are appreciated!

    added event jqxtree #28953

    Peter Stoev
    Keymaster

    Hi markcarpe,

    The Tree has a method getItems. It returns an Array of all items. You can check whether the item that you wish to add has a value that matches the value of any of the items returned by the getItems method. If there is a match, do not add that item.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.