xBrowse - how to oXbrw:gotop() after header is click?

xBrowse - how to oXbrw:gotop() after header is click?

Postby hua » Fri May 27, 2022 2:51 am

If user select a header to sort on or change ascending/descending order, how do I get xbrowse to always perform a oXbrw:goTop() afterwards?
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: xBrowse - how to oXbrw:gotop() after header is click?

Postby nageswaragunupudi » Fri May 27, 2022 3:11 am

Code: Select all  Expand view
oBrw:bOnSort := { |o| o:GoTop() }
Regards

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

Re: xBrowse - how to oXbrw:gotop() after header is click?

Postby hua » Fri May 27, 2022 3:20 am

Thanks for the prompt reply Rao.

But doesn't seem to work with FWH11.08. I ended up with an extra column called BONSORT
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: xBrowse - how to oXbrw:gotop() after header is click?

Postby nageswaragunupudi » Fri May 27, 2022 4:57 am

Sorry, FWH11.08 is more than ten year old and did not support this.

Let me see the source code of FWH1108 and advise you.
Regards

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

Re: xBrowse - how to oXbrw:gotop() after header is click?

Postby nageswaragunupudi » Fri May 27, 2022 10:48 am

Please try:
Code: Select all  Expand view
     oBrw:bLClickHeaders := { |r,c,f,o| If( EMPTY( o:cOrder ),,(o:oBrw:GoTop(),o:oBrw:Refresh() ) ) }
 
Regards

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

Re: xBrowse - how to oXbrw:gotop() after header is click?

Postby hua » Mon May 30, 2022 2:46 am

Thank you very much Rao. It works!

On another topic, is it possible to get a sorting based on a group of column ?
For example, if click on header of col A, sorting is actually col A+col B>

TIA
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: xBrowse - how to oXbrw:gotop() after header is click?

Postby nageswaragunupudi » Mon May 30, 2022 2:56 am

DBF files?
Regards

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

Re: xBrowse - how to oXbrw:gotop() after header is click?

Postby hua » Mon May 30, 2022 3:00 am

Yes. Is it as simple as creating an index with the expression A+B?
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: xBrowse - how to oXbrw:gotop() after header is click?

Postby nageswaragunupudi » Mon May 30, 2022 4:10 am

hua wrote:Yes. Is it as simple as creating an index with the expression A+B?

Yes, and a little more.
Also assign
oCol:cSortOrder := <OrderTag>
and
oCol:cOrdBag := <cOrdBag> // if separate

Example (DBFCDX):
INDEX ON COLA+COLB TAG IDXAB TO TMP MEMORY

oCol:cSortOrder := "IDXAB"
oCol:cOrdBag := "TMP"
Regards

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

Re: xBrowse - how to oXbrw:gotop() after header is click?

Postby hua » Mon May 30, 2022 8:53 am

Thank you very much Rao!
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 72 guests