5
E 'possibile creare classe CSS dinamico per il GridView in ExtJS senza disco codifica la classe CSS all'interno del foglio di stile, per esempioCome creare classe CSS dinamica in ExtJS o javascript
DEFAULT_ROW_COLOR = '#E0E0E0';
...
var gridview = new Ext.grid.GroupingView({
forceFit : forceFit,
hideGroupedColumn : true,
showGroupName : false,
groupTextTpl: '{text}',
getRowClass : getRowClassFunc
});
var getRowClassFunc = function(record, rowIndex, rowParams, store) {
if (rowIndex == 1) {
// create a dynamic class based on DEFAULT_ROW_COLOR for background color
}
if (rowIndex > 1) {
// create a dynamic class for darker color for the background.
}
};
Grazie @ Li0liQ. –
Ho provato questo, sembra funzionare anche: var getRowClassFunc = function (record, rowIndex, rowParams, store) { rowParams.tstyle + = 'background-color:' + DEFAULT_ROW_COLOR + ';'; if (rowIndex == 1) { rowParams.tstyle + = 'background-color:' + another_color + ';'; } }; –