length error in DataGrid with IE

I have created a datagrid with filters perfectly working with Firefox and Chrome, but not with Internet Explorer.

I have the following error

Message: ‘length’ is null or is not an object
Line: 607
Carachter: 105
Code: 0
URI: localhost/dhtmlxSuite/dhtmlxGrid … mlxgrid.js

How can I fix such error?

Only with Internet Explorer I have an empty row; I’m sure the result of the query doesn’t give me back an empty recordset.

The code of my datagrid follows

<link rel="STYLESHEET" type="text/css" href="dhtmlxSuite/dhtmlxGrid/codebase/dhtmlxgrid.css">
<script src="dhtmlxSuite/dhtmlxGrid/codebase/dhtmlxcommon.js"></script>
<script src="dhtmlxSuite/dhtmlxGrid/codebase/dhtmlxgrid.js"></script>
<script src="dhtmlxSuite/dhtmlxGrid/codebase/dhtmlxgridcell.js"></script>
<script  src="dhtmlxSuite/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_dhxcalendar.js"></script>
<script  src="dhtmlxSuite/dhtmlxGrid/codebase/ext/dhtmlxgrid_filter.js"></script>

<link rel="STYLESHEET" type="text/css" href="dhtmlxSuite/dhtmlxCalendar/codebase/dhtmlxcalendar.css">
<link rel="STYLESHEET" type="text/css" href="dhtmlxSuite/dhtmlxCalendar/codebase/skins/dhtmlxcalendar_yahoolike.css">
<script  src="dhtmlxSuite/dhtmlxCalendar/codebase/dhtmlxcalendar.js"></script>	

<div id="mygrid_container" style="width:1294px; height:323px;"></div>
<script>
mygrid = new dhtmlXGridObject('mygrid_container');
mygrid.setSkin('modern');
mygrid.setImagePath('dhtmlxSuite/dhtmlxGrid/codebase/imgs/');
mygrid.attachHeader("#select_filter,#text_filter,#text_filter,#select_filter,#select_filter,#select_filter");
mygrid.setHeader('Cliente,Contratto,Data Contratto,Stato Contratto,BC Team,PM,idContratto');
mygrid.setColSorting('str,str,date,str,str,str,int');
mygrid.setInitWidths('387,305,125,145,222,93,0');
mygrid.setColTypes('ro,ro,dhxCalendar,ro,ro,ro,coro');
mygrid.setColAlign('left,left,center,center,center,center,center');
mygrid.init();

var datagrid = [<? echo $datagrid; ?>];
mygrid.parse(datagrid,"jsarray");

Try to call setHeader before attachHeader method.

I’ve modified the following code:

mygrid.attachHeader("#select_filter,#text_filter,#text_filter,#select_filter,#select_filter,#select_filter");
mygrid.setHeader('Cliente,Contratto,Data Contratto,Stato Contratto,BC Team,PM,idContratto');

in

mygrid.setHeader('Cliente,Contratto,Data Contratto,Stato Contratto,BC Team,PM,idContratto');
mygrid.attachHeader("#select_filter,#text_filter,#text_filter,#select_filter,#select_filter,#select_filter");

but nothing changes, the error is not fixed and I’ve still an empty row.

there’s another bug: the #select_filter don’t work in IE because of that error

Your code works as expected at the local example. Try to download latest version of dhtmlxGrid and call grid initialization script on page load.
If issue still occurs please provide us complete demo where we can reproduce it.

My code was wrong because of a coma (,) after last recordset of the grid.
Simething like [‘field1-1’,‘field1-2’,‘field1-3’],[‘field2-1’,‘field2-2’,‘field2-3’],[‘field3-1’,‘field3-2’,‘field3-3’],
The red coma caused me the error

:imp: