ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / TreeView Table control
  • Default events
  • Optional events
  • Filtering records (browsing TreeView Table control only)
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
Events associated with TreeView Table controls
Default events
WEBDEV - Server codeWEBDEV - Browser code WEBDEV manages the following events by default (order of appearance in the code editor):
EventRuntime condition
Initializing (Server code)Executed when the page is opened.
Special case: Browsing TreeView Table control populated automatically:
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: Browsing TreeView Table control populated automatically:
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 only for browsing TreeView Table controls populated automatically
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)Run when a new row must be displayed in the TreeView Table control: the TreeView Table control is redisplayed, scrolled or moved, etc.
Used to manage the calculated columns.
Table click (Browser code)Run when the Web user selects a row.
Exit from a row (Server code)Run when moving from one row or control to another (TAB key, selecting another control with the mouse, etc.).
Row selection (Browser code)Run when the user selects a row (without input).
Filter records (Server code)Code only for browsing TreeView Table controls populated automatically
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)Run when the user collapses or expands a row (or branch).
Remark: to get the name of the collapsed/expanded row in this event, use the following syntax: TreeViewTableName[TreeViewTableName].
Optional events
Several optional events are supported. 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.
    Remark: You can select several optional events.
  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.
Remark: If the disabled code contains WLanguage code, this code is automatically deleted.
You can manage the following aspects, for example:
  • the mouse hover over the control,
  • left mouse button down, up, double click,
  • right mouse button down, up, double click,
  • mouse wheel, etc.
Remark: The optional events differ according to the environment (WINDEV, WEBDEV, WINDEV Mobile) and the development platform.
WEBDEV - Server code
Filtering records (browsing TreeView Table control only)
The event "Filtering the records" is run right after a row of the TreeView Table control is displayed. Therefore, it is run:
  • when initializing the control.
  • 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:
// -- Filter records --
// Displays the customers who placed orders exceeding 3000 Euros
IF Order.TotalIOT >= 3000 THEN 
RETURN True
ELSE
RESULT 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.
Minimum version required
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/03/2023

Send a report | Local help