أسلوب Dojox الشبكة الصف اعتمادا على البيانات

StackOverflow https://stackoverflow.com/questions/1818872

  •  10-07-2019
  •  | 
  •  

سؤال

وإدارة الهوية والولوج في محاولة لأسلوب صف داخل DojoX (1.2.3) الشبكة اعتمادا على القيم من الشبكة.

وGridLayout:

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