Page 1 of 1

xBrowse - Edit

Posted: Wed Mar 09, 2011 2:25 am
by oliveiros junior
Buenas noches,

¿Cómo hacer para pasar de una celda a otra celda y la siguiente en xbrowse ya se ha editado. ¿Es eso posible?

Gracias,

Junior

Re: xBrowse - Edit

Posted: Wed Mar 09, 2011 3:25 am
by joseluisysturiz
Este es un ejemplo con una columna completa

oCol = oBrw:AddCol()
oCol:bStrData = { || Transform((cAlias)->HABER,"9,999,999,999.99") }
oCol:nDataStrAlign := 1
oCol:cHeader = "CREDITOS"
oCol:nEditType = EDIT_GET
oCol:lTotal := .t. //para totalizar cols a report y/o excel
oCol:bFooter = {|| TRANSFORM(nTotal2,"9,999,999,999.99") }
oCol:nFootStrAlign := 1
oCol:bEditWhen := {|| (cAlias)->Debe =0 }
oCol:bOnPostEdit = { | oCol, xVal, nKey | If( RecCount() == 0, ( DbAppend(), oBrw:Refresh() ),),;
If( nKey == VK_RETURN,;
if(lCtaOK(oBrw), ( nTotal2+=(Val(xVal)-(cAlias)->HABER), oCol:RefreshFooter(), (cAlias)->HABER := Val(xVal) ), oBrw:GoLeftMost()) ,) }

Re: xBrowse - Edit

Posted: Wed Mar 09, 2011 3:43 am
by oliveiros junior
Hola José Luis,

Gracias por la respuesta.

No funcionó como se esperaba. Lo que busco es la siguiente: Estoy en una celda publicada y presione "enter " para ir hacia abajo y la línea celular ya está publicada, sin tener que pulsar "enter"de nuevo.

gracias

Re: xBrowse - Edit

Posted: Wed Mar 09, 2011 6:10 am
by anserkk
While editing,by default xBrowse cursor will jump to the next editable cell in the same row. If you have only one single editable cell in a row, then xBrowse will jump to the next editable cell in the next row.

You can also control the cursor movements by calling the following xbrowse built in methods

Code: Select all

oBrw:SelectCol( nCol, lOffSet )
oBrw:GoLeft( lOffset, lRefresh )
oBrw:GoRight( lOffset, lRefresh )
oBrw:GoLeftMost()
oBrw:GoRightMost()
oBrw:GoUp( nLines )
oBrw:GoDown( nLines )
oBrw:PageUp( nLines )
oBrw:PageDown( nLines )
oBrw:GoTop()
oBrw:GoBottom()
You may also try the FastEdit feature of xBrowse

Code: Select all

oBrw:lFastEdit:=.T.
Regards
Anser

Re: xBrowse - Edit

Posted: Wed Mar 09, 2011 12:33 pm
by oliveiros junior
thanks for the reply anserkk,

the leap to another cell occurs, but not the next cell gets edited, it is necessary to give another "ENTER" to stay.

After obrw: godown (), have experienced __KeyBoard (Chr (13)) and neither worked. lFastEdit cell changes but do not start editing.

thanks,
junior

Re: xBrowse - Edit

Posted: Wed Mar 09, 2011 1:54 pm
by jbrita
Amigo Prueba asi;

oBrw:aCols[1]:cHeader := 'Codigo'
oBrw:aCols[1]:cEditPicture := '!!!!!!!!!!!!!'
oBrw:aCols[1]:bClrEdit := oBrw:bClrStd
oBrw:aCols[1]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN,"",),oBrw:GoRight(),oBrw:GoRight() }
oBrw:aCols[1]:nEditType := EDIT_GET_BUTTON
oBrw:aCols[1]:bEditValid := { | oGet, oCol | BuscarProd( oGet,oCol,oBrw,aDatos,oDlg1 ) }
oBrw:aCols[1]:bEditBlock := {|| LeerCodigo(oDlg1,oBrw,aDatos),oBrw:GoRight(),oBrw:GoRight() }
oBrw:aCols[1]:nDataStrAlign:= AL_LEFT
oBrw:aCols[1]:nHeadStrAlign:= AL_CENTER
oBrw:aCols[1]:bF2 := {|| LeerCodigo(oDlg1,oBrw,aDatos),oBrw:GoRight(),oBrw:GoRight() }
oBrw:aCols[1]:nWidth := 100
oBrw:aCols[1]:bLClickHeader:= {|r,c,f,o|LeerCodigo(oDlg1,oBrw,aDatos),oBrw:GoRight(),oBrw:GoRight() }
oBrw:aCols[1]:oHeaderFont := oFnt
*oBrw:aCols[1]:bEditWhen := { || IF(Len(aGuias)=0,.T.,.F.) }

oBrw:aCols[2]:cHeader := 'Description'
oBrw:aCols[2]:bClrEdit := oBrw:bClrStd
oBrw:aCols[2]:nWidth := 295
oBrw:aCols[2]:nHeadStrAlign:= AL_CENTER
oBrw:aCols[2]:oHeaderFont := oFnt

oBrw:aCols[3]:cHeader := 'Cantidad'
oBrw:aCols[3]:cEditPicture := '@k 9999.99'
oBrw:aCols[3]:bClrEdit := oBrw:bClrStd
oBrw:aCols[3]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN, aDatos[ oBrw:nArrayAt,3] := xVal,),oBrw:GoRight() }
oBrw:aCols[3]:nEditType := EDIT_GET
oBrw:aCols[3]:bEditValid := { | oGet, oCol | Valida( oGet, oCol ) }
oBrw:aCols[3]:nDataStrAlign:= AL_RIGHT
oBrw:aCols[3]:nHeadStrAlign:= AL_CENTER
oBrw:aCols[3]:nWidth := 70
* oBrw:aCols[3]:bEditWhen := { || IF(Len(aGuias)=0,.T.,.F.) }
oBrw:aCols[3]:oHeaderFont := oFnt

Saludos

Re: xBrowse - Edit

Posted: Wed Mar 09, 2011 6:53 pm
by oliveiros junior
gracias por contestar JBrita,

Creo que el problema se produce cuando ejecuto el comando oBrw:GoDown() porque se corre el CancelEdit () no permite la edición de la celda de abajo sin una nueva "ENTER".

Voy a hacer algunas pruebas. Pero gracias por la información.

Junior