Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Bert on Feb 18, 2009 04:09
open dhtmlx forum
dhtmlxWindow and dhtmlxEditor

Loading an editor in a window is no problem.
But when the editor is unloaded and another url is loaded into the window, Internet Explorer gives an error, FF doesn't.

Sample :

<html>
<head>
<script src="win_codebase/dhtmlxcommon.js"></script>
<script src="win_codebase/dhtmlxwindows.js"></script>
<script src="editor_codebase/dhtmlxeditor.js"></script>
<script src="tb_codebase/dhtmlxtoolbar.js"></script>
<script language="javascript">
var dhxWins;

function Init()
{
dhxWins = new dhtmlXWindows();
dhxWins.setSkin("modern_black");
dhxWins.setImagePath("win_codebase/imgs/");
    
var w= dhxWins.createWindow("w", 150, 100, 200, 120);
w.button("minmax1").hide();
w.button("park").hide();
w.button("close").hide();
w.button("stick").show();
    
w.button("stick").attachEvent("onClick", function()
{
w_dhxEditor = w.attachEditor("standard");
w_dhxEditor.setIconsPath("editor_codebase/imgs/");
w_dhxEditor.init();
        
w.button("stick").hide();
w.button("sticked").show();
});
    
w.button("sticked").attachEvent("onClick", function()
{
w.attachURL("some_url", true);
w.button("sticked").hide();
w.button("stick").show();
});    
}
</script>
<link rel="stylesheet" type="text/css" href="win_codebase/skins/dhtmlxwindows_modern_black.css">
<link rel="stylesheet" type="text/css" href="win_codebase/dhtmlxwindows.css">
<link rel="stylesheet" type="text/css" href="win_codebase/dhtmlxwindows_modern_black.css" />
<link rel="stylesheet" type="text/css" href="editor_codebase/skins/dhtmlxeditor_standard.css">
<link rel="stylesheet" type="text/css" href="tb_codebase/skins/dhtmlxtoolbar_standard.css">
<style>
html, body { width:100%; height:100%; }
</style>
</head>
<body onLoad="Init();"></body>
</html>

On page load, the window is initialized. (resizing is no problem)
When you click on the stick button, the editor is loaded into the window. (resizing is no problem)
Then click on the unstick button and some_url is loaded into the window.
Now trying to resize gives an error in IE.

Is there a solution for this error ?

Answer posted by Support on Feb 20, 2009 07:45
It seems windows replace attached editor with new url incorrect.
Try the following code please:

w.button("sticked").attachEvent("onClick", function()
{
w.editor = null; // add this line
w.attachURL("some_url", true);
w.button("sticked").hide();
w.button("stick").show();
}); 
Answer posted by Bert on Feb 23, 2009 05:01

ok, problem solved.