12-04-2016 02:53 PM
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
12-05-2016 05:50 AM
I Find a solution, I add a setTimeout to update the color row for the next js cycle :
updateOccurrenceColor: function() {
var self = this;
setTimeout(function() {
self.dataRows = self.$.dataModuleTable.querySelectorAll('#items nuxeo-data-table-row');
if (self.dataRows) {
for (var i = 0; i < self.dataRows.length; i++) {
self.setColorOnRow(valueOccurrence, self.dataRows[i]);
}
}
});
},
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.