jsform datagrid and pick()

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


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.

-$formatcell:
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>')

Else
   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.

Mayada


-----Original Message-----
From: omnisdev-en [mailto:omnisdev-en-bounces at lists.omnis-dev.com] On Behalf
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 like
this should be easy but I'm missing something....

Thanks,

Jim

-- 
Jim Pistrang
JP Computer Resources
413-256-4569
<http://www.jpcr.com>



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





More information about the omnisdev-en mailing list