How to ?

How to ?

Postby HunterEC » Mon Jan 24, 2011 3:00 am

Guys:

How can I have an xBrowse with a column that the user can mark / unmark records that he/she has selected ? I need to do this without adding a field to the database. Thank you.
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: How to ?

Postby nageswaragunupudi » Mon Jan 24, 2011 5:36 am

Please add these two lines
Code: Select all  Expand view
  oBrw:Marked    := { ||AScan( oBrw:aSelected, { |n| n == oBrw:BookMark } ) > 0 }
   oBrw:Marked:SetCheck()  // if display is expected as checkbox
 

I expect that you are using
Code: Select all  Expand view
     :nMarqueeStyle          := MARQSTYLE_HIGHLROWMS
 
to allow Multiple Selection.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: How to ?

Postby HunterEC » Mon Jan 24, 2011 6:04 am

Nageswaragunupudi:

Thank you for your help. Is oBrw:marked a xBrowse data and SetCheck() a method ? Can you provide a small example because I can't find documentation on marked and SetCheck() ?
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: How to ?

Postby nageswaragunupudi » Mon Jan 24, 2011 6:56 am

Is this solution working for you?

There is no xbrowse data "Marked".
There is a feature of xbrowe to add new columns with much ease.

oBrw:<ColName> := bCodeBlock creates and adds a new column with the codeblock and <colname> as the header.

By writing oBrw:Marked := { || .... }, we added a new column with header "Marked" whose value is ascertained by the codeblock we provided. This is a short cut to ADD COLUMN method,

By writing oBrw:Marked:SetCheck() we called the method SetCheck() for the column named "Marked" of the browse.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: How to ?

Postby HunterEC » Mon Jan 24, 2011 8:19 am

Rao:

Thanks, how can I filter an xBrowse so I can include records matching a criteria ?
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: How to ?

Postby HunterEC » Mon Jan 24, 2011 8:22 am

Rao:

Where I can find all the data & methods that xBrowse supports ? It seems that the manual does not show all options. FiveWin 10.06
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 80 guests