Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by chrisz on May 22, 2009 08:36
open dhtmlx forum
Layout image path

I am having trouble getting the layout to find the icons/imgs for resize, collapse, etc. If I keep the original structure, it works fine:
dhtmlx.js
dhtmlx.css
imgs/

However I would prefer to put the files in appropriate sub-directories:
jslib/dhtmlx.js
styles/dhtmlx.css
imgs/

When I do this, the layout cannot find the icons. I have set both of the following functions, but it still does not work:
window.dhx_globalImgPath="imgs/";
myLayout.setImagePath("imgs/");

Any ideas?
Thank you
Answer posted by Support on May 22, 2009 09:51
>>When I do this, the layout cannot find the icons
Most images defined by css rules
  - check dhtmlxlayout_dhx_blue.css ( or css of used skin ) 
  - locate lines which contain background-image: url("../imgs
  - update them with necessary path ( relative path from location of css image to new location of imgs folder ) 
Answer posted on May 22, 2009 11:22
Thank you.
However that begs the question, what's the point of the "setImagePath()" (and related) functions?
Answer posted by dhxSupport on May 25, 2009 02:44
The images which are part of skin - defined in css 
The images which can be set through API ( tree icons in tree for example, icons in menu and toolbar ) uses path defined by setImagePath

The layout itself doesn't require a setImagePath to be rendered correctly, but when path defined, any components, initialized in layout ( tree, menu, toolbar etc. ) will use it by default. So command allows to define path only once, for all layout, instead of defining separate paths for each component.