Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css jqgrid rowattr未应用类_Css_Jqgrid - Fatal编程技术网

Css jqgrid rowattr未应用类

Css jqgrid rowattr未应用类,css,jqgrid,Css,Jqgrid,我想根据column的值将背景色应用于jqGrid行的行,但是基本rowattr并没有将类应用于行 下面是代码(为了简单起见,我删除了需要应用颜色的条件) jQuery(“#employeeSalarysGrid”).jqGrid({ 身高:250, 网址:'http://localhost:50570/api/Test/Get', mtype:“获取”, contentType:“应用程序/json;字符集=utf-8”, 数据类型:“json”, serializeGridData:函数(p

我想根据column的值将背景色应用于jqGrid行的行,但是基本rowattr并没有将类应用于行

下面是代码(为了简单起见,我删除了需要应用颜色的条件)

jQuery(“#employeeSalarysGrid”).jqGrid({
身高:250,
网址:'http://localhost:50570/api/Test/Get',
mtype:“获取”,
contentType:“应用程序/json;字符集=utf-8”,
数据类型:“json”,
serializeGridData:函数(postData){
返回JSON.stringify(postData);
},
jsonReader:{
根:函数(obj){return obj;},
第页:函数(obj){return 1;},
总计:函数(obj){return 1;},
记录:函数(obj){return obj.length;},
id:“0”,
单元格:“”,
重复项:false
},
数据类型:“json”,
colNames:['Id','Bank Name','Bank Name','Employee Name','joint date','Salary amount','Comments'],
colModel:[
{name:'Id',align:'center',hidden:true},
{name:'BankName',index:'BankName',align:'center',可编辑:false},
{
名称:'BankId',索引:'BankId',对齐:“中心”,隐藏:true,必需:true,
可查看:true,editrules:{edithidden:true,required:true},
是的,
edittype:'选择',
编辑选项:{
dataUrl:“/api/Test/GetBanks”,
buildSelect:函数(数据){
var response=jQuery.parseJSON(数据);
var s='';
if(响应和响应长度){
对于(变量i=0,l=response.length;i
CSS样式:

 <style type="text/css">      
        .rowClass { color: blue;  background-image: none;}
    </style>

.rowClass{颜色:蓝色;背景图像:无;}
注意:如果我取消注释//alert语句,它会显示5次警报消息。这意味着将为每一行调用rowattr,但不会应用css类

问候,,
Abhilash

行属性可以正常工作,但如果您希望该类也应用于选定的行,则应将CSS规则更改为以下内容

.ui小部件内容.rowClass{color:blue;背景图像:无;}

请参阅。

rowattr
确实工作正常,但如果您希望该类也应用于选定的行,则应将CSS规则更改为以下内容

.ui小部件内容.rowClass{color:blue;背景图像:无;}

请参阅。

测试中使用的web浏览器和版本?您使用哪个jqueryui主题(以及jqueryui的哪个版本)?我无法在测试中重现该问题。浏览器:IE,版本:11 CSS:jquery ui 1.10.4脚本:jquery-2.1.0如果需要更多详细信息,请告诉我。谢谢您在测试中使用哪个web浏览器和哪个版本?您使用哪个jqueryui主题(以及jqueryui的哪个版本)?我无法在测试中重现该问题。浏览器:IE,版本:11 CSS:jquery ui 1.10.4脚本:jquery-2.1.0如果需要更多详细信息,请告诉我。谢谢我认为rowattr与cellattr一起在colmodel中更有用。这样,您可以根据rawObject上的条件(如cellattr中的条件)更改行属性。在当前的实现中,您只能在生成行之后访问显示的值,这不是很有用,并且迫使您使用jquery来解析单元格内容。@Sing3:
colModel
是定义列的单元格属性的项数组(
elemens)
rowattr
定义行(
元素)的属性。因此,不能将
rowattr
放在某些或每个
colModel
项中
cellatr
定义列的单元格属性(
 <style type="text/css">      
        .rowClass { color: blue;  background-image: none;}
    </style>