jQuery MiniUI

标题: DataGrid [打印本页]

作者: renle    时间: 2016-9-26 09:18:26     标题: DataGrid

[attach]8040[/attach]大神,请教个问题,我现在需要做这样的一个需求,在咱们的DataGrid中要给指定的列添加背景颜色,就如同我上图发的一样,现在需要设置基本信息下的性别和年龄列背景色为红色,出生日期,婚否,邮箱列背景色为绿色,求大指点迷津

作者: felt    时间: 2016-9-26 13:14:51

http://www.miniui.com/demo/#src=datagrid/drawcell.html
参考示例在ondrawcell事件里处理
作者: renle    时间: 2016-9-26 13:44:17

felt 发表于 2016-9-26 13:14
http://www.miniui.com/demo/#src=datagrid/drawcell.html
参考示例在ondrawcell事件里处理

谢谢版主,解决了,还有一个小小的问题,就是如果我要同事设置好几列,我可以用if (field == "age&&loginname") {
                e.cellStyle = "background:#ecedef";
            }这样的方法吗,还是有其他的方法可以同时设置好几列的,请版主赐教
作者: felt    时间: 2016-9-26 14:27:00

renle 发表于 2016-9-26 13:44
谢谢版主,解决了,还有一个小小的问题,就是如果我要同事设置好几列,我可以用if (field == "age&&login ...

if(field=="a"||field=="b"||field=="c"....
作者: renle    时间: 2016-9-26 15:55:51

felt 发表于 2016-9-26 14:27
if(field=="a"||field=="b"||field=="c"....

谢谢版主,测试成功了,麻烦您了




欢迎光临 jQuery MiniUI (http://miniui.com/discuss/) Powered by Discuz! X2