grid.init chrome bug

Hello,

I am trying to create grids dynamically so later in the code I can attach them to layout cells. I am storing the grids in a JavaScript object. I got this working correctly in Firefox, but when I checked Chrome I am getting a “TypeError: Cannot read property ‘tagName’ of null” error. I have narrowed it down to the grid’s init function. I am attaching the code that is causing the issue in a small test file. In IE and Firefox the test file will simply open a blank page, in Chrome it alerts the error type and description.

Thanks in advance.

Kameron
grid bug.zip (281 KB)

I have debugged the source code and figured out that this shows up when a parent object attached to the page is not passed in during the creation of the grid. Firefox and IE simply ignore this in the init(), but Chrome throws the error.

The page I am working on must have grids that are not attached to an object and I would like to avoid attaching it to something, then detaching it into an array of grids.

Is there a simple way to force Chrome to ignore this?

Thanks again,

Kameron

You can’t create grid without provide a parent container

a) you need to use first param of constructor as

var grid = new dhtmlXGridObject(“some_real_id”);

or
b) you need to attach grid directly to cell

var grid = cell.attachGrid();

OK, well what would your suggestion be to solve the problem that I am trying to fix, using the predefined API, without making it do a lot of extra work?

I understand that not attach a grid to something on the constructor may be an odd request, but it would be very useful if one wants to be able to filter which DHTMLX objects to display. This may be something to think about in the next version?

Thanks,

Kameron