jsform datagrid and pick()

Mayada Al-Kishtini malkishtini at gmail.com
Thu Dec 1 08:56:03 EST 2016


I just tested the pick and it did work with me.
Just make sure that you are returning the value at the end of your method.

Quit method DisplayValue


-----Original Message-----
From: omnisdev-en [mailto:omnisdev-en-bounces at lists.omnis-dev.com] On Behalf
Of Jim Pistrang
Sent: Thursday, December 01, 2016 8:46 AM
To: Omnis List Mail
Subject: Re: jsform datagrid and pick()

Hi Mayada,

Thanks for the reply, and yes, I've seen your (very helpful) posts on

I am returning a numeric value and I want the datagrid to display a text
translation, similar to the way a pick() works:

  Calculate DisplayValue as pick(NumericValue,'this is zero','this is
one','this is two')


>Hi Jim,
>Sorry I didn't get your first question about the pick() and datagrid, 
>what exactly you are trying to do?
>Re-$formatcell, I use this method to highlight rows in the datagrid 
>based on a column value in my row and also to format a date column, so 
>I think you need to use it if you want to apply custom format to the 
>display of your data.
>My example:
>I believe I have posted this example few months ago, but will post it 
>again so you don't need to search for it.
>the method has 2 parms (pRowNo, pColNo)
>Calculate columnvalue as iResultList.[pRowNo].jobstatus
>If pColNo=1
>  Calculate columnDesc as mid(iResultList.[pRowNo].datetimeadded,1,25)
>;; there is a problem with displaying a date field, added mid() to 
>solve the issue End If If pColNo=2
>  Calculate columnDesc as iResultList.[pRowNo].ronum End If.
>So on for each column in your row
>If (columnvalue=4)
>   Quit method con('<div class="yellowclass"
>>',columnDesc,' ','</div>')     
>Else If (columnvalue=8)
>   Quit method con('<div class="greenclass"
>',columnDesc,' ','</div>')
>Else If (columnvalue=30)
>   Quit method con('<div class="redclass" >',columnDesc,' ','</div>')
>   Quit method columnDesc
>End If
>- in my $inti method I have:
>Do $cinst.$objs.ResultList.$addcolorcss("redclass",rgb(255,0,0),128)
>Do $cinst.$objs.ResultList.$addcolorcss("yellowclass",rgb(255,255,153),128)
>Do $cinst.$objs.ResultList.$addcolorcss("greenclass",rgb(0,238,0),128)
>Do $cinst.$objs.ResultList.$addcolorcss("whiteclass",rgb(238,238,238),128)
>Hope that gives you an idea on how to use the $formatcell client method.
>-----Original Message-----
>From: omnisdev-en [mailto:omnisdev-en-bounces at lists.omnis-dev.com] On
>Of Jim Pistrang
>Sent: Thursday, December 01, 2016 7:00 AM
>To: Omnis List Mail
>Subject: jsform datagrid and pick()
>Hi all,
>I want to use the equivalent of a pick() statement in a jsform datagrid.
>Can I do this?  Do I need to use the $formatcell client method?  I feel
>this should be easy but I'm missing something....
>Jim Pistrang
>JP Computer Resources
>Manage your list subscriptions at http://lists.omnis-dev.com
>Manage your list subscriptions at http://lists.omnis-dev.com

Jim Pistrang
JP Computer Resources

Manage your list subscriptions at http://lists.omnis-dev.com

More information about the omnisdev-en mailing list