Is there any way to apply a specific CSS class to all cells in a given column in a JQGrid?
+3
A:
Based off the documentation, looks like you can give columns specific classes when setting up your colModel:
jQuery("#grid_id").jqGrid({
...
colModel: [
{ name: ..., classes: "col1", ... },
{ name: ..., classes: "col2", ... },
...
],
...
});
Then you should be able to just style as normal, eg:
td.col1 { background-color: #f00; }
Alconja
2009-12-21 02:44:31
Great, thanks - I missed that. I'm using the new ASP.NET wrapper that they came out with, and apparently it doesn't expose 100% of the underlying API. Very frustrating.
Herb Caudill
2009-12-21 03:36:03
+1
A:
Hello Herb,
We are sorry for that. We have now implemented the functionality you need, and it is available through the CssClass property off the column, e.g.
Code:
<trirand:JQGridColumn DataField="City" CssClass="cityClass" ... />
When you do that, the "cityClass" css class will be applied to all cells in the "City" column. We have updated our ASP.NET download, please re-download from there:
http://www.trirand.net/download.aspx
and replace your Trirand.Web.Dll with the one available in the .zip download.
Please, let us know if this helps. If you need anything else, just let us know and we will quickly add it to the product.
Regards, Rumen Stankov Trirand