Change style and/or conditional style of the selection button

北慕城南 提交于 2019-12-24 16:30:52

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!