Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Jonathan on Nov 16, 2007 03:19
open dhtmlx forum
dhtmlxgrid, facelets and Firefox

I added dhtmlxgrid(v1.4) into facelets. The page renders in IE but does not in Firefox 2.0.0.9. The Firefox error console points to the following statement "var r = this.xHdr.insertRow(0)" in dhtmlxGrid.js as the cause of the problem. The error message reads "this.xHdr.insertRow is not a function". It does not even show the grid headers.

The page renders without errors in IE.
Answer posted on Nov 16, 2007 04:42
This is pretty stange error in source code the next statement present

   this.xHdr = document.createElement("TABLE");
   ....
   var r = this.xHdr.insertRow(0)

so there is no way in normal situation that this.xHdr will not have necessary methods.
The only possible reason of problem - the container used as source of grid is not attached to DOM at all ( some kind of node which was created, but not attached to DOM ) , in such case grid initialization may fail.


Answer posted by Jonathan on Nov 16, 2007 08:18
You can try it your self. It is easy to reproduce. Use any of your examples and convert it to use facelets (instead of plain html) and package it as a war file and deploy. Like I said earlier, it works fine under IE. The problem only happens in FF.


Answer posted by Eric on Dec 22, 2007 06:30

I have hit the same problem today under dhtmlxgrid 1.5 using Firefox 2.0.0.11

this.xHdr.insertRow is not a function

  dhtmlXGridObject("gridbox")

     var r = this.xHdr.insertRow(0)

and firebug says it is dhtmlxgrid.js (line 23)

(header of dhtmlxgrid.js says //v.1.5 build 71114 )

The same code is working fine under IE 6.0

Has anyone found a solution, or cause, of this?

Answer posted by Support on Dec 22, 2007 06:44
If problem still occurs for you - please provide any kind of sample where it can be reconstructed ( you can send it directly to support@dhtmlx.com )
Answer posted by chris cleverley on Apr 14, 2008 08:04
I have the same issue. Which looks fixable.

The problem is that I am displaying pages in strict html.

My headers are:

header('Content-Type: application/xhtml+xml; charset=utf-8');

If I switch this off them my issue goes away.  Looking on the internet:

In HTML, Document.createElement() will create an element in the HTML namespace. In XML (including XHTML), the namespace is defined by both DOM2 and DOM3 to be null.
  • In XHTML, browsers lack interoperability in this area. In Firefox, the namespace is dependent upon the MIME type. In Opera, it's dependent upon the root element and in Safari, it's always null.
So, it looks fixable. You just have to create the table differently. There may be more after this though due to the header.


Answer posted by Support on Apr 14, 2008 10:17
>>header('Content-Type: application/xhtml+xml; charset=utf-8');
We not support usage of grid with such docuement content type
Not only the grid creation code must be different , but the DOM operation with grid need to be slightly adjusted as well, and introduced changes will break work of grid in older browsers.
Answer posted on May 25, 2008 08:56
I have always wanted to use your products but have been drawing back from doing so because they do not work fine with facelets and firefox. Is there a fix for the above problem? I have just tried your latest version of the grid (1.6) and I am getting the same problem with firefox 2.0.0.14 and facelets. The same source code (nothing changed) works fine in IE 7.

Another Jonathan
Answer posted by Support on May 26, 2008 03:57
The component itself work in both IE and FF, the problem in your case most probably caused by some specific of Facelets framework
We will check possible reasons of the problems.