Hi,
We have layout and attached a tabbar then we implement the dock and undock for this layout. When we dock the layout, the tabbar also refresh.
Is there a way not to refresh when we dock and undock.
This only happens in Firefox and Chrome but not in IE.
Thanks,
Joseph
Hi,
Please provide the code with layout and tabbar initialization.
Hi,
Here are sample codes that we mentioned, layout.html contains a layout and attach a tabbar, cell a1 have an href content of tabbar.html and this html when onload call init and alert a message “init”.
If you open layout.html in Firefox, it will alert “init”, then click the undock icon, it will undock and call alert “init” again. But it IE, the when you click undock icon, it will not alert “init”.
Hope this codes help. Let us know if there is a way to stop to refresh or alert “init” when we undock from the layout in Firefox and Chrome.
<a href="javascript:undock();"><img src="codebase/tabbar/imgs/dhx_blue/btn_dock.gif" style="height: 20px; border: none;"/></a>
<script>
function init() {
alert("init");
}
function undock() {
parent.layout.cells("a").undock();
}
</script>
layouttabbar.zip (944 Bytes)
Hi,
we have reproduced the issue. Some browsers refresh an iframe when its parent has been changed.
The following allows not to show alert after undock/dock:
function init() {
if(!parent.skipInit)
alert(“init”);
}
function undock() {
parent.skipInit = true;
parent.layout.cells(“a”).undock();
}
Thanks for the reply,
Actually, there are other line of codes after the alert(“init”); and if we apply if(!parent.skipInit), this will not execute the rest of the codes.
Additional codes in the tabbar.html init function:
function init() {
var layout = new dhtmlXLayoutObject("grid", "1C", "dhx_blue");
layout.cells("a").hideHeader();
var grid = layout.cells("a").attachGrid();
grid.setImagePath("js/dhtmlxGrid/codebase/imgs/");
grid.setHeader("grid");
grid.setSkin("dhx_blue");
grid.init();
grid.parse("<?xml version='1.0' encoding='iso-8859-1'?><rows><row id='1'><cell>grid 1</cell></row></rows>", function(){
alert("init");
});
}
So, is there a way to replicate the behavior of IE when undock/dock in Firefox and Chrome which will not refresh the tabbar.html.
Thanks,
Joseph
Joseph,
unfortunately, there is not such a way. However, you may avoid using iframe. In this case the grid won’t be reloaded