문제

IAM은 그리드의 값에 따라 Dojox (1.2.3) 그리드 내부의 행을 스타일링하려고합니다.

그리드 레이아웃:

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);


                });
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top