How to customize the look and feel of elements in the list view
Create a method in a delegate class
In the delegate class, the method css__tableRowClass is implemented, like in this example :
class tables_journal_interventions {
function css__tableRowClass(&$record){
if ( !$record->val('fermeture')){
return 'intervention_close';
}
else return '';
}
}
Here the function tests a condition : is there a value in the field fermeture ?
Add the class in a CSS stylesheet
Now the class is created in a CSS stylesheet.
td.intervention_close {
background-color: #FFE6E6 !important;
}
This is a class for each cell, the <td> tag. The !important attribute is added to be sure that this information has precedence over all the others. It is better to add this class in a custom CSS stylesheet.
Remarks
Beware that some versions of IE don’t respect the background-color property on the <tr> tag, so it is probably better to write:
tr.intervention_close td {
background-color: #FFE6E6;
}
i.e. to apply the background color to the individual cells.
var disqus_identifier = ‘xataface.com/wiki/Customizing_the_look_and_feel_of_a_row_or_a_cell’; (function() { var dsq = document.createElement(‘script’); dsq.type = ‘text/javascript’; dsq.async = true; dsq.src = ‘http://xataface.disqus.com/embed.js’; (document.getElementsByTagName(‘head’)[0] || document.getElementsByTagName(‘body’)[0]).appendChild(dsq); })(); blog comments powered by Disqus
//<![CDATA[ (function() { var links = document.getElementsByTagName(‘a’); var query = ‘?’; for(var i = 0; i < links.length; i++) { if(links[i].href.indexOf(‘#disqus_thread’) >= 0) { query += ‘url’ + i + ‘=’ + encodeURIComponent(links[i].href) + ‘&’; } } document.write(‘