For some reason, setColumnColor does not appear to change anything in my dhtmlxgrid. Does this have something to do with the style overriding the setColumnColor method?
incomingloadsgrid = new dhtmlXGridObject(‘incomingloadsgrid’);
incomingloadsgrid.setImagePath(“/codebase/imgs/”);
incomingloadsgrid.setHeader(“,Load,Carrier,Origin,Pickup Date,Delivery Date,Status,Carrier Quote,Carrier Adjst.,Carrier Rate,Invoice Number,Invoice Received,Container Number,Action,#master_checkbox”);
incomingloadsgrid.setInitWidths(“20,40,,,55,55,55,50,50,50,40,65,55,55,30”);
incomingloadsgrid.setColAlign(“center,center,left,left,left,left,left,right,right,right,right,right,center,center,center”);
incomingloadsgrid.setColTypes(“ro,ro,ro,ro,ro,ro,ro,ed,ed,ed,ed,ed,ed,ro,ch”);
incomingloadsgrid.setSkin(“myskin”);
incomingloadsgrid.init();
incomingloadsgrid.parse(incomingloadDataJS,“jsarray”);
incomingloadsgrid.setColSorting(“str,int,str,str,str,str,str,str,str,str,int,str,str,str,str”);
incomingloadsgrid.attachEvent(“onRowSelect”, onRowSelected);
incomingloadsgrid.attachEvent(“onMouseOver”, onMouseOver);
incomingloadsgrid.attachEvent(“onCheck”, onCheck);
incomingloadsgrid.enableEditEvents(true, true, true);
incomingloadsgrid.setColumnColor(“,blue,#d5f1ff,orange,”);
//turn QuickPay rows red
for (i = 1; i <= incomingloadDataJS.length; i++) {
if (incomingloadData[i - 1][‘quick_pay’] == “1”) {
incomingloadsgrid.setRowTextStyle(i, “color:red;”);
}
}
Unfortunately we cannot reproduce this issue locally. Probably setColumnColor() is blocked by custom skin. Please try to use default one and check if method will work.
Disabling the custom skin did not work. The columns still will not change color
Hello,
method setColumnColor should be called before data is added:
incomingloadsgrid.setColumnColor(",blue,#d5f1ff,orange,");
incomingloadsgrid.parse(incomingloadDataJS,“jsarray”);
Tried that and it still doesn’t work. Any other ideas?
Could you please expain in detail what result do you want to achieve ?
The setColumnColor method sets backgroud color of a certain column. If you need to change some other styles, please use setRowTextStyle or setCellTextStyle methods.
I want to set the background color of certain columns. I am trying to use the setColumnColor method but nothing changes in the grid. I have tried changing skins, removing all other methods, moving the method before init, and so on.