How can I change the cell values font color in edit more conditionally?
If you are attempting to do on load then the following should work:
Create a javascript function that returns the desired html, for example:
<script id="colTmpl" type="text/template"> {{if parseInt(${ID}) >0 }} ${REPORT_ID} {{else}} ${NAME} {{/if}} </script>
Define column settings for the desired column as follows:
{ headerText: "", key: "NAME", width: "30%", dataType: "string", template: $( "#colTmpl" ).html() }
This utilizes ifragistics column templating and templating engine, see the followings docs:
http://www.igniteui.com/help/creating-a-basic-column-template-in-the-iggrid
http://www.igniteui.com/help/igtemplating-overview
Hoe this helps, happy coding
Hello,
In case you wish to change the color of the editor inputs for when igGrid is in edit mode, you need to following two functions from the public API:
http://help.infragistics.com/jQuery/2015.2/ui.iggridupdating#methods:editorForKey
http://help.infragistics.com/jQuery/2015.2/ui.igtexteditor#methods:field
For example, if the editor for column "ProductName" should have its editor with red text color you should execute the following:
$("#grid1").igGridUpdating("editorForKey", "ProductName").igTextEditor("field").css("color", "red");
Please, have in mind that igGridUpdating creates the editors on demand - when the end-user first enters edit mode, therefore calling editorForKey before that will always return null.
I hope this helps!
Best regards,
Stamen Stoychev