Tengo 3 Xbrowse, el primero con conductores, el segundo con las entregas de éste conductor y el tercero con las entregas que son de otros conductores.
- Code: Select all Expand view
- @ 30, 0 xbrowse oBrw1 OF oDlg ;
ALIAS cAlias1;
COLUMNS "Codigo","Nombre";
AUTOSORT LINES CELL FOOTERS NOBORDER SIZE -645,-30 PIXEL
WITH OBJECT oBrw1
:SetGroupHeader( "Conductores", 1, 2)
:nColDividerStyle := LINESTYLE_BLACK
:lColDividerComplete := .T.
:l2007 := .T.
:lRecordSelector := .F.
:lAllowColHiding := .F.
:lAllowColSwapping := .F.
:nStretchCol := 2
:bChange := {|| xnuconduc:=oBrw1:aCols[1]:value,aData2:=creaelarray2(xnuconduc),aData3:=creaelarray3(xnuconduc),oBrw2:Refresh(),oBrw3:Refresh(),sysrefresh(),oDlg:Update() }
:bClrStd:= { || { CLR_BLACK, If( oBrw1:KeyNo % 2 == 0, nRGB(242,247,252),nRGB(226,226,208) ) } }
:nMarqueeStyle := MARQSTYLE_HIGHLROWMS //6
:MakeTotals()
:CreateFromCode()
END WITH
//----------Segundo browse
@ 30, 145 xbrowse oBrw2 OF oDlg ;
Datasource aData2;
AUTOCOLS LINES CELL FOOTERS NOBORDER SIZE -325,-30 PIXEL
WITH OBJECT oBrw2:aCols[ 3 ]
:cHeader := "Consignatario"
:nWidth := 190
END WITH
WITH OBJECT oBrw2:aCols[ 2 ]
:cHeader := "Domicilio"
:nWidth := 180
END WITH
WITH OBJECT oBrw2:aCols[ 1 ]
:cHeader := "Poblacion"
:nWidth := 150
END WITH
WITH OBJECT oBrw2:aCols[ 4 ]
:cHeader := "Bultos"
:nWidth := 40
END WITH
WITH OBJECT oBrw2:aCols[ 5 ]
:cHeader := "Kilos"
:nWidth := 40
END WITH
WITH OBJECT oBrw2
:SetGroupHeader( "Entregas del Conductor Seleccionado", 1, 5)
:nColDividerStyle := LINESTYLE_BLACK
:lColDividerComplete := .T.
:l2007 := .T.
:lRecordSelector := .F.
:lAllowColHiding := .F.
:lAllowColSwapping := .F.
:nStretchCol := 2
:bClrStd:= { || { CLR_BLACK, If( oBrw2:KeyNo % 2 == 0, nRGB(242,247,252),nRGB(226,226,208) ) } }
:nMarqueeStyle := MARQSTYLE_HIGHLROWMS //6
:MakeTotals()
:CreateFromCode()
END WITH
//----------Tercer browse
@ 30, 465 xbrowse oBrw3 OF oDlg ;
Datasource aData3;
AUTOCOLS LINES CELL FOOTERS NOBORDER SIZE -5,-30 PIXEL
WITH OBJECT oBrw3:aCols[ 3 ]
:cHeader := "Consignatario"
:nWidth := 190
END WITH
WITH OBJECT oBrw3:aCols[ 2 ]
:cHeader := "Domicilio"
:nWidth := 180
END WITH
WITH OBJECT oBrw3:aCols[ 1 ]
:cHeader := "Poblacion"
:nWidth := 150
END WITH
WITH OBJECT oBrw3:aCols[ 4 ]
:cHeader := "Bultos"
:nWidth := 40
END WITH
WITH OBJECT oBrw3:aCols[ 5 ]
:cHeader := "Kilos"
:nWidth := 40
END WITH
WITH OBJECT oBrw3
:SetGroupHeader( "Entregas de otros conductores", 1, 5)
:nColDividerStyle := LINESTYLE_BLACK
:lColDividerComplete := .T.
:l2007 := .T.
:lRecordSelector := .F.
:lAllowColHiding := .F.
:lAllowColSwapping := .F.
:nStretchCol := 2
:bClrStd:= { || { CLR_BLACK, If( oBrw3:KeyNo % 2 == 0, nRGB(242,247,252),nRGB(226,226,208) ) } }
:nMarqueeStyle := MARQSTYLE_HIGHLROWMS //6
:MakeTotals()
:CreateFromCode()
END WITH
Cuando me muevo al siguiente conductor con:
- Code: Select all Expand view
- :bChange := {|| xnuconduc:=oBrw1:aCols[1]:value,aData2:=creaelarray2(xnuconduc),aData3:=creaelarray3(xnuconduc),oBrw2:Refresh(),oBrw3:Refresh(),sysrefresh(),oDlg:Update() }
llamo a dos funciones para crear los datos en dos arrays (aData2 y aData3), que van en los xbrowse2 y xbrowse3
- Code: Select all Expand view
- //----------------
static function creaelarray2(xnuconduc)
local aData2:={}
Manifiesto->( FW_DbfToArray("Poblacion,Domicilio,Consigna,Bultos,Peso" , {|| field->nconduc = xnuconduc .and. !Deleted() }, , , , , aData2 ) )
if len(aData2) = 0
AAdd( aData2,{" " ," ", " "," "," "})
endif
return adata2
//----------------
static function creaelarray3(xnuconduc)
local aData3:={}
Manifiesto->( FW_DbfToArray("Poblacion,Domicilio,Consigna,Bultos,Peso" , {|| field->nconduc <> xnuconduc .and. !Deleted() }, , , , , aData3 ) )
if len(aData3) = 0
AAdd( aData3,{" " ," ", " "," "," "})
endif
return adata3
aData2 y aData3 son devueltos correctamente, pero los xbrowse, aunque los refresque, siguen con los datos antiguos, que puede ser