Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Rachel H. on Mar 08, 2009 23:28
open dhtmlx forum
dhtmlxWindows image path issues

Hi,

I'm having an problem with some images that dhtmlxWindows is trying to load. Here is what the dhtmlx code is trying to load.

/cm/codebase/imgs/dhxwins_dhx_blue/active/icon_normal.gif
/cm/codebase/imgs/dhxwins_dhx_blue/inactive/icon_normal.gif

The page that is loading the dhtmlxWindows is in my directory called "cm".

That is being appended on the beginning of those image paths. This seems to happen when my main layout loads.

I looked at the code in dhtmlxwindows.jp and found the exact reference that is not working properly:

win.icons = new Array(this.imagePath+this.pathPrefix+this.skin+"/active/icon_normal.gif", this.imagePath+this.pathPrefix+this.skin+"/inactive/icon_normal.gif");

This is in the createWindow function.

I did some testing and this.imagePath and this.pathPreix and this.skin are all properly set. So, whatever then uses that array accidentally doesn't use relative paths or absolute paths or something to display the image!

Help would be much appreciated.

Thank you,
Rachel
Answer posted by Alex (support) on Mar 09, 2009 07:55

Hi, 

I have attached the latest windows version. Try to use it instead of the original one. 

If the problem still persists, please provide the complete sample to recreate it.

Attachments (1)
Answer posted by Rachel H. on Mar 09, 2009 10:06

Unfortunately, that new code completely busted my site and the layout doesn't seem to work at all anymore.  Is there new layout code that I should be using as well?

Just for reference, your sample code no longer works with that file either:

http://www.ihistory.com/dhtmlx/dhtmlxWindows/samples/init/extended_init.html

I downloaded the full free suite on 2/10/2009 to give you reference.  I have paid professional versions of Tree and Grid.

Also for your reference, I use windows on my site in addition to the layout.  Activating the windows stand-alone do not cause the files to not be found.  So perhaps it is happening in the layout code?

I have a full app running using lots of components so a full set of sample code would be hard to come by.  But, here is where the error seems to be:

    // Build Layout
    var layout = "2U";
    var myLayout = new dhtmlXLayoutObject("parentId", layout);

    //myLayout.cells("a").hideHeader(true);
    myLayout.cells("a").setText("My Contacts");
    myLayout.cells("a").setWidth(200);
    myLayout.cells("a").attachObject("folder_pane");
    myLayout.cells("b").hideHeader();

Any other thoughts?  I'm not sure what those images are even used for.  Can I get rid of the references to them somehow to prevent this?

Answer posted by Alex (support) on Mar 10, 2009 02:52

Hello, 

I have tested the sample page you provided. Windows work correctly here - there are no any errors.

Please, see attached archive with window and layout samples.

Attachments (1)
test.zip63.61 Kb
Answer posted by Rachel H. on Mar 27, 2009 13:38

I researched this and found out the problem.

When dhtmlxlayout.js calls createWindow, there is no image path set for the dhtmlxWindows object.  The result is that it looks in its relative path (codebase/imgs).  Since I'm calling this code from a directory called cm/, it's looking in cm/codebase/imgs for the image.

Well, that path doesn't exist.

I'm not sure of the *right* way to fix this, but what I did is I went into dhtmlxlayout.js and added the following line of code before the createWindow call:

this.dhxWins.setImagePath("/media/dhtmlx/dhtmlxWindows/codebase/imgs/");

(this.dhxWins will change depending on the name of the object)

Anyway, I truly hope this helps someone in the future.  Not sure what I could have done to avoid it.

Rachel