Problema con Xbrowse y arrays

Problema con Xbrowse y arrays

Postby alvaro533 » Tue Feb 28, 2017 8:02 pm

Hola amigos,

Tengo un problema cuya solución no he encontrado en el foro. Tengo un Xbrowse con un array

Este código funciona

Code: Select all  Expand view
oBrw:aCols[ 1 ]:bEditValid := { | oGet, oCol |  oBrw:aArrayData[ oBrw:nArrayAt, 1 ] := mi_funcion1( oget:value )  , .t.  }


Sin embargo esto no funciona

Code: Select all  Expand view
oBrw:aCols[ 1 ]:bEditValid := { | oGet, oCol |  mi_funcion2( oGet , oBrw )  }

...

static function mi_funcion2( oGet,oBrw)

oBrw:aArrayData[ oBrw:nArrayAt, 1 ] := mifuncion1( oget:value )
return .t.

 



Muchas gracias y un saludo

Alvaro
alvaro533
 
Posts: 206
Joined: Sat Apr 19, 2008 10:28 pm
Location: Madrid, España

Re: Problema con Xbrowse y arrays

Postby alvaro533 » Tue Feb 28, 2017 11:02 pm

Ya lo he descubierto, hay que definir un bOnPostEdit para que funcione.
alvaro533
 
Posts: 206
Joined: Sat Apr 19, 2008 10:28 pm
Location: Madrid, España

Re: Problema con Xbrowse y arrays

Postby nageswaragunupudi » Thu Mar 02, 2017 1:51 pm

May I ask why do you want to use either bEditValid or bOnPostEdit?

If the purpose is to edit in the cell and assign the value to the array element, nothing is necessary.

Code: Select all  Expand view

@ r,c XBROWSE oBrw SIZE w,h PIXEL OF oDlg DATASOURCE aArray AUTOCOLS FASTEDIT

oBrw:nEditTypes := EDIT_GET
oBrw:CreateFromCode()
 

This should be enough without any extra code.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 41 guests