2012-02-13 97 views
0

我需要更改标题的背景以及Jquery网格的行。我试图改变几个CSS类,但我没有得到我想要的结果。如何更改Jqgrid中的标题和行的背景?

+0

你能不能给我们一些更多的信息,请? 像:你正试图改变的HTML代码,适用于你想改变的作品的CSS代码。 – 2012-02-13 07:33:53

回答

1
// this changes the background image of the header 
.ui-jqgrid .ui-widget-header{ 
    background-image: url(myBackground.jpg) repeat-x !important; 
} 

// this changes the background color of every row in a jqgrid 
.ui-jqgrid tr.jqgrow { 
    background-color: yellow !important; 
} 

注:!important可能没有必要。

另外请确保您的css文件已加载之后 jqgrid的css文件!

<link rel="stylesheet" type="text/css" media="screen" href="ui.jqgrid.css" /> 
<!-- load jqgrid css first then your css --> 
<link rel="stylesheet" type="text/css" media="screen" href="mystyle.css" /> 
+0

试图使用这个...它的工作行,但不是头...我们如何改变标题? – msbyuva 2013-06-27 06:15:09

0
//for changing colour of titlebar 
#list .ui-jqgrid-titlebar { 
background:blue; 
} 
//for changing header 
.ui-jqgrid .ui-jqgrid-htable th{ 
background: blue 
}