微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

css – 样式Dojox网格行取决于数据

我试图根据网格中的值在DojoX(1.2.3)网格中设置一个Row的样式.

网格布局:

var view1 = {
                noscroll: true,rows: [{
                    field: 'TASK_ID',name: 'ID',width: '80px',get: this.getColor
                },{
                    field: 'MENUPOINT',name: 'Action',width: '250px'
                }]
            };

getColor函数

getColor: function(inRowIndex) {
        console.log(inRowIndex);
        grid = dijit.byId('gridTaskCurrent');
            // if task_id = 1 style row with other background(?)
        },

我不知道如何从每一行获取task_id值并为其设置样式
排…如果有人有一个很好的链接或知道该怎么做..这将是伟大的.

解决方法

得到了我自己:
dojo.connect(dijit.byId('gridTaskCurrent'),'onStyleRow',this,function(row) {
                   var item = grid.getItem(row.index);

                    if (item) {
                        var type = grid.store.getValue(item,"LOCKED",null);
                        if (type == 1) {
                            row.customStyles += "background-color:limegreen;";
                        }
                    }

                    grid.focus.styleRow(row);
                    grid.edit.styleRow(row);


                });

原文地址:https://www.jb51.cc/css/242191.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。