In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Get value of selected cell in tarraybrowse

Xailer professional forum in English
Responder
Maarten Roos
Mensajes: 126
Registrado: Lun Mar 29, 2010 10:24 am

Get value of selected cell in tarraybrowse

Mensaje por Maarten Roos »

I am using the Tarraybrowse to display some data and I want to get the value of the cell the users selects.
I tried to use the ondataclick and OnBtnClick...
For example:
::oArraySymbols:aCols[x]:OnBtnClick := { |oSender, Value| ::GetSymbolDescription(oSender, Value) }
How do I get the value of the selected cell?
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9447
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Get value of selected cell in tarraybrowse

Mensaje por ignacio »

Maarten,
TArrayBrowse:GetValue( )
Regards,
Note: I suggest to take a look of the source code of this method.
--
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
http://www.xailer.com/forum
http://www.xailer.com/dokuwiki
"Maarten Roos" <m[dot]roos[at]ecem[dot]com> escribió en el mensaje de
noticias:4c90d88e$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
> I am using the Tarraybrowse to display some data and I want
> to get the value of the cell the users selects.
>
> I tried to use the ondataclick and OnBtnClick...
>
> For example:
> ::oArraySymbols:aCols[x]:OnBtnClick := { |oSender, Value|
> ::GetSymbolDescription(oSender, Value) }
>
> How do I get the value of the selected cell?
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Maarten Roos
Mensajes: 126
Registrado: Lun Mar 29, 2010 10:24 am

Get value of selected cell in tarraybrowse

Mensaje por Maarten Roos »

Looking at it... but it refers only to column? I suspect also row?
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9447
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Get value of selected cell in tarraybrowse

Mensaje por ignacio »

METHOD GetValue( Col, nAt ) CLASS XArrayBrowse
LOCAL cType
LOCAL nIndex
DEFAULT nAt TO ::nArrayAt
cType := Valtype( Col )
DO CASE
CASE cType == "C"
nIndex := Ascan( ::aCols, {|v| Upper( v:cHeader ) == Upper( Col ) } )
IF nIndex > 0
nIndex := ::aCols[ nIndex ]:nIndex
ENDIF
CASE cType == "O"
nIndex := Ascan( ::aCols, {|v| v == Col } )
IF nIndex > 0
nIndex := ::aCols[ nIndex ]:nIndex
ENDIF
CASE cType == "N"
nIndex := Col
CASE cType == "U"
nIndex := ::SelectedCol():nIndex
END CASE
IF ! Empty( nIndex )
WITH OBJECT ::aCols[ nIndex ]
IF :oGridEdit:lVisible .AND. ( nAt == ::nArrayAt .OR. ::nEditMode == beAPPEND )
RETURN :oGridEdit:Value
ENDIF
END WITH
IF nAt > 0 .AND. nAt <= Len( ::FaArrayData )
RETURN ::FaArrayData[ nAt ][ nIndex ]
ENDIF
ENDIF
RETURN Nil
--
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
http://www.xailer.com/forum
http://www.xailer.com/dokuwiki
"Maarten Roos" <m[dot]roos[at]ecem[dot]com> escribió en el mensaje de noticias:4c90dfc6$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
> Looking at it... but it refers only to column? I suspect
> also row?
--
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Maarten Roos
Mensajes: 126
Registrado: Lun Mar 29, 2010 10:24 am

Get value of selected cell in tarraybrowse

Mensaje por Maarten Roos »

Ow silly me... I tried to pass the Col value to the GetValue-function. No need for that...
Responder