To Load the Dynamic Data in Tree using JSON(REF#389992835

Issue is we are not able to load the OU items in the Tree using JSON?

We have a requirement to load the OUItems using DHTMLx tree dynamically and started applying the logic of what DHTMLX samples suggested (13_tree_dyn_loading.html).

Logic is using the ASP when we use sample it’s loading properly.when we get the actual data from server and assigning to the control it’s failed to load the tree.Basically we are using the LoadJSON() method.

Please go thru it and reply ASAP.

Note:

1.If we put the same data using LoadJSONObject() it’s displyaing the tree properly.
2.Once this issue is resolved then we are ready to purchase a Professional edition.

Tree.html


json.asp file

<%
Dim url_var, iCount, sContainer
url_var= 0
id = Request.QueryString(“id”)
if (len(id) > 0 ) then
url_var = id
sContainer = id
else
url_var = 0
sContainer = “DC=abcd,DC=ORG”
end if
Dim Util
set Util = Server.CreateObject(“CUtility.DUtil”)
Dim sHtml
Dim sErrorOut

        'shtml contains the JSON Data below mentioned one (Server data is)
         Util .GetOUSTreeJSON "ddddd", "Point://" & sContainer , sHtml, sErrorOut
Response.write "{id:"""& url_var & """, " 
Response.write sHtml
Response.write "}"

%>

Server data is:

{id:“0”, item: [{id:“CN=Builtin,DC=DDDD,DC=ORG” ,text:“Builtin” },{id:“CN=Computers,DC=DDDD,DC=ORG” ,text:“Computers” },{id:“CN=ForeignSecurityPrincipals,DC=DDDD,DC=ORG” ,text:“ForeignSecurityPrincipals” },{id:“CN=Users,DC=DDDD,DC=ORG” ,text:“Users” },{id:“OU=DWW_OU,DC=DDDD,DC=ORG” ,text:“DER_OU” },{id:“OU=SSSl_OU,DC=DDDD,DC=ORG” ,text:“Dinil_OU” },{id:“OU=Domain Controllers,DC=DDDD,DC=ORG” ,text:“Domain Controllers” },{id:“OU=DoNotDelete,DC=DDDD,DC=ORG” ,text:“DoNotDelete” }]}

What is OUItems?

You should add child:‘1’ attribute to each item which will has children:

{id:'0', item:[ {id:'0-0', text:'level 1-0-0', child:'1' } ,{id:'1-0', text:'level 1-1-0', child:'1' } ,{id:'2-0', text:'level 1-2-0', child:'1' } ,{id:'3-0', text:'level 1-3-0', child:'1' } ,{id:'4-0', text:'level 1-4-0', child:'1' } ]}

Olga,

Thanks for your reply.Now we are able to add the Items one thing we missed the “child” due to that it’s not displayed.
However,One more Question:

How to do the error handling in Dynamic Data in a Tree ?

if the Child items are empty in a tree and How to handle the Empty values while dynamically loading a Tree ?

Please reply it ASAP.

I think it’s better to check on server side if item will not have childerend and do not add “child” attribute.
BTW, dhtmlxTree has errors handing mechanism, please check docs.dhtmlx.com/doku.php?id=dhtm … r_handling

Thanks for your reply. I have one more query regarding Json.

How to put UserData in Json format?
Is it supported currently ?
If it is supported please let me know what is the format of Json for UserData.

Thanks
Rajkumar.

Rajkumar,

please have a look at the post:

viewtopic.php?f=3&t=12526

Thanks it really helps.
While working on my test environment, I observed we need change some setting on IE to display the Tree in browser.
Could you please let us know what are recommended IE setting and the rationale behind it?

Can i get a answer to my earlier question?

Hello,

I observed we need change some setting on IE to display the Tree in browser.

What settings did you need to change ?

Thanks for responding.

Run ActiveX controls and Plug-ins to “enable” and Script ActiveX controls marked safe for Scripting* to “enable”

Thanks,
Rajkumar

Please take a look at the attached image for IE settings.

Thanks,
Rajkumar

Hello,

yes, these options need be enabled, as Ajax requires ActiveX object to load data. However, there are enabled by default in IE.