jQuery UI Widgets Forums Navigation Tree How to get parentid of selected record

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • How to get parentid of selected record #9531

    zohaib
    Member

    Hi,

    I am able to get selected item id and text using following

    event.args.id OR event.args.element.id
    $(event.args).text()

    I want know how to get parentid?

    My Code as follows

    <pre style='max-width: 740px; width: 740px; margin: 5px; padding: 5px;' class='code'>$(<span style=" clear: both; padding: 0px; margin: 0px; color: #a24;">'#jqxWidget').bind('select'</span>, function (event) <div/>{<div/>	alert(event.args.element.id);<div/>	document.getElementById(<span style="clear: both; padding: 0px; margin: 0px; color: #a24;">"hiddenID"</span>).value=event.args.element.id;<div/>	$(<span style="clear: both; padding: 0px; margin: 0px; color: #a24;">"#ContentPanel").html("<span style="clear: both; padding: 0px; margin: 0px; color: #11a;">&lt;div style=<span style=" clear: both; padding: 0px; margin: 0px; color: #a24;">'margin: 10px; direction:rtl;'</span>&gt;</span>" + event.args.element.id + "<span style="clear: both; padding: 0px; margin: 0px; color: #11a;">&lt;/div&gt;</span>"</span>);<div/>});<div/><div/>$(<span style="clear: both; padding: 0px; margin: 0px; color: #a24;">"#jqxWidget"</span>).bind(<span style=" clear: both; padding: 0px; margin: 0px; color: #a24;">'itemclick'</span>, function (event) {<div/>	$(<span style="clear: both; padding: 0px; margin: 0px; color: #a24;">"#eventLog").html("Id: " + event.args.id + ", Text: " + $(event.args).text() + ", parentid: "</span> + $(event.args).text() );<div/>});<div/></pre>

    – Thanks
    Zohaib.

    How to get parentid of selected record #9536

    zohaib
    Member

    Hi Dimitar,

    Any solution about this?

    – Thanks
    Zohaib.

    How to get parentid of selected record #9658

    Dimitar
    Participant

    Hello Zohaib,

    The following code gets the parent element’s id:

                $('#jqxTree').bind('select', function (event) {
    var htmlElement = event.args.element;
    var item = $('#jqxTree').jqxTree('getItem', htmlElement);
    var parentId = item.parentId;
    alert(parentId);
    });

    Best Regards,
    Dimitar

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

    How to get parentid of selected record #9671

    zohaib
    Member

    Hi Dimitar,

    Many thanks for information.

    🙂

    – Thanks
    Zohaib.

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

You must be logged in to reply to this topic.