Xbrowse , autosort

Xbrowse , autosort

Postby Frank Demont » Thu Feb 10, 2011 10:21 am

Hello,

Clicking on a header , the array is sorted with the data from this colum.

In some cases i want to add a second key , or column , like we can do in a index expression.

I tryed to add a new data to TXBrwColumn (bOrder) , but it seems to be too complicated.

How can it be done without changing the source from xbrowse or too add new data ?

Frank Demont
Frank Demont
 
Posts: 142
Joined: Sun Oct 09, 2005 10:59 am

Re: Xbrowse , autosort

Postby nageswaragunupudi » Thu Feb 10, 2011 11:58 am

#1. In case of browsing RDD / TDataBase

(a) If you already have an index on the required expression, assign the index tag name to oCol:cSortOrder := <indexTagName>.

(b) If no index exists on the required expression, you may create a temporary index like
INDEX ON <expression> TAG <temptag> TO <temp> MEMORY
and assign
oCol:cSortOrder := <temptag>
oCol:cOrdBag := <temp>

#2. In case of browsing RecordSet :

Just assign the two column names like:
oCol:cSortOrder := "FIRST,LAST,CITY"

#3. In case of browsing Array:

You need to have your own custom sort function, which returns 'A' if sorted on ascending order or 'D' if sorted on descending order and then assign your function as codeblock to oCol:cSortOrder := { |oCol| <yourfunction> }
Regards

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

Re: Xbrowse , autosort

Postby Frank Demont » Thu Feb 10, 2011 12:22 pm

Thanks very much , very easy to implement !!!!!

Frank
Frank Demont
 
Posts: 142
Joined: Sun Oct 09, 2005 10:59 am


Return to FiveWin for Harbour/xHarbour

Who is online

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