I am using a list control and have a case where I need to set the font color to red if a field has a specific value. After the value is changed inline, I need to provide an indication to the user that this value has been modified. For example, I would like to set the font color to blue. The list contains multiple fields, and any of them could be changed. How can I achieve this scenario dynamically?
Changing value to blue if it was changed, now that's a bit trickier. I can imagine storing original value in user's browser storage, and comparing to that, but if user refreshes the page, new value will become original as it would overwrite the previous one. You could send a request to get version history and compare it with the previous one, but that would quickly get very complex.
Dear @george,
The documentation is about customizing templates for specific columns, so you can customize their appearance (while they are not being edited) based on certain conditions.
For example, let's say I want to highlight column with Status: Overdue with red color, I would write the following template:
const value = ctx.row.Status;
if (!value) {
return '';
}
return value == 'Overdue'
? `<span style="color:red">${value}</span>`
: `<span>${value}</span>`;
That's clear to me. My case is a bit different though. I have a grid with many columns and any of them can contain say the word "Overdue". I want to iterate all the fields and if any of them includes the "Overdue" then change the colour to red. I don't want to check all the fields one by one as I have 3 content types with 20 fields each. Hopefully it makes sense.