format dojo DataGrid header row

☆樱花仙子☆ 提交于 2019-12-11 07:59:37

问题


I want to assign a background color to my programmatically created Dojo DataGrid's header row. I've tried to override the defaults by adding .dojoxGridHeader or .dojoxGrid-Header to my style sheet, but these have no effect.

Is there another way, such as with a Dojo event or property? If my style sheet is the only way to go, am I using the wrong class?

Thanks! Alan


回答1:


With the help of Internet Explorer's "Developer Tools," I discovered which CSS classes controlled the styling of the Dojo DataGrid header row.

I needed to add ".tundra" in front of .dojoxGridHeader because the .tundra stylesheet is at the top of the hierarchy.

This worked for me:

.tundra .dojoxGridHeader, .tundra .dojoxGridHeader .dojoxGridCell {

    vertical-align: bottom;
    color: #FFFFFF !important;
    background: #530619;
    border-color: #ECE2D8;
    font-weight: bold;
}



回答2:


Add both styles:

.dojoxGridHeader .dojoxGridCell {
        background-image: none !important;
        background-color: #A6BB3F !important;
}

.dojoxGridHeader .dojoxGridCell div {
        color: black;           
}


来源:https://stackoverflow.com/questions/2450539/format-dojo-datagrid-header-row

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