| Support Center

(Back to Website)

Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Conditional cell css depending on the value of another cell

Alberto Feb 08, 2018 05:13PM PKT

Conditional cell css depending on the value of another cell.

I have to change the background color of one cell if the value of another cell in other column is X.
Both cells are is the same row.

Up 1 rated Down
Abu Ghufran Feb 08, 2018 06:29PM PKT PHP Grid - Support Center Engineer
This is manually done via JS code. Refer demos/appearance/conditional-format-ext.php
Up 0 rated Down
Alberto Feb 08, 2018 07:39PM PKT
Could you send me the full link?
Up 1 rated Down
Abu Ghufran Feb 08, 2018 08:34PM PKT PHP Grid - Support Center Engineer
Code: http://phpgrid.org/demo/demos/appearance/conditional-format-ext.phps
Demo: http://phpgrid.org/demo/demos/appearance/conditional-format-ext.php
Up 0 rated Down
Alberto Feb 12, 2018 06:08PM PKT
Hello,

Thank you so much for the info.
It has been really handy.

I have another question.
I want to set the background in red of a field that has a negative amount in €,
there are a couple of field like that I want to do the same for all of them.

I am having problem at the time that the conditional CSS tries to recognize the - symbol in the field.


Any solution?

Thank you
Up 1 rated Down
Abu Ghufran Feb 12, 2018 11:11PM PKT PHP Grid - Support Center Engineer
In JS code, you can remove € sign first e.g. string.replace('€','') and then use parseInt to get numeric variable, which can be used in conditional formatting code.

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)

Contact Us

  • Post a Public Question
  • Email Us
  • Live Chat!
  • Ask the Community

    Instructions

    • Paste complete code that is involved in your question. You can use pastebin.com to share code link.

    Screenshots or Online link of webpage is helpful in resolution. You can also send email at address mentioned below.

    • To report an issue, Write steps to regenerate the case.

    • For email support or live chat, Use gridphp@gmail.com and add it in Google Chat.
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete