Hi, I just tried your dhtmlx4.4 standart version, but we have a problem here,
index.html
<script>
myLayout = new dhtmlXLayoutObject({
parent: document.body,
pattern: "1C",
cells: [{id: "a", text: "dhtmlxMenu"}]
});
myMenu = myLayout.cells("a").attachMenu({
icons_path: "../../dhtmlxMenu/common/imgs/",
xml: "../../dhtmlxMenu/common/dhxmenu.xml"
});
dhxTabbar = myLayout.cells("a").attachTabbar();
dhxTabbar.addTab("a1", "<div style='font-size: 10pt;'>Welcome</div>", null, null, null, false);
dhxTabbar.tabs("a1").setActive();
myMenu.attachEvent("onClick", function(id, zoneId, casState){
dhxTabbar.addTab(id, "<div style='font-size: 10pt;'>"+id+"</div>", null, null, null, true);
dhxTabbar.tabs(id).setActive();
dhxTabbar.tabs(id).attachURL("test.js?etc="+ new Date().getTime(), true);
})
</script>
dhxmenu.xml
<?xml version="1.0"?>
<menu>
<item id="file" text="File">
<item id="new" text="New" img="new.gif" imgdis="new_dis.gif"/>
</item>
</menu>
test.js
<script>
var dhxLayout1 = dhxTabbar.cells("new").attachLayout("1C");
dhxLayout1.cells("a").setText("New");
</script>
these screenshots :
select menu (File → New)
then close Tab ‘new’, But I got this result :
How to solve this?
Thank you.
If I changed Menu to Tree, The same problem happened too.
index.html
myLayout = new dhtmlXLayoutObject({
parent: document.body,
pattern: "2U",
cells: [{id: "a", width: 150, text: "dhtmlxTree"}]
});
dhxTabbar = myLayout.cells("b").attachTabbar();
dhxTabbar.addTab("a1", "<div style='font-size: 10pt;'>Welcome</div>", null, null, null, false);
dhxTabbar.tabs("a1").setActive();
myTree = myLayout.cells("a").attachTree();
myTree.setImagePath("../../../codebase/imgs/dhxtree_skyblue/");
myTree.loadXML("../common/tree.xml");
myTree.attachEvent("onClick", function(id){
if(id == "new"){
if(!dhxTabbar.tabs(id)){
dhxTabbar.addTab(id, "<div style='font-size: 10pt;'>"+id+"</div>", null, null, null, true);
dhxTabbar.tabs(id).setActive();
dhxTabbar.tabs(id).attachURL("test.js?etc="+ new Date().getTime(), true);
}else
dhxTabbar.tabs(id).setActive();
}
})
tree.xml
<?xml version='1.0' encoding='iso-8859-1'?>
<tree id="0">
<item text="Books" id="books" open="1">
<item text="New" id="new">
</item>
</item>
</tree>
these screenshots :
select Tree (File → New)
then close Tab ‘new’, But I got this result :
Darya
July 24, 2015, 2:34pm
#4
Hello
If you use not default skin (not “skyblue”) you need to set skin to every component you use. If your case not only layout, but menu, tabbar, etc
Hello Darya,
Thank you for your replay,
Ok Now, i am using dhx_skyblue skin, however this problem is still existing,
<html>
<head>
<title>Integration with dhtmlxTree</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
<script src="../../../codebase/dhtmlx.js"></script>
<style>
html, body {
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
overflow: hidden;
}
</style>
<script>
var myLayout, myTree;
function doOnLoad() {
myLayout = new dhtmlXLayoutObject({
parent: document.body,
pattern: "2U",
cells: [{id: "a", width: 150, text: "dhtmlxTree"}]
});
dhxTabbar = myLayout.cells("b").attachTabbar();
dhxTabbar.setArrowsMode("auto");
dhxTabbar.addTab("a1", "<div style='font-size: 10pt;'>Welcome</div>", null, null, null, false);
dhxTabbar.tabs("a1").setActive();
myTree = myLayout.cells("a").attachTree();
myTree.setImagePath("../../../codebase/imgs/dhxtree_skyblue/");
myTree.loadXML("../common/tree.xml");
myTree.attachEvent("onClick", function(id){
if(id == "new"){
if(!dhxTabbar.tabs(id)){
dhxTabbar.addTab(id, "<div style='font-size: 10pt;'>"+id+"</div>", null, null, null, true);
dhxTabbar.tabs(id).setActive();
dhxTabbar.tabs(id).attachURL("test.js?etc="+ new Date().getTime(), true);
}else
dhxTabbar.tabs(id).setActive();
}
})
}
</script>
</head>
<body onload="doOnLoad();">
</body>
</html>
these screenshots :
Hello, any solutions for this issue?
Thank’s
Andrei
July 29, 2015, 2:17pm
#7
Hi
please try attached
dhtmlx_44_fixed.zip (290 KB)
Hi Andrei,
It is working now. I love this product and forum.
Thank you
ritteh
July 30, 2015, 12:13am
#9
Agh, I spent too much time on this issue. Hopefully you’ll fix it in the main distribution.
From what I can tell, the error is in dhtmlxwindows.js
document.body.className = String().replace(/\s{0,}dhxwins_vp_auto/gi, "");
Should be
document.body.className = String(document.body.className).replace(/\s{0,}dhxwins_vp_auto/gi, "");
I agree with you @ritteh
OR a new version of dhtmlx will be released soon ?
Andrei
August 11, 2015, 6:19am
#11
Hi
there is no certain date regarding upcoming release. if you need fix - just open dhtmlx.js find =String().replace and replace with =String(document.body.className).replace
Ok andrei,
Thank’s for your info. I really appreciate it