Problem upgrading to 2.5

Since upgrading to 2.5 my own javascript functions appear to be undefined after the layout object is created even though they are there.



A simplified snippet of code from the body:







The layout is rendered correctly if I remove the alerts and do not call my own Javascript functions.

alert(‘a’); works

alert(‘b’); gives the following error:

[Exception… “Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMWindowInternal.alert]” nsresult: “0x80004005 (NS_ERROR_FAILURE)” location: "JS frame :: 10.1.1.11/jobtracker_dev/js/dhtm … xlayout.js

Line 40



Note that parent.dhxLayout is created in the head section and works fine. Due to the way I need to mix php and javascript with the framework I am using I can’t put the above code in the head section and besides it worked perfectly before the upgrade.


Please, check that all necessary js and css libraries are included. The sample is dhtmlxLayout/samples/01_init/01_object.html ( dhtmlx.com/docs/products/dht … bject.html )

Thanks. I’d already looed at the sample.
These are the js and css files:

<link rel=“stylesheet” type=“text/css” href=“<?php echo $css_path ?>main.css”  media=“screen” />


 
 
 




<?php
  use_javascript('jquery-1.3.2.min.js');
  use_javascript('json2.js');

  use_javascript('dhtmlx/codebase/dhtmlxcommon.js');
  use_javascript('dhtmlx/codebase/dhtmlxlayout.js');
  use_javascript('dhtmlx/codebase/dhtmlxcontainer.js');

  use_javascript('dhtmlx/codebase/dhtmlxgrid.js');
  use_javascript('dhtmlx/codebase/dhtmlxgridcell.js');
  //use_javascript('dhtmlx/codebase/ext/dhtmlxgrid_json.js');
  use_javascript('dhtmlx/codebase/ext/dhtmlxgrid_srnd.js');
  use_javascript('dhtmlx/codebase/ext/dhtmlxgrid_filter.js');
//   use_javascript('dhtmlx/codebase/ext/dhtmlxgrid_hmenu.js');
  use_javascript('dhtmlx/codebase/dhtmlxtabbar.js');
  use_javascript('dhtmlx/codebase/ext/dhtmlxtabbar_wins.js');
  // dhtmlxWindows
?>
<?php
  use_javascript('dhtmlx/codebase/dhtmlxwindows.js');
if (is_object($guardUser))

  // dhtmlxToolbar
  use_javascript('dhtmlx/codebase/ext/dhtmlxwindows_wtb.js'); 
  use_javascript('dhtmlx/codebase/dhtmlxtoolbar.js'); 
?> 
<?php
  // dhtmlxStatusbar
  use_javascript('dhtmlx/codebase/ext/dhtmlxwindows_sb.js');
  use_javascript('dhtmlx/codebase/dhtmlxaccordion.js');
?>
<?php
  use_javascript(‘utils/dhtmlxutils.js’);
}
  include_javascripts() ;

The issue wasn’t reproduced locally. The sample is attached
sample.zip (46.9 KB)

Thanks - The sample works but that doesn’t help me.
I presume that when I get the error saying that my own function isn’t defined it is because of an error further up on the page which is not being reported.
I noticed that in v2, dhxLayoutRight is wrapped in an iframe but in v2.5 it is not. Why would this be and how can I control it?

I got the inner iframe back by changing:

   dhxLayoutRight = new dhtmlXLayoutObject(parent.dhxLayout.cells(“b”), “<?php echo $hasChildView ? "2E" : "1C" ?>”, “dhx_skyblue”);


to

   dhxLayoutRight = new dhtmlXLayoutObject(document.body, “<?php echo $hasChildView ? "2E" : "1C" ?>”, “dhx_skyblue”);

and now it all magically works.