⚠ In case you've missed it we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This forum is read-only and soon will be archived. ⚠

Change row color based on value

color value change color coloring rendering

  • Please log in to reply
3 replies to this topic

#1 mcl



  • Members
  • Pip
  • 4 posts

Posted 20 September 2013 - 11:47 PM

Hello all,


New to grocery CRUD and i wish to do some color rendering.

I have a column which contain a date and i need the text or background to be in red if 72 hours have passed. I have done some search on google and on this forum but haven't found anything clear enough for me to understand.

I think i may need to use callback but no clue how to change color with it.

Can someone explan it to me or give some hints?


Newbie programmer, bear with me please :)

Your help is greatly appreciated on this issue.








#2 davidoster


    Grocery CRUD Ninja

  • Advanced Member
  • PipPipPip
  • 1,068 posts

Posted 21 September 2013 - 12:57 AM

Hello and welcome to the forums mcl.

The easiest way to do this is by using the callback_column and change the text color of the date, like this for example :



If you feel confident enough you can play with some custom CSS and apply it to the date cell using custom javascript.

This is some basic css http://www.w3schools...ss/css_font.asphttp://www.w3schools...ss/css_text.asp



Which one you will use is totally up to you.

Edited by davidoster, 21 September 2013 - 01:02 AM.

#3 mcl



  • Members
  • Pip
  • 4 posts

Posted 30 September 2013 - 10:55 PM

Thank you @davidoster. I can see how to use callback but not dealing with the color rendering as im having another problem right now : http://www.grocerycr...ion-post-array/

#4 fjcalvomacias



  • Members
  • Pip
  • 1 posts

Posted 21 January 2015 - 07:25 AM

Hi! im new in the forum and my english is....


JQUERY POWER!! parent().parent.().parent().......


i use callbackcolum and return ->

$dev = "<a href=\"JAVASCRIPT:ver_gastos('".$value."',".$row->id.")\" id='conte".$row->id."'>".$valor."</a>";

Also tagged with one or more of these keywords: color, value, change color, coloring, rendering

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users