jQuery UI Widgets Forums Navigation Tree Tree Node Tooltips

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Tree Node Tooltips #3295

    ericheard
    Member

    I have a data source similar to the following (assuming no typos):

    var data = [
    { label: “Item 1“, description: “Description”, items: [
    { label: “Item 1.1“, description: “Description” },
    { label: “Item 1.2“, description: “Description” }
    ]
    },
    { label: “Item 2“, description: “Description” },
    { label: “Item 3“, description: “Description” },
    { label: “Item 4“, description: “Description”, items: [
    { label: “Item 4.1“, description: “Description” },
    { label: “Item 4.2“, description: “Description” }
    ]
    },
    { label: “Item 5“, description: “Description” },
    { label: “Item 6“, description: “Description” },
    { label: “Item 7“, description: “Description” }
    ];

    I pass this data into .jqxTree as the source. Is there a way to add tooltips to each item of the tree to show the Description?

    Tree Node Tooltips #3300

    Peter Stoev
    Keymaster

    Hi ericheard,

    There’s no built-in functionality for adding tooltips to the tree elements.

    You can use the following approach as a solution:

    1. Initialize the jqxTree.
    2. After the initialization, get all tree items and loop through them.
    3. Set the ‘title’ attribute for each tree element.

    var items = $('#jqxTree').jqxTree('getItems');
    $.each(items, function () {
    $(this.titleElement).attr('title', this.label);
    });

    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.