jQuery UI Widgets Forums Navigation Tree Add element’s id

Tagged: , , ,

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Add element’s id #10647

    kisianhsang
    Member

    How to detect tree’s element removed id?

    Add element’s id #10691

    Dimitar
    Participant

    Hello kisianhsang,

    I assume you would like to use the removeItem method as follows:

    $('#jqxTree').jqxTree('removeItem', element);

    In that case, you can do the following:

                var items = $('#jqxTree').jqxTree('getItems'); // the items variable contains an array of all the items
    var firstElement = items[0].element; // items[i].element gets the element of the i-th item
    $('#jqxTree').jqxTree('removeItem', firstElement); // the element is removed

    You may, however, need the items’ ids. You can get them this way:

                var items = $('#jqxTree').jqxTree('getItems'); // the items variable contains an array of all the items
    var firstID = items[0].id; // items[i].id gets the id of the i-th item

    Best Regards,
    Dimitar

    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.