background-color style wont work on dhtmlx grid headers

Though other style attributes work fine, the background-color of header rows cannot be set by setHeader(), attachHeader(), or setStyle.


[code]mygrid.setHeader(“Title,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan”, null, [“background-color:#00FF00;text-align:center;color:red;”, , , , , , ]);

mygrid.attachHeader(“Title,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan”, [“background-color:green;text-align:center;color:red;”, , , , , , ]);

mygrid.setStyle(“background-color:green;border-style:solid;border-width:1px;border-color:white;”, “”, “”, “”);

Each of these SHOULD cause the header of the grid to have a green background color, but none of them do so. I would think this shoudl override whatever is set in the linked stylesheet (dhtmlxgrid.css) but it does not. Does anybody have any insight?


Im ussing it this way:

mygrid.setHeader("Title","#cspan","#cspan","#cspan","#cspan","#cspan","#cspan", null, ["background-color:#00FF00;","text-align:center;color:red;","","","","","", ]);

Are you sure about that, Pacific15? 'Cause that syntax is contrary to all the documentation I’ve seen. it appears that you are missing some [] and have one-too-many comma-delimeters at the end.

Oh, and I’m using Grid v4.02_std.

It does seem odd that setHeader has three parameters while attachHeader has only two (the latter leaving out the splitSign parameter – null in my sample of setHeader and not present in my sample of attachHeader).

Your example has nine parameters, the last of which is an array of styles (first two of those styles with data, followed by five empty strings, and finally a null value due to the trailing comma). I can see wrapping the first seven of your parameters in brackets to make them a single array of seven; and I can see removing your trailing comma to make the last parameter an array of seven styles. This would make your example fit the documentation, but also not work for the header’s background-color setting, just like mine. Note that the other style selections (beside background-color) in my header work fine. Can you double-check your syntax and your version to see if we are on the same page? And then of course confirm that you can indeed set the background-color of the header?

Please, try to use: