I use FWH1512/xHarbour/TDolphin.
I need to use TXbrowse:cSetOrder to set autosort (ASC or DESC) but I don't understand how to use it. I need global set for all columns in XBROWSE but I cannot get columns for resorting columns.
- Code: Select all Expand view
- oBrw:SetDolphin( oBrw:oMySql )
for n := 1 to len(oBrw:aCols)
oBrw:aCols[n]:bLClickHeader = { | nMRow, nMCol, nFlags, Self | SqlOrder( oBrw:oMySql, oBrw:aCols[n]:xxxxxxx ) } // xxxxx is columns name
next
...
*-----------------------------*
Function SqlOrder(oDbf,cOrder)
local cSetOrder := cOrder
if lower(cOrder) $ oDbf:cOrder
if 'DESC' $ lower(oDbf:cOrder)
cSetOrder += ' ASC'
else
cSetOrder += ' DESC'
end
end
oDbf:SetOrder( cSetOrder, .T. )
return nil
Thank you in advance for any ideas or help.