博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CRM Home Grid StyleSet
阅读量:4647 次
发布时间:2019-06-09

本文共 1450 字,大约阅读时间需要 4 分钟。

用户进行到记录列表后,虽然可以通过视图来区分不同条件的记录但是不能重点突出记录的重要性。我们根据客户的需求特别定制了如下解决方案,比如根据记录的状态,字段值 在列表面上把行的背景显示成不同的着色来突出重点,提高客户的生产力。 此解决方案可以灵活配置可以放到任意记录上,并且可以设置显示条件 代码如下: //定义显示条件var condition={"attribute":"电子邮件","values":[{"value":"hellohongfu@hotmail","style":"background:blue;color:white"},{"value":"362335821@qq.com","style":"background:red;color:white"},{"value":"hongfu.wang@avanade.com","style":"background:yellow;color:black"}]}//返回不同值的样式function GetStyle(value){for(var item in condition.values){  if(value==condition.values[item].value){      console.log(condition.values[item].value  + condition.values[item].style)     return condition.values[item].style;  }    }}//表格设置function setTable(table,condition){  var rows =table.rows;  var ths=rows[0];    var columnIndex=0;  $(table).find("tr th").each(function(index,e){    if(condition.attribute==$(this).text()){      console.log($(this).text()+"  "+"index:"+index);      columnIndex=index;    }      })   $(table).find("tr").each(function(index,e){    if(index>0){       $(this).find("td").each(function(index,e){         if(index==columnIndex){          if(GetStyle($(this).text())){            console.log('GetStyle')            $(this).parent()[0].style=GetStyle($(this).text());                    }        }      })    }  });}//查找表格var table =$($("iframe")[0].contentWindow.document).find("#gridBodyTable")[0]//运行样式setTable(table,condition);

 最终效果如下图

转载于:https://www.cnblogs.com/hellohongfu/p/4790768.html

你可能感兴趣的文章
乘法表
查看>>
4.express 框架
查看>>
Java基础算法集50题
查看>>
Android 桌面组件widget
查看>>
25-字符串
查看>>
萌新报道
查看>>
Asp.Net 获取物理路径
查看>>
Apache2.4使用require指令进行访问控制--允许或限制IP访问/通过User-Agent禁止不友好网络爬虫...
查看>>
Solr reRankQuery加自定义函数实现搜索二次排序
查看>>
基于ipv6的抓包实验
查看>>
latex学习(四)tlmgr
查看>>
centos6.5 bugzilla4.4.5 汉化
查看>>
ros topic 发布一次可能会接收不到数据
查看>>
字符串的扩展
查看>>
冒泡排序_c++
查看>>
linux常见术语示意
查看>>
CodeForces743E. Vladik and cards 二分+状压dp
查看>>
GO语言面向对象
查看>>
1111评论
查看>>
CodeForces 546E - Soldier and Traveling(最大流)
查看>>