Reputation: 1289
I have the following colModel,
colModel:[
{name:'alertid',index:'alertid', width:0, align:'left', sortable:false,hidden:true, resizable:false},
{name:'name',index:'name', width:12, sortable:false, resizable:false, classes:'colCell'},
{name:'alerttype',index:'alerttype', width:0, align:'left', sortable:false, hidden:true, resizable:false}
],
and the class:
.colCell {
padding-left: 15px
}
But the class is not being applied to the cell.
What am I doing wrong? Is the 'classes' option only available from certain versions?
The jqgrid that I am using is 4.1.1.
Upvotes: 1
Views: 12083
Reputation: 221997
The reason is the priority of applying CSS styles. If you would open demo like youth in Internet Explorer, starts Developer Tools by pressing of F12 and then choose the cell (by Ctrl+B) where the colCell
was not applied you will see something like the following
So more specific CSS rule on .ui-jqgrid tr.jqgrow td
overwrite your CSS rule. So you need just change your rule to for example
.ui-jqgrid tr.jqgrow td.colCell {
padding-left: 15px;
}
Now it will applied as expected. See the demo (column "Clients" has left padding 15px):
Upvotes: 3
Reputation: 1223
This is another solution to the coloring: Adding a CSS class to a column
If the 'classes' parameter you want to use, you might need to! 'Important' but use:
Upvotes: 0