ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / Table functions
  • Use conditions
  • Branch to collapse or expand
  • Managing the selection bar during collapse
  • Managing the selection bar during expansion
  • Runtime speed for the TreeView Table controls
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Collapses or expands an element in a Table or TreeView Table control.
Table control:
  • Collapses the break if it is expanded. The elements of the break are no longer visible in the Table control.
  • Expands the break if it is collapsed. The elements of the break are then visible in the Table control.
Example
// Enroule ou déroule la branche sélectionnée dans le champ Table hiérarchique 
SWITCH TableCollapseExpand(TABLEH_Planning)
	CASE taCollapsed
	Info(" La branche a été déroulée. ")
	CASE taExpanded
	Info(" La branche a été enroulée. ")
	CASE taError
	Info(" La branche n'existe pas. ")
END
// Enroule ou déroule la branche de la première ligne du champ Table hiérarchique "TABLEH_Planning"
TableCollapseExpand(TABLEH_Planning, 1)
// Enroule ou déroule la branche spécifiée dans le champ Table hiérarchique
TableCollapseExpand(TABLEH_Planning, "MaRacine" + TAB + "MaBranche")
// Enroule ou déroule la rupture de la ligne en cours dans le champ Table "TABLE_Rupture"
TableCollapseExpand(TABLE_Rupture, TABLE_Rupture)
Syntax

Hierarchical table: Wrap or unwrap a branch by specifying the line number Hide the details

<Result> = TableCollapseExpand(<TreeView Table control> [, <Row used>])
<Result>: Integer
State of the specified branch before calling the function:
taCollapseBranch collapsed.
taErrorBranch not found.
taExpandBranch expanded.
<TreeView Table control>: Control name
Name of the TreeView Table control to be used.
<Row used>: Optional integer
Number of the row containing the branch to collapse or expand. If this parameter is not specified, the branch contained in the current row is used.

Table with breaks: Winding or unwinding a break Hide the details

<Result> = TableCollapseExpand(<Table control> [, <Row used> [, <Break>]])
<Result>: Integer
State of the specified break before calling the function:
taCollapseBranch collapsed.
taErrorBranch not found.
taExpandBranch expanded.
<Table control>: Control name
Name of the Table control to be used. This control must have one or more breaks. Otherwise, this function has no effect.
<Row used>: Optional integer
Number of row with break to collapse or expand. This number must correspond to the number of the current row or to the number of the first row with the break to expand or collapse. If this parameter is not specified, the break of the current row is used.
<Break>: Optional character string
Name of break to collapse or expand. This parameter must be specified in case of nested breaks. It allows you to define the break that will be collapsed or expanded. By default, no break is used if the breaks are nested.
Remarks

Use conditions

TableCollapseExpand can be used on:
  • a Table control based on a data file.
  • a Table control populated programmatically.
This function cannot be used on the Table controls based on a data file (direct access).

Branch to collapse or expand

TableCollapseExpand has no effect:
TreeView Table controlTable control with breaks
  • if the branch to use cannot be found.
  • if the branch to use is a leaf.
  • if the branch to use is already collapsed.
  • if the Table control contains no break.
  • if the Table control contains several breaks and the break to use is not specified.
  • if no row is selected in the Table control and if <Row number> is not specified.

Note for the TreeView Table controls:
  • If the parameter <Row used> or <Branch used> corresponds to the branch contained in the first row, the whole tree structure of the TreeView is collapsed (equivalent to TableCollapseAll) or expanded (equivalent to TableExpandAll).
  • When TableCollapseExpand is called, if the specified branch is expanded and has an associated procedure via the AddChildDelayed property, this procedure will be executed.

Managing the selection bar during collapse

For the TreeView Table controls:
  • If the selection bar was positioned on one of the elements of the node to collapse, it is positioned on the collapsed or expanded node after the call to TableCollapseExpand.
  • The modification code is called whenever the selection bar is moved. If two levels are collapsed and if the selection bar is positioned on the higher node, the modification codes of each level are run.
For the Table controls with breaks, the selection bar is not modified. It stays on the current element even if the break is collapsed.

Managing the selection bar during expansion

TableCollapseExpand does not change the position of the selection bar.

Runtime speed for the TreeView Table controls

The runtime speed of syntax 1 is faster than the runtime speed of syntax 2.
Component: wd300obj.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help