Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by David Ratz on Dec 09, 2009 00:20
open dhtmlx forum
Grid setSyle problem with Chrome

The following code works fine in Firefox 3.5 and IE8, but doesn't work in Chrome (3.0.195.33).

function init_observations_grid() {
var mygrid = new dhtmlXGridObject("observations_grid");
mygrid.setImagePath("[% c.uri_for('/static/Dhtmlx/dhtmlxGrid/codebase/imgs/') %]");
mygrid.setSkin("phnMain");
mygrid.setStyle("white-space:nowrap;",";",";",";");
mygrid.enableMultiselect(false);
mygrid.enableSmartRendering(true,100);
mygrid.attachEvent("onBeforeSorting", function(colInd,colSort,direction) {return doOnBeforeSorting(colInd,colSort,direction);});
mygrid.attachEvent("onEditCell", function(stage,rowId,cellInd,newVal,oldVal) {return doOnEditCell(stage,rowId,cellInd,newVal,oldVal);});
mygrid.attachEvent("onXLE", function(gridObject,rowCount) {return doOnXLE(gridObject,rowCount);});
mygrid.attachEvent("onXLS", function(gridObject) {return doOnXLS(gridObject);});
mygrid.init();
return mygrid;
}

I get a DOMCoreException in the dhtmlxgrid.js setStyle() function. If I comment out the setStyle row it works, but my headers look terrible. I also tried many combinations of styles, empty strings and nulls in the command, but to no avail.

Is there any workaround for this?
Answer posted by dhxSupport on Dec 10, 2009 08:16
What version of dhtmlxGrid do you use? Your code works without errors with dhtmlxGrid ver. 2.5
Answer posted by David Ratz on Dec 12, 2009 22:37
We're still using version 2. We will be upgrading to 2.5 in the near future, but until then is there any fix / workaround?