Page 1 of 1

Xbrowse , autosort

Posted: Thu Feb 10, 2011 10:21 am
by Frank Demont
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

Re: Xbrowse , autosort

Posted: Thu Feb 10, 2011 11:58 am
by nageswaragunupudi
#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> }

Re: Xbrowse , autosort

Posted: Thu Feb 10, 2011 12:22 pm
by Frank Demont
Thanks very much , very easy to implement !!!!!

Frank