jQWidgets Forums

jQuery UI Widgets Forums Navigation Tree Splitter, Tree & Tabs

This topic contains 4 replies, has 2 voices, and was last updated by  shimmoril 12 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Splitter, Tree & Tabs #7170

    shimmoril
    Participant

    I need to combine the splitter, tree and tab controls in a way that I can’t find a demo for.

    The splitter will contain an XML-populated tree on the left side, and a content area on the right. When an item in the tree is clicked, I need a new tab to open in the content area, displaying the appropriate data.

    I’ve set up my tree and splitter on a base page, but I have some questions about integrating the tabs. I’ve figured out how to get the clicked item label (var item = $(‘#navTree’).jqxTree(‘getItem’, args.element); var treeLabel = item.label;), but I can’t figure out how to get the ID from the XML. I was hoping there would be something similar to the grid functionality ($(“#viewUsersGrid”).jqxGrid(‘getrowdata’, row)).ID), but if there is, I haven’t stumbled across it.

    Splitter, Tree & Tabs #7177

    Peter Stoev
    Keymaster

    Hi shimmoril,

    Unfortunately, there’s no such API in jqxTree at present. However, you can use the jqxDataAdapter’s records array to retrieve the ID.

    Example:

    var id = dataAdapter.records[0].uid;

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Splitter, Tree & Tabs #7211

    shimmoril
    Participant

    How do I retrieve the ID for the specific row? You’ve got [0] there, can that be replaced with the tree id?

    Splitter, Tree & Tabs #7259

    Peter Stoev
    Keymaster

    Hi shimmoril,

    records is an array so to get the ID of a specific row, use its index:

    id of the sixth row:

    var id = dataAdapter.records[5].uid; 

    id of the second row:

    var id = dataAdapter.records[1].uid; 

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Splitter, Tree & Tabs #7260

    shimmoril
    Participant

    Right, I understand that, but when I’m clicking on a tree item, how do I know what that item’s index is in the records array?

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

You must be logged in to reply to this topic.