Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Nirmala Kolur on Jun 27, 2008 00:22
open dhtmlx forum
dhtmlTree

Hello Team,



As you people are providing a method to get “TEXT” attribute value from “ID”

/**
* @desc: return node text
* @param: itemId - id of node
* @type: public
* @return: text of item (with HTML formatting, if any)
* @topic: 6
*/
dhtmlXTreeObject.prototype.getItemText=function(itemId)
{
var temp=this._globalIdStorageFind(itemId);
if (!temp) return 0;
return(temp.htmlNode.childNodes[0].childNodes[0].childNodes[3].childNodes[0].innerHTML);
};

---------------------------------------------------------------------------
Want to know how to get the value of attribute “PATH” from my xml file


<?xml version="1.0" encoding="ISO-8859-1"?>
<tree id="0">
<item text="myXML" open="1" select="1" id="myXML">

<item text="drag_n_drop" id="drag_n_drop" path="C:\Documents and Settings\Nirmala\Desktop\dhtmlxTree\dhtmlxTree\samples">
<item text="frames1" id="frames1" path="C:\Documents and Settings\Nirmala\Desktop\dhtmlxTree\dhtmlxTree\samples\drag_n_drop"/>
<item text="frames2" id="frames2" path="C:\Documents and Settings\Nirmala\Desktop\dhtmlxTree\dhtmlxTree\samples\drag_n_drop"/>
</item>
</item>
</tree>

------------------------------------------------


Let me know how can I get the “PATH” value from my xml file from "ID"

Regards,
Nirmala Kolura
Answer posted by Support on Jun 27, 2008 01:41
If you are using latest version of dhtmlxtree, you can use attached extension - just include it in addition to existing file, and you will be able to access any attribute as
    var path = tree.getAttribute("frames1","path");

In older versions of dhtmlxtree attributes are not accessible, the only way to store additional info - userdata sections.
Attachments (1)