TableRecords list - using colors for records depending on status

TableRecords list - using colors for records depending on status

  
Hi,

Is it possible to display records in different colors depending on a condition, using a conditional style  or something like that ?
I built in selection possibilities but still the user considers it most helpful to have a visual impression of critical posts that need to be processed asap.

Best regards,

Ron Slieker
 
it is possible. not really the way I want it, but it is possible :)

You can work with extended properties with the tablerows and tablecells.

Thanks for your answer, looks a bit complicated, do you have an example ?
Hey there,

I had to something simillar and here is the way I got it: (All Javascript and CSS)
I had a table records widget and I added the css for each style I wanted to apply:

.statusRed {
  background-color: red;
}
.statusYellow {
  background-color: yellow;
}
.statusGreen {
  background-color: green;
}

After this, I added an "onload" extended property to the Webscreen calling the function that added the styles:
"ConditionalStyles('" + TableRecords1.Id + "');"

And I wrote the following javascript to the WebScreen:
function ConditionalStyles(tableToStyle) {
  var tabRows = document.getElementById(tableToStyle).rows;
  for(var i = 0; i < tabRows.length; ++i) {
    var currRow = tabRows[i];
    if(currRow['cellToTest'].innerHTML = 'Condition1')
      currRow.className += " statusRed";
    if(currRow['cellToTest'].innerHTML = 'Condition2')
      currRow.className += " statusYellow";
    if(currRow['cellToTest'].innerHTML = 'Condition3')
      currRow.className += " statusGreen";
  }
}

Disclaimer: I wrote this from memory! So, I'm not sure it will work directly! But anyways, I believe it will set you in the right direction. =)
function ConditionalStyles(tableToStyle) {
var tabRows = document.getElementById(tableToStyle).rows;
for(var i = 0; i < tabRows.lenght; ++i) {
var currRow = tabRows[i];
if(currRow['cellToTest'].innerHTML = 'Condition1')
currRow.className += " Style1";
if(currRow['cellToTest'].innerHTML = 'Condition2')
currRow.className += " Style2";
}
}
function ConditionalStyles(tableToStyle) {
var tabRows = document.getElementById(tableToStyle).rows;
for(var i = 0; i < tabRows.lenght; ++i) {
var currRow = tabRows[i];
if(currRow['cellToTest'].innerHTML = 'Condition1')
currRow.className += " Style1";
if(currRow['cellToTest'].innerHTML = 'Condition2')
currRow.className += " Style2";
}
}
HI,

If you want to, by any reason, avoid javascript you can do it with a simple IF inside your tablerecords cell and then show your expression with one style ou the other depending on its value.

Hope it helps,
Hermínio Mira
Hi,

It helps ! Indeed the customer wants to avoid the use of Java. 
Using IF inside a tablerecords cell extended properties doesn't result in a continuous color for the entire record if applied to all cells but that's ok.
I just give the cell settlement date a color, that's enough.

Extended property style, value :
if (DateTimeToDate(TableRecords1.List.Current.QUEUE.SettlementDate)<CurrDate(), "background-color:red;", if (DateTimeToDate(TableRecords1.List.Current.QUEUE.SettlementDate)=CurrDate(), "background-color:yellow;","background-color:white;"))

Thank you all,

Ron Slieker