<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Custom Row Color in the nuxeo-data-table in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/custom-row-color-in-the-nuxeo-data-table/m-p/314353#M1354</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;First, thank you for your work &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;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 ?&lt;/P&gt;
&lt;P&gt;Below, my code :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;//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 &amp;lt; 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);
},

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you for your help,&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Charly CARRERE&lt;/P&gt;</description>
    <pubDate>Sun, 04 Dec 2016 19:53:57 GMT</pubDate>
    <dc:creator>__9</dc:creator>
    <dc:date>2016-12-04T19:53:57Z</dc:date>
    <item>
      <title>Custom Row Color in the nuxeo-data-table</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/custom-row-color-in-the-nuxeo-data-table/m-p/314353#M1354</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;First, thank you for your work &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;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 ?&lt;/P&gt;
&lt;P&gt;Below, my code :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;//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 &amp;lt; 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);
},

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you for your help,&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Charly CARRERE&lt;/P&gt;</description>
      <pubDate>Sun, 04 Dec 2016 19:53:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/custom-row-color-in-the-nuxeo-data-table/m-p/314353#M1354</guid>
      <dc:creator>__9</dc:creator>
      <dc:date>2016-12-04T19:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Row Color in the nuxeo-data-table</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/custom-row-color-in-the-nuxeo-data-table/m-p/314354#M1355</link>
      <description>&lt;P&gt;I Find a solution, I add a setTimeout to update the color row for the next js cycle :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-javascript"&gt;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 &amp;lt; self.dataRows.length; i++) {
	            self.setColorOnRow(valueOccurrence, self.dataRows[i]);
	        }
	    }
    });
},
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Dec 2016 10:50:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/custom-row-color-in-the-nuxeo-data-table/m-p/314354#M1355</guid>
      <dc:creator>__9</dc:creator>
      <dc:date>2016-12-05T10:50:31Z</dc:date>
    </item>
  </channel>
</rss>

