Página 1 de 1

Get value of selected cell in tarraybrowse

Publicado: Mié Sep 15, 2010 4:30 pm
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?

Get value of selected cell in tarraybrowse

Publicado: Mié Sep 15, 2010 4:48 pm
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?

Get value of selected cell in tarraybrowse

Publicado: Mié Sep 15, 2010 5:01 pm
por Maarten Roos
Looking at it... but it refers only to column? I suspect also row?

Get value of selected cell in tarraybrowse

Publicado: Jue Sep 16, 2010 9:51 am
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?
--

Get value of selected cell in tarraybrowse

Publicado: Jue Sep 16, 2010 10:21 am
por Maarten Roos
Ow silly me... I tried to pass the Col value to the GetValue-function. No need for that...