This topic contains 3 replies, has 2 voices, and was last updated by  Dimitar 9 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Tree Idea Posts
  • Tree Idea #59777

    Rob
    Participant

    Return the parent item of an item.

    jqxTeee(‘getParentItem’, childItem);

    Tree Idea #59780

    Dimitar
    Participant

    Hello Rob,

    This can be achieved through the method getItem, i.e.:

    var item = $('#jqxTree').jqxTree('getItem', element);
    var parentElement = item.parentElement;

    Best Regards,
    Dimitar

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

    Tree Idea #59781

    Rob
    Participant

    Hello Dimitar,

    I am still learning (and need to learn a lot) 😉 but i think i did not express my idea/wish good enough.
    I don’t want the <html> parent element but the item seen as parent on the screen.
    For example a tree consist of playlist names and each playlist has a number of songs attached. When i click the song i like to have the playlist item returned. Maybe to notice that my parent and child list elements are composed of <div> and an number of other html elements.

    Thanks,
    Rob

    Tree Idea #59916

    Dimitar
    Participant

    Hi Rob,

    In that case, the solution is:

    var item = $('#jqxTree').jqxTree('getItem', element);
    var parentElement = item.parentElement;
    var parentItem = $('#jqxTree').jqxTree('getItem', parentElement);
    var parentLabel = parentItem.label;

    Best Regards,
    Dimitar

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

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

You must be logged in to reply to this topic.