Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
105
How to change background color of "td" using Conditional Templates in iggrid?
posted

Hi,

I am using iggrid in that I am having dynamically added columns. I want to add a background color for "td". Is it possible using conditional template? if yes how? if not can anybody please tell me the other options for this?

Thanks in advance!

Regards,

-Niranjan

Parents
No Data
Reply
  • 18204
    Verified Answer
    Offline posted

    Hello Niranjan,

     

    Thank you for posting in our forums!

    You cannot directly change the color of the <td> elements from the column template since the template is nested inside the <td>.  You can achieve this by setting a flag for the style in the column template and including some additional jQuery code to apply the style to the <td>.  The additional code should be run after the rows are rendered, and I recommend handling the rowsRendered event for this.

    Please see this jsFiddle for a demonstration of how you can achieve this.

    If you need any further assistance with this, please let me know and I will be glad to help.

Children