I have tried to implement the solution suggested in this post, but unfortunately, it did not work for me: jqGrid change background color of specific column headers
Even after trying various CSS entries, I still couldn't get the color to change to yellow as desired.
.ui-jqgrid-htable .ford {
background-color: yellow !important;
background-image: none;
}
.ui-jqgrid .ui-jqgrid-htable .ford {
background-color: yellow !important;
background-image: none;
}
.ui-jqgrid .ui-jqgrid-htable th.ui-th-column-header .ford {
background-color: yellow !important;
background-image: none;
}
.ui-jqgrid .ui-jqgrid-htable .ui-jqgrid-hbox .ford {
background-color: yellow !important;
background-image: none;
}
.ui-jqgrid .ui-jqgrid-htable th .ford {
background-color: yellow !important;
background-image: none;
}
This is how I set up the grid:
$('#list').jqGrid({
url: "/User/GetGridData",
mtype: "GET",
datatype: "json",
colNames: ['', 'ID', 'Name', 'Email', 'ford Browser', 'ford Team', 'ford Director', 'chevy Browser', 'chevy Editor','chevy Team','Tool Admin',''],
colModel: [
{ name: 'edit', index: 'edit', width: 5, sortable: false, search: false, formatter: editRow },
{ name: 'id', index: 'id', width: 1, hidden: true, editable: false, key: true },
{ name: 'userName', index: 'userName', width: 75, align: 'left', editable: true, searchoptions: { sopt: ['eq', 'cn'] } },
{ name: 'userEmail', index: 'userEmail', width: 100, align: 'left', editable: true, search: false },
{ name: 'fordBrowser', index: 'fordBrowser', classes: 'ford', width: 35, align: 'center', editable: true, searchoptions: { sopt: ['eq', 'cn'] }, formatter: checkboxFormatter, formatoptions: { disabled: false } },
{ name: 'fordTeam', index: 'fordTeam', classes: 'ford', width: 35, align: 'center', editable: true, searchoptions: { sopt: ['eq', 'cn'] }, formatter: checkboxFormatter, formatoptions: { disabled: false }},
{ name: 'fordDirector', index: 'fordDirector',classes: 'ford', width: 35, align: 'center', editable: true, searchoptions: { sopt: ['eq', 'cn'] }, formatter: checkboxFormatter, formatoptions: { disabled: false }},
{ name: 'chevyBrowser', index: 'chevyBrowser', classes: 'chevy' , width: 35, align: 'center', editable: true, searchoptions: { sopt: ['eq', 'cn'] }, formatter: checkboxFormatter, formatoptions: { disabled: false }},
{ name: 'chevyEditor', index: 'chevyEditor', classes: "chevy" , width: 35, align: 'center', editable: true, searchoptions: { sopt: ['eq', 'cn'] }, formatter: checkboxFormatter, formatoptions: { disabled: false }},
{ name: 'chevyTeam', index: 'chevyTeam', classes: 'chevy' , width: 35, align: 'center', editable: true, searchoptions: { sopt: ['eq', 'cn'] }, formatter: checkboxFormatter, formatoptions: { disabled: false }},
{ name: 'adminInd', index: 'adminInd', classes: 'admin', width: 35, align: 'center', editable: true, searchoptions: { sopt: ['eq', 'cn'] }, formatter: checkboxFormatter, formatoptions: { disabled: false } },
{ name: 'delete', index: 'delete', width: 8, sortable: false, search: false, formatter: deleteRow }
],
emptyrecords: 'No records',
pager: "#pager",
rowNum: 1000,
rowList: [],
pgbuttons: false,
pgtext: null,
recordtext: 'Total Records {2}',
sortname: 'userName',
sortorder: 'asc',
viewrecords: true,
caption: '',
gridComplete: function () {
},
jsonReader:
{
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems: false,
Id: "0"
},
width: 1500,
height: 400,
_search: true
});
Is there a different method I can try to change the colors of the column headers?