Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by DjekLU on Nov 14, 2008 14:12
open dhtmlx forum
Tree: edit xml <item .... param1=1>

How i made: create or edit some params in xml.
Fow example, i need more elemet in taf <item>:
simple:
<item id="p1" text="parent item 1" select="1" call="1">
i need:
<item id="p1" text="parent item 1" select="1" call="1" param1=1 param2=2>

and i need edit this parameters: param1 & param2
Answer posted by Support on Nov 17, 2008 01:52
You can use any custom attributes in XML, and later use 
var value = tree.getAttribute(id,"param1");
....
tree.setAttribute(id,"param1",value)

( dhtmlxtree_attrs.js required ) 
Answer posted on Nov 17, 2008 11:17
nice, but this function  is not described in DHTMLX Docs Explorer.
Answer posted on Nov 17, 2008 20:30
can we do the same thing for grid/treegrid? or is that only for tree?
Answer posted by Support on Nov 18, 2008 01:56
>>can we do the same thing for grid/treegrid? or is that only for tree?
Similar functionality available for grid
http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Storing_additional_data.html#grid_art_userdata
Answer posted by DjekLU on Nov 18, 2008 13:31
ok, this function maybe run in greed,
but i use tree and:
Tree.getAttribute('param1');
not found this function.

The question is opened;

Answer posted on Nov 18, 2008 22:48
corret by prev post:

Tree.getAttribute(id,'param1');
Answer posted by Support on Nov 19, 2008 03:54
In case of dhtmlxtree, you need to inlude
         codebase/ext/dhtmlxtree_attrs.js required
this extension will add support for getAttribute|setAttribute methods.
Answer posted by DjekLU on Nov 20, 2008 07:47
at this link i found answer for my question: http://dhtmlx.com/docs/products/kb/index.shtml?cat=1&page=1&q=5495

You can use two ways to store additional data 
userdata
        tree.setUserData(id,"type","typeA");
cell ( pro only, dhtmlxtree_attrs.js )
       tree.setAttribute(id,"type","typeA")


but in Doc's i can't find describe about this function and can't read that this function avaliable at prof version.

Answer posted by Support on Nov 21, 2008 01:53
Documentation will be updated in nearest time.