ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing an application or website / Controls, windows and pages / Controls: Available types / TreeView Table control
  • Default events
  • Optional events
  • Record filtering (TreeView Table control based on a data file only)
  • Before displaying the automatic tooltip of scrollbar
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
TreeView Table control events
Default events
WINDEVAndroidiPhone/iPad WINDEV and WINDEV Mobile use the following events by default (order of appearance in the code editor):
EventRuntime condition
InitializationExecuted when the window is opened. *

Special case: TreeView Table control field linked to a data file and automatically filled in.
When this code is run, the TreeView Table control is not populated yet. To force the control to be populated in this event, use:You can also filter records with HFilter.
End of initializationCode present only for TreeView Table control fields linked to a data file and automatically filled in.
Executed once the control has been populated. This code is used to select an element in the TreeView Table control, to add or modify an element.
Entry in the TreeView Table controlExecuted when the control gains focus.
Exit from the TreeView Table controlExecuted when moving from one control to another (TAB key, selecting another control with the mouse, etc.).
Entry in input mode in a row of the TreeView Table controlExecuted when the user selects a row to perform an input in this row.
Exit a row of the TreeView Table controlExecuted when a line is changed or when a field is changed (TAB key, mouse field change, etc.) from a line.
Displaying a row of the TreeView Table controlExecuted when a new line is to be displayed in the TreeView Table control, e.g. when one of the following actions is performed: redisplaying the field, scrolling or moving within the field, etc.
Selecting a row of the TreeView Table controlExecuted when the user selects a row (without input).
WINDEVAndroidiPhone/iPad TreeView Table control fields offer the following option: "Expand by clicking the row". If this option is checked, the hierarchy can be expanded by clicking on the row (and not only on the expand icon).
AndroidiPhone/iPad Special case: Option "Android/iOS selection mode" selected ("UI" tab in the control description window):
  • If the "Expand by clicking the row" option is enabled, the "Select a row" event is not called when the user clicks the row (if it is a node) and the value of the control does not change. The "Collapsing/Expanding" event of a node is called. In this event, the value of the control (Value property) corresponds to the row clicked.
  • If the "Expand by clicking the row" option is not enabled, the "Select a row" event is not called when the "+" and "-" buttons are clicked (if it is a node). The "Collapsing/Expanding" event of a node is called. In this event, the value of the control (Value property) corresponds to the row clicked.
Collapsing/Expanding a node of the TreeView Table controlExecuted when the user expands or collapses a node.
Note: The syntax HierarchicalTableName[HierarchicalTableName] used in this event is used to find out the number of the line being rolled up/unrolled.

(*) By default, the "Initialization" event of each control is executed according to the order in which the controls were created in the window. To change this order:
  1. On the "Window" tab, in the "Order" group, click "Initialization".
  2. In the window that appears, use the arrows on the right to change the order in which the controls are initialized.
WEBDEV - Server codeWEBDEV - Browser code The following events appear by default in the WEBDEV code editor:
EventRuntime condition
Initialization (Server code)Executed when the page is opened.
Special case: TreeView Table control linked to a data file and automatically filled in:
When this code is run, the TreeView Table control is not populated yet. To force the TreeView Table control to be filled in this code, use:
Executed when the page is opened.
Special case: TreeView Table control linked to a data file and automatically filled in:
When this code is run, the TreeView Table control is not populated yet. To force the TreeView Table control to be filled in this code, use:
You can also filter records with HFilter.
End of initialization (Server code)Code present only for TreeView Table control fields linked to a data file and automatically filled in.
Run once the TreeView Table control has been populated. This code allows you to select, add or modify an element in the control.
Selecting a table row (Server code)Code run when the user selects a row in the TreeView Table control.
Row display (Server code)Executed when a new line is to be displayed in the TreeView Table control field: redisplaying the TreeView Table control field, scrolling or moving within the TreeView Table control field, etc.
Used to manage the calculated columns.
Table click (Browser code)Executed when the Web user selects a row.
Exit a row (Server code)Executed when a line is changed or when a field is changed (TAB key, mouse field change, etc.) from a line.
Row selection (Browser code)Executed when a user selects a row (without input).
Filter records (Server code)Code present only for TreeView Table control fields linked to a data file and automatically filled in.
Run just before displaying a row. This event is used to filter the records that must be displayed in the TreeView Table control. This event is detailed at the end of this page.
Collapsing, Expanding a row (Server code)Executed when the user collapses or expands a row (or branch).
Note: the syntax HierarchicalTableName[HierarchicalTableName] used in this event is used to find out the number of the line being rolled up/unrolled.
Optional events
Several optional events can be added. To add an optional event:
  1. Select the desired control.
  2. Display the code window of this control (F2 key).
  3. Click the link "Add other events to xxx" at the bottom of the window code, after the last event.
  4. All the optional events available for the control are displayed.
  5. Check the optional event to add and validate.
    Note: Several optional events can be selected.
  6. The selected optional event is automatically added to the events managed by the control.
To disable an optional event, simply perform the same operations to display the list of optional events. Then simply uncheck the optional events to delete.
Note: If the deactivated code contains WLanguage code, this code is automatically deleted..
For example, you can use the following events:
  • the mouse hover over the control,
  • left mouse button down, up, double click,
  • right mouse button down, up, double click,
  • mouse wheel, etc.
Remark: Depending on the environment (WINDEV, WEBDEV, WINDEV Mobile) and the development platform, the optional events available are not the same.
WINDEVWEBDEV - Server codeiPhone/iPad
Record filtering (TreeView Table control based on a data file only)
The event "Filtering the records" is run right after a row of the TreeView Table control is displayed. Therefore, it is run:
  • when the control is initialized.
  • whenever a row is displayed in the TreeView Table control.
This event is used to filter the records displayed in the TreeView Table control.
To implement a filter, the "Filter records" event must return a value:
  • True to specify that the record matches to the filter and that it must be displayed.
  • False to specify that the record does not match the filter and that it must not be displayed.
  • Cancel to stop reading the data source of the TreeView Table control (very rare case).
Example:
// -- Filtrage des enregistrements --
// Affiche uniquement les clients dont commandes sont supérieures à 3000 euros
IF Commande.TotalTTC >= 3000 THEN 
	RETURN True
ELSE
	RETURN False
END
In this code, the data handled affects the record currently read by the TreeView Table control. This data comes from the date file or from the query linked to the control.
If an automatic filter is applied on the TreeView Table control (TableEnableFilter or filter enabled directly by the user), the filter defined by the "Filtering records" event is added to the automatic filter.
WINDEV
Before displaying the automatic tooltip of scrollbar
The tooltip for the scrollbar of TreeView Table controls is displayed when the user clicks the "box" of the vertical scrollbar in the TreeView Table.
This tooltip contains the following information by default:
  • Range of rows currently displayed in the TreeView Table control.
  • Total number of rows in the TreeView Table control.
  • Information about the element currently displayed in the first row of the control in the sorted column.
The optional event "Before displaying the automatic tooltip of the scrollbar" is run just before the tooltip is displayed. This allows displaying a specific text in the tooltip of the TreeView Table control using the ToolTip property, for example.
Minimum version required
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 02/12/2025

Send a report | Local help