db.define_table('mytable',
                Field('Product_SignOff',
                      represent=lambda v, r: SPAN(v, _class='green' if v == 
'Yes' else 'red')),
                ...)


On Friday, June 6, 2014 9:52:58 AM UTC-4, Sarbjit wrote:
>
> Thanks Anthony, 
>
> Can you please provide a small example.
>
> On Friday, June 6, 2014 6:03:29 PM UTC+5:30, Anthony wrote:
>>
>> You can set the "represent" attribute for the fields you would like to 
>> format.
>>
>> Anthony
>>
>> On Friday, June 6, 2014 1:31:06 AM UTC-4, Sarbjit wrote:
>>>
>>> Hi,
>>>
>>> I am using GRID in my application, my requirement is that I want to 
>>> display the field value in different color (RED/GREEN) OR I want to display 
>>> the images (Tick Mark Image/Cross Mark Image) based upon the data in the 
>>> field.
>>>
>>> e.g. (Sample example)
>>>
>>> Product_ID      Product_Title    Product_SignOff
>>> 1                           XZ                       Yes
>>> 2                           AV                       Yes
>>> 3                           AD                       NO
>>>
>>> I want it to be viewed in gird as :
>>>
>>> Product_ID      Product_Title    Product_SignOff
>>> 1                           XZ                       Yes
>>> 2                           AV                       Yes
>>> 3                           AD                       NO
>>>
>>> OR
>>>  any other additional indicator could be added such that the rows with 
>>> Signoff value as NO could be easily identified (or highlighted). I was 
>>> wondering, if I could use some images there (Green color Tick mark or Red 
>>> color Cross mark) in the grid.
>>>
>>> Since, I am not having much experience using web2py, can someone please 
>>> help me to achieve this.
>>>
>>> Thanks
>>> Sarbjit
>>>
>>>
>>>
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to