setImagePath not XTML valid for tree loading from HTML

If we use:





W3 validation for XHTML says setimagepath is not a valid attribute. We want the tree to load from HTML for SEO purposes.



Is there a way to set the image path somewhere else while still initiating from HTML?

The path can be set only by such attribute.
Technically you can update dhtmlxtree_start.js and hardcode setImagePath command with necessary arguments there , instead of using attribute.

So we can’t set this with javascript?

The image path need to be set after tree object created, but before data loaded in it. In case of init from HTML layout - object creating and data loading is a single operation, so you must
a) use setImagePath attribute
b) hardcode setImagePath command inside dhtmlxtree_start.js

Is there not a way to to init from HTML but not automatically through the include script?  For instance, by passing the ID of the outermost list element or something similar?

Where/how do we set this in dhtmlxtree_start.js?

Where/how do we set this in dhtmlxtree_start.js?
dhtmlxtree_start.js , line 24
var t=new dhtmlXTreeObject(obj,“100%”,“100%”,0);
can be replaced with
var t=new dhtmlXTreeObject(obj,“100%”,“100%”,0);
t.setImagePath(“some/hardcoded/path/here/”);

I don’t think this will work for us as we include the script in multiple different paths in our application.  The application is also deployed on many different servers so we can not set an absolute URL.


Your documentation states we can use:
var myTree = dhtmlXTreeFromHTML(‘listBox’);


But I can’t get this to work, it simply renders it automatically since we include the _start file.

I assumed we could do…
var myTree = dhtmlXTreeFromHTML(‘listBox’);

myTree.setImagePath(…);

??

I can modify the dhtmlXTreeFromHTML function to take in an image path.  but we can’t get it to work if we use dhtmlXTreeFromHTML 2 or more times on the same page?  Works fine when using it once, but not twice like…

var sitemap1 = dhtmlXTreeFromHTML(‘sitemap1’);
var sitemap2 = dhtmlXTreeFromHTML(‘sitemap2’);


If you have added setImagePath it necessary location, it will be executed each time when new tree instance created, so it must affect all tree objects on the page.
If problem still occurs for you - please send any kind of sample where issue can be reconstructed.

I have tried this:
var sitemap1 = dhtmlXTreeFromHTML(‘sitemap1’);
var sitemap2 = dhtmlXTreeFromHTML(‘sitemap2’);

Which does not work.  It doesn’t load the tree at all.  This is with using the normal setImagePath attribute in the HTML.

Can dhtmlXTreeFromHTML not be used twice on the same page?



You can use dhtmlXTreeFromHTML as many times as necessary, while using it against different html containers.


If problem still occurs for you - please provide any kind of sample where issue can be reconstructed.