ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Table functions
  • Use conditions
  • Displaying a row in first position (syntax 1)
  • Selection bar and <Table>.Position function
  • Table control based on a data file: limitations of <Table>.Position
  • Event "Entry in edit in a row of"
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Displays a Table or TreeView Table control from a specified row or returns the index of the first row displayed in a Table or TreeView Table control.
WEBDEV - Browser code This function is only available for Table controls in "Browser" mode.
Example
// Index of the first row displayed in the "TABLE_Product" control
ResPosition = TABLE_Product.Position()
Syntax

Displaying a Table or TreeView Table control from a specified row Hide the details

<Table control>.Position(<Subscript> [, <Option>])
<Table control>: Control name
Name of the Table or TreeView Table control to be used.
<Subscript>: Integer
Index of the row that will be displayed in the control. This row is displayed in first position by default.
If <Index> is greater than the number of rows in the control (returned by <Table>.Count), the last row is selected by default.
<Option>: Integer constant
WINDEVWEBDEV - Server codeWEBDEV - Browser codeiPhone/iPadPHP Position of the row in the control:
taFirst
(Default value)
The row specified by <Indext> is displayed at the first position in the Table/TreeView Table control.
taVisibleThe row specified by <Index> becomes visible in the Table/TreeView Table control. It is displayed:
  • at first position (if <Index> is less than the current row).
  • at last position (if <Index> is greater than the current row).
If the row is already visible, the display of the Table/TreeView Table control does not change.

Getting the index of the first row displayed in a Table or TreeView Table control Hide the details

<Result> = <Table control>.Position()
<Result>: Integer
Index of the first row displayed in the specified control.
PHP Last value of <Index> specified in the syntax displaying a row. You cannot find out the first row actually displayed once the scrollbar of the Table control has been used.
<Table control>: Control name
Name of the Table or TreeView Table control to be used.
Remarks

Use conditions

<Table>.Position can be used on:
  • Table or TreeView Table controls based on a data file.
  • Table or TreeView Table controls populated programmatically.
  • a single-selection or multiselection control.
WEBDEV - Server codePHP Reminder: Multi-selection is not available for "classic" Table controls.

Displaying a row in first position (syntax 1)

The row displayed in first position may differ from the requested one. Indeed, <Table>.Position tries to display as many rows as possible in the control.
<Table>.Position will display the specified row only if this row is followed by a sufficient number of non-empty rows. In the following example, the "Durand" row cannot be displayed at the beginning of Table control.

Selection bar and <Table>.Position function

<Table>.Position does not modify the current row (i.e. the row selected with the selection bar).
Therefore, if the Table control has focus when <Table>.Position is run, the current row will have to be visible at the same time as the specified row. If the current row and the specified row cannot be displayed at the same time, the content of the control will be displayed from the current row (and not from the row specified by <Index>).
WINDEVReports and QueriesJavaUser code (UMC)

Table control based on a data file: limitations of <Table>.Position

<Table>.Position does not operate with Table controls based on a data file in "manual" mode that use a bouncing scrollbar ("Proportional scrollbar" not checked in the "Details" tab of the control description).
Reminder:
  • A browsing Table control in "manual" mode is a control that is linked by programming to a data file.
  • A bouncing scrollbar allows you to move the scrollbar by keeping the mouse button pressed on the scrollbar box or by keeping one of the arrow keys down.

Event "Entry in edit in a row of"

  • <Table>.Position does not force the execution of the "Entry in edit in a row of" event.
  • <Table>.Position cannot be used in the "Entry in edit in a row of" event of the control (the result returned is incorrect).
Component: wd290obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/20/2023

Send a report | Local help