dhtmlxGrid 2.5 Header don't load on IE7

Hi !



When I try to test the grid on IE7 it doesn’t work while it’s ok on FireFox.



Here is my code :



function doOnLoad() {

    mygrid = new dhtmlXGridObject(‘gridbox’);

    mygrid.setImagePath(“resources/ajax/imgs/”);

    mygrid.setHeader(“xxxx,xxxx,xxxx,xxxx,xxxx”);

    mygrid.setInitWidths(",100,100,100,100");

    mygrid.setColAlign(“left,right,right,right,right”);

    mygrid.setColTypes(“ro,ro,ro,ro,ro”);

    mygrid.setColSorting(“na,na,na,na,na”);

    mygrid.setSkin(“modern”);

    mygrid.attachEvent(“onRowSelect”,myHandler);

    mygrid.init();

    mygrid.enablePaging(true,30,3,“pagingArea”,true,“recinfoArea”);

    mygrid.setPagingSkin(“bricks”);

mygrid.loadXML(“getSelectedPage.action”);

}



The warning of IE send me to this funtion of th Grid :



/**

@desc: sets new column header label

* @param: col - header column index

* @param: label - new label for the cpecified header’s column. Can contai img:[imageUrl]Text Label

* @param: ind - header row index (default is 0)

* @type: public

* @topic: 3,6

/

this.setColumnLabel=function(c, label, ind, hdr){

var z = (hdr||this.hdr).rows[ind||1];

var col = (z._childIndexes ? z._childIndexes[c] : c);

if (!z.cells[col]) return;

if (!this.useImagesInHeader){

var hdrHTML = “



if (label.indexOf(‘img:[’) != -1){

var imUrl = label.replace(/.[([^>]+)].*/, “$1”);

label=label.substr(label.indexOf("]")+1, label.length)

hdrHTML+=""

}

hdrHTML+=label;

hdrHTML+="
";



z.cells[col].innerHTML=hdrHTML;



if (this._hstyles[col])

z.cells[col].style.cssText=this._hstyles[col];

} else { //if images in header header

z.cells[col].style.textAlign=“left”;

z.cells[col].innerHTML="";

//preload sorting headers (asc/desc)

var a = new Image();

a.src=this.imgURL+""+label.replace(/(.[a-z]+)/, “.des$1”);

this.preloadImagesAr[this.preloadImagesAr.length]=a;

var b = new Image();

b.src=this.imgURL+""+label.replace(/(.[a-z]+)/, “.asc$1”);

this.preloadImagesAr[this.preloadImagesAr.length]=b;

}

if ((label||"").indexOf("#") != -1){

var t = label.match(/(^|{)#([^}]+)(}|$)/);

if (t){

var tn = “in_header”+t[2];

if (this[tn])

this[tn]((this.forceDivInHeader ? z.cells[col].firstChild : z.cells[col]), col, label.split(t[0]));

}

}

}

This particular instruction can’t be executed by IE : z.cells[col].innerHTML=hdrHTML;



Thank you for your help.

Are you using setColumnLabel method in your code? Be sure if this method called after mygrid.init()


No I’m not using  setColumnLabel.



Should I add it ?

Yes ! this method is called after the init().

Please provide us complete example where we can reproduce this issue (you can send such example directly to the support@dhtmlx.com)