Frage

iam versuchen, eine Reihe innerhalb eines DojoX (1.2.3) Gitter in Abhängigkeit von Werten aus dem Netz stylen.

Gridlayout:

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

getColor Funktion:

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

Und ich habe keine Ahnung, wie den task_id Wert aus jeder Zeile zu erhalten und einen Stil festgelegt für die Reihe .. wenn jemand einen guten Link oder weiß hat, wie zu tun .. das wäre toll.

War es hilfreich?

Lösung

Haben Sie es von mir selbst:

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


                });
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top