I have an xbrowse with SetMultiSelectCol and lAutosort (as example) .
If the customer selects columns and then changes the oRs order (since SetMultiSelectCol works with oRs: AbsolutePosition)
the result of the selected columns is wrong .
I think SetMultiSelectCol should work on the table ID .
- Code: Select all Expand view
- #include "fivewin.ch"
function Main( cParam )
local oDlg, oFont, oFixed, oGet, oBrw
local oCn, oRs, cSql,oBtn
SetGetColorFocus()
TMultiGet():lClrFocus := .t.
SET DATE ITALIAN
SET CENTURY ON
FW_SetUnicode( .t. )
if Empty( cParam )
oCn := FW_DemoDB()
else
oCn := maria_Connect( cParam )
endif
if oCn == nil
return nil
endif
//cSql := "SELECT Now()"
oRs := oCn:RowSet( "select * from clients" )
//oRs := oCn:RowSet( cSql )
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE FONT oFixed NAME "LUCIDA CONSOLE" SIZE 0,-18
DEFINE DIALOG oDlg SIZE 900,700 PIXEL TRUEPIXEL FONT oFont ;
TITLE FWVERSION + " : MySQLR"
@ 1, 20 BUTTON oBtn PROMPT "List aselect "SIZE 100, 40 ACTION Listselect(oBrw,oRs)
@ 1, 80 BUTTON oBtn PROMPT "End"SIZE 100, 40 ACTION oDlg:End()
@ 100,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg DATASOURCE oRs ;
AUTOCOLS CELL LINES NOBORDER FOOTERS FASTEDIT
WITH OBJECT oBrw
:bRecSelHeader := { || "RecNo" }
:bRecSelData := { |o| o:BookMark }
:bRecSelFooter := { || oBrw:nLen }
:nRecSelWidth := "99999"
:lAutosort := .T.
:SetMultiSelectCol()
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont, oFixed
return nil
Static Function Listselect(oBrw,oRs)
Local i
xbrowse(oBrw:aSelected)
FOR i := 1 TO len(oBrw:aSelected)
oRs:AbsolutePosition := oBrw:aSelected[i]
? oRs:Fields( "ID" ):Value
NEXT
Return nil
Maurizio