I have set the "required" property for columns in the columnSettings dynamically during initialization. When loading the igGrid (and adding a new row), I want to indicate those required fields with the cell colored in red. How can I do that?
Thanks!
hi Erica,
The editor options provide you with the functionality to set a custom theme.
Using the following code:
editorOptions: { theme: 'requiredCell' }
you may specify editor options for the columns that are required.
You may use also the following CSS to mark the cell with red border:
.requiredCell {border: 1px solid red !important;}
Hope that helps. Let me know if you are unable to use my comments and/or you need a specific sample.
regards
Lyubo
The cell is set to red depending on the columnSetting.required property value. Where should this logic be applied?
Can I have a sample specific for this?
Did you check the attachment and see how it's working with a checkbox column?
Any updates on this?
I already did the same:
var template = "<div class='requiredCell'>${" + column.key + "}</div>";
column.template = template;
But it displays differently for a checkbox column.
I'm sorry, I've provided you with a wrong code for the template. It should be looking like this:
col.template = "<div class='requiredCell'>${" + col.key + "}</div>";
Please check the new attachment and let me know if you have any questions.
Regards
Thanks Lyubo. Adding template as suggested works well with a text column. However, color does not show if the column contains a checkbox and a text of "<span style...>" was shown instead.
Please find the attached screenshot for the expected result that I want to achieve from your advice and the current behaviour with your suggested template.