Window "setImagePath" not a fuction error?

I’m creating a popup window from a previously initiated dhxLayout. My code is as follows:

var popupWindow = dhxLayout.dhxWins.createWindow("addContacts",50,50, 500, 500); dhxLayout.dhxWins.window("addContacts").centerOnScreen(); dhxLayout.dhxWins.window("addContacts").setText("Add Contact"); dhxLayout.dhxWins.window("addContacts").setImagePath("codebase/imgs/");

Everything looks okay when I run this, but Firebug throws up a TypeError: dhxLayout.dhxWins.window(…).setImagePath is not a function. What am I doing wrong?

Thanks!

You need to include all LAYOUT and WINDOW files:

<link rel="stylesheet" type="text/css" href="../dhtmlxLayout/codebase/dhtmlxlayout.css"> <link rel="stylesheet" type="text/css" href="../dhtmlxLayout/codebase/skins/dhtmlxlayout_dhx_skyblue.css"> <script src="../dhtmlxLayout/codebase/dhtmlxcommon.js"></script> <script src="../dhtmlxLayout/codebase/dhtmlxlayout.js"></script> <script src="../dhtmlxLayout/codebase/dhtmlxcontainer.js"></script> <script src="../dhtmlxLayout/codebase/patterns/dhtmlxlayout_pattern4l.js"></script> <link rel="stylesheet" type="text/css" href="../dhtmlxWindows/codebase/dhtmlxwindows.css"> <link rel="stylesheet" type="text/css" href="../dhtmlxWindows/codebase/skins/dhtmlxwindows_dhx_skyblue.css"> <script src="../dhtmlxWindows/codebase/dhtmlxwindows.js"></script>

Hello,

I had dhtmlxlayout page that works well. Now i created dhtmlxwindows page that works well too. I need to include libraries in same file. When i do this, dhtmlxwindows still works well but dhtmlxlayout’s error is "this.dhxWins.setImagePath is not a function ". Also whole layout turns to empty a b c layout like samples. I tried to include other files but nothing is changed.

Note: dhtmlxwindows’ version is newer, upgrading dhtmlxlayout’s version is not allowed.

Hello
In common dhtmlx doesn’t support usage of different versions.
Could you tell us your window and layout versions? If you have pro suit and active support, it will be better to open a ticket and we will analyze, how can we help you to use all functionality you need.

Hi

first you need to remove this line:
dhxLayout.dhxWins.window(“addContacts”).setImagePath(“codebase/imgs/”);

regarding this.dhxWins.setImagePath:
correct, this function is deprecated since 4.0, if you plan to mix layout and windows versions you need to attach dhtmlx_deprecated.js (or dhtmlxwindows_deprecated.js depending on used components)

and I strongly recommend you to update to the latest version - be on the edge of technologies :wink: