Categories | Question details Back To List | ||
setImagePath not XTML valid for tree loading from HTML If we use: <div class="dhtmlxTree" id="sitemap_tree_categories" setimagepath="some path here"> 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? Answer posted by Support on Aug 21, 2008 02:16 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. Answer posted on Aug 21, 2008 05:23 So we can't set this with javascript? Answer posted by Support on Aug 21, 2008 09:38 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 Answer posted on Aug 21, 2008 09:41 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? Answer posted on Aug 21, 2008 10:19 Where/how do we set this in dhtmlxtree_start.js? Answer posted by Support on Aug 22, 2008 02:53 >>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/"); Answer posted on Aug 24, 2008 08:25 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. Answer posted on Aug 24, 2008 08:29 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(...); ?? Answer posted on Aug 24, 2008 08:46 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'); Answer posted by Support on Aug 25, 2008 02:12 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. Answer posted on Aug 25, 2008 08:40 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? Answer posted by Support on Aug 25, 2008 09:36 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. |