Hello,
First, thank you for your work 🙂
I would like to custom each row color of the data-table but I have a problem, I can collect each row and add a new class (with the new color) but the color change **after ** the table was full. So, each time all rows have the wrong color (the previous color).
What can i do ?
Below, my code :
//Listener on the event "nuxeo-page-loaded", it's fire by the table
listeners: {
'nuxeo-page-loaded': 'updateOccurrenceColor'
},
//The function to search all rows and update the color
updateOccurrenceColor: function() {
this.dataRows = this.$.dataModuleTable.querySelectorAll('#items nuxeo-data-table-row');
if (this.dataRows) {
for (var i = 0; i < this.dataRows.length; i++) {
this.setColorOnRow(valueOccurrence, this.dataRows[i]);
}
}
},
//The function to change the color
setColorOnRow: function(occurrence, row) {
//Here i add a random class color ;
var rowColor;
row.classList.add(rowColor);
},
Thank you for your help,
Best regards,
Charly CARRERE