问题
I would like to ask you, it's any way to add custom style to the selection button (cell?) I need set for example red color for one cell, yellow color for another one cell.
It's possible to remove check picture from this selection button and replace it to standard checkbox input?
I mean this (original selection buttons):
and I would like to change like this (expected selection buttons):
回答1:
<style>
.ui-grid-row > [ui-grid-row] .ui-grid-disable-selection {
background-color: yellow;
}
.ui-grid-row.ui-grid-row-selected > [ui-grid-row] .ui-grid-disable-selection {
background-color: red;
}
</style>
To change the icon you'll need to add an icon font. The default UI Grid font doesn't have the checkbox. Then you can do something like so:
.ui-grid-icon-ok:before {
content: '\f096';
font-family: FontAwesome;
}
Note: I used my browser's document inspector to identify these selectors (F12 in Windows). You should become familiar with that tool as well.
来源:https://stackoverflow.com/questions/33015165/change-style-and-or-conditional-style-of-the-selection-button