jQWidgets Forums

jQuery UI Widgets Forums Navigation Tree How to get id of the selected item from jqxtree

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  SumitRoy 10 years ago.

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

  • Subramanain
    Participant

    Hi Team,

    My Jqxtree data source is :
    jobTree_source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘id’ },
    { name: ‘parentid’ },
    { name: ‘text’ },
    { name: ‘value’ }
    ],
    id: ‘id’,
    localdata: data
    };

    I want to get id of the selected item. hence have tried like below but getting some different output:
    function getSelectedItemId(){
    var item = $(‘#jqxTree’).jqxTree(‘getSelectedItem’);
    alert(item.label); // Showing correct label value
    alert(item.id + ” – ” +item.Id); //jqxWidget44780a18- undefined.
    }

    Please help any one what is wrong and how to fix this issue. Thanks in advance.


    SumitRoy
    Participant

    here is the solution

    var item = $(‘#jqxTree’).jqxTree(‘getSelectedItem’);
    var id= $(item).attr('id')

    thanks
    Sumit Roy

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

You must be logged in to reply to this topic.