AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Controles, páginas y ventanas / Funciones Tabla
  • Use conditions
  • The different types of column indexes
  • Using MouseXPos and MouseYPos
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Returns for a given position in a Table or TreeView Table control (coordinates of a control point):
  • the name of the column displayed for the specified position.
  • the index of the row or column for the specified position.
WEBDEV - Código Navegador In browser code, this function is only available for Table fields.. It is not available for TreeView Table control fields..
WINDEVAndroid
// Optional click code on the TABLE_TABLE1 control
MyRow is int
MyColumn is string
MyRow = TableInfoXY(TABLE_TABLE1, tiLineNumber, MouseXPos(), MouseYPos())
MyColumn = TableInfoXY(TABLE_TABLE1, tiColName, MouseXPos(), MouseYPos())
Trace("You have selected the cell (" + MyColumn+", " + MyRow + ")")
// Index of the row at point (50, 100) of the "TABLE_ProductTable" control 
ResInfo = TableInfoXY(TABLE_ProductTable, tiLineNumber, 50, 100)
Sintaxis
<Result> = TableInfoXY(<Table control> , <Type of information> , <X> , <Y>)
<Result>: String, integer or boolean
  • Requested information.
  • An empty string ("") if there is no column name.
  • -1 if there is no column index or row number, or if the specified position corresponds to an empty row or column.
<Table control>: Control name
Name of the Table or TreeView Table control to be used.
If this parameter corresponds to an empty string (""), the control to which the current event belongs will be used.
<Type of information>: Integer constant
Type of information requested:
tiColNameColumn name.
WEBDEV - Código NavegadoriPhone/iPadMac Catalyst This constant is not available.
tiColNumberColumn creation index.
iPhone/iPadMac Catalyst This constant is not available.
tiLineNumberRow number.
tiOnButtonCollapseExpand"+/-" buttons to expand/collapse a row. In this case, <Result> is set to True (1).
This constant is only available for TreeView Table controls.
WEBDEV - Código Navegador This constant is not available.
tiOriginScreenThe coordinates to be analyzed are relative to the screen.
Reminder: By default, the coordinates to be analyzed are given in relation to the Table control: the point (0,0) corresponds to line 1, column 1 of the manipulated Table control (with the scrollbars at the origin).
This constant cannot be used on its own.
WEBDEV - Código Navegador This constant is not available.
<X>: Integer
X-coordinate (in pixels) to be analyzed. This coordinate is given in relation to the control (if the tiOriginScreen constant is not specified).
<Y>: Integer
Y-coordinate (in pixels) to be analyzed. This coordinate is given in relation to the control (if the tiOriginScreen constant is not specified).
Observaciones

Use conditions

TableInfoXY can be used on:
  • Table or TreeView Table controls based on a data file.
  • Table or TreeView Table controls populated programmatically.
  • single-selection or multi-selection controls.
  • the function doesn't return any result if the Table control is empty.

The different types of column indexes

There are 2 types of indexes for columns:
  • Visible position index: column index when the window is run.
  • Creation index: column index when the table is created in the window editor.
These indexes change if the user moves the columns.
Additionally, if the horizontal scrollbar is used, TableInfoXY takes this change into account.

Using MouseXPos and MouseYPos

To use MouseXPos and MouseYPos in the X and Y parameters of the function, make sure that a single mouse click will trigger the execution of the code containing this function.
For example, the "Select a row" event of a Table control can be started by a simple click but also by a keyboard selection. Therefore, MouseXPos and MouseYPos should not be used in this event. Use an optional event instead. In this example, use the optional event "Left button down" on aTable control.
Clasificación Lógica de negocio / UI: Código UI
Componente: wd300obj.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Dica de ouro
Prezados

Para pegar um registro id de um browser table grid tem 2 formas:

Crie uma var global da janela:
GNID is 8-byte int = 0


A) Em Code evento
SELECT ROW

GNID = TableNameGrid.COL_myID



B) Em Code evento
SELECT ROW

Nx is int = Tableinfoxy(TableNameGrid, tiLineNumber, MouseXPos(), MouseYPos())

If nx > 0

GNID = TableNameGrid[nx].COL_myID

End
Boller
16 04 2024
Exemplo
https://forum.pcsoft.fr/fr-FR/pcsoft.br.windev/3239-procedure-com-indirection-para-selecionar-registro-uma-grid-3240/read.awp
BOLLER
24 06 2019
Getting field Value
nColumn is int = TableInfoXY(TABLE_FLUXO,tiColNumber, MouseXPos(), MouseYPos())

nLine is int = TableInfoXY(TABLE_FLUXO,tiLineNumber, MouseXPos(), MouseYPos())

FieldValue is string = TABLE_FLUXO[nLine ,nColumn]
Danilo
28 08 2018
Exemplo TableInfoXY

s_nome_coluna is string=TableInfoXY(TABLE_condicoes_parcela,tiColName,MouseXPos(),MouseYPos())
nS_posicao_linha is int=TableInfoXY(TABLE_condicoes_parcela,tiLineNumber,MouseXPos(),MouseYPos())
nS_posicao_coluna is int=TableInfoXY(TABLE_condicoes_parcela,tiColNumber,MouseXPos(),MouseYPos())
IF s_nome_coluna="COL_data_vencimento" THEN
ReturnToCapture(EDT_cond_data_vencimento)
ELSE
ReturnToCapture(EDT_cond_valor_titulo)
END

//Blog com Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/03/curso-windev-tabela-017-saber-nome.html
De matos AMARILDO
20 03 2016
Wx - Capturar Click no Browse List
// retrieve the row that was clicked

nRowNum is int=TableInfoXY(TABLE_t012_filiais,tiLineNumber,MouseXPos(),MouseYPos())

// if the row corresponds to a user

IF nRowNum>0 _AND_ nRowNum<=TABLE_t012_filiais..Occurrence THEN

// modify the user

gsAcao = "Alterar"

Registro_ID = TABLE_t012_filiais[nRowNum].COL_T012_filiaisID // <---- nRowNum ATENÇÃO AQUI VC DEVE COLOCAR O NUMERO DA LINHA

//info(Registro_ID)

ExecuteProcess(TAB_Geral.BTN_Alterar_Filial,trtClick)

ELSE

// new user

gsAcao = "Incluir"

ExecuteProcess(TAB_Geral.Btn_Incluir_Filial,trtClick)

END
adrianoboller
18 02 2016

Última modificación: 28/03/2025

Señalar un error o enviar una sugerencia | Ayuda local