PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

New WINDEV, WEBDEV, WINDEV Mobile 25 feature!
  • 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
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Collapses or expands an element in a Table or TreeView Table control.
WINDEVWEBDEV - Server codeWindows Mobile TreeView Table control:
  • Collapses the branch if it is expanded. "Child" nodes are no longer visible in the TreeView Table control. Child nodes remain in their previous status (collapsed or expanded).
  • Expands the branch if it is collapsed. "Child" nodes are visible in the TreeView Table control.
Table control:
  • Expands the break if it is collapsed. 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.
  • WINDEV collapses or expands the details of a row (For more details, see Managing the details of a row in a Table control):
    • Collapses the window if it is expanded.
    • Expands the window if it is collapsed.
Example
// Collapses or expands the selected branch in the TreeView Table control
SWITCH TVT_Schedule.CollapseExpand(
CASE taCollapse
Info(" Branch expanded. ")
CASE taExpand
Info(" Branch collapsed. ")
CASE taError
Info(" Branch not found. ")
END
// Expands or collapses the the first row of "TVT_Schedule"
TVT_Schedule.CollapseExpand(1)
// Collapses or expands the specified branch in the TreeView Table control
TVT_Schedule.CollapseExpand("MyRoot" + TAB + "MyBranch")
// Collapses or expands the break of the current row in "TABLE_Break"
TABLE_Break.CollapseExpand(TABLE_Break)
Syntax

TreeView Table: Collapsing or expanding a branch, specifying the row number Hide the details

<Result> = <TreeView Table control>.CollapseExpand([<Row used>])
<Result>: Integer
State of the specified branch before calling the function:
taExpandBranch expanded.
taCollapseBranch collapsed.
taErrorBranch not found.
<TreeView Table control>: Control name
Name of TreeView Table control to use.
<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.
WINDEVWEBDEV - Server codeWindows Mobile

TreeView Table: Collapsing or expanding a branch, specifying its name Hide the details

<Result> = <TreeView Table control>.CollapseExpand([<Branch used>])
<Result>: Integer
State of the specified branch before calling the function:
taExpandBranch expanded.
taCollapseBranch collapsed.
taErrorBranch not found.
<TreeView Table control>: Control name
Name of TreeView Table control to use.
<Branch used>: Optional character string (with quotes)
Name of branch to collapse or expand. This parameter has the following format:
"<Name of root>" + TAB + ["<Name of 1st node>" + TAB + ...
["<Name of 2nd node>" + TAB + [...]]]"<Branch name>"
A WLanguage error occurs if this parameter does not correspond to an existing branch.
If this parameter is not specified, the branch contained in the current row is used.
If two branches correspond to the specified path, only the first one is used.

Table with breaks: Collapsing or expanding a break Hide the details

<Result> = <Table control>.CollapseExpand([<Row used> [, <Break>]])
<Result>: Integer
State of the specified break before calling the function:
taExpandBranch expanded.
taCollapseBranch collapsed.
taErrorBranch not found.
<Table control>: Control name
Name of Table control to use. 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.
WINDEV

Table and treeview table: collapsing a detailed window Hide the details

<Result> = <Table control>.TableCollapseExpand([<Row used>])
<Result>: Integer
State of the specified details window before calling the function:
taExpandBranch expanded.
taCollapseBranch collapsed.
taErrorBranch not found.
<Table control>: Control name
Name of Table or TreeView Table control to use.
<Row used>: Optional integer
Number of row whose details must be collapsed or expanded. If this parameter is not specified, the details of the current row are used.
Remarks

Use conditions

<Table>.CollapseExpand can be used on:
  • WINDEVWEBDEV - Server codeWindows Mobile a TreeView Table control.
  • a memory Table control.
  • a browsing Table control loaded in memory.
  • WEBDEV - Server code an Ajax Table control or a classic Table control.
  • WEBDEV - Browser code a Table control in browser mode.
This function cannot be used on the browsing Table controls (direct access).

Branch to collapse or expand

<Table>.CollapseExpand 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 <Table>.CollapseAll) or expanded (equivalent to <Table>.ExpandAll).
  • When <Table>.CollapseExpand is called, if the specified branch is expanded and has an associated procedure via ..AddChildDelayed, this procedure will be run.

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, the bar is positioned on the collapsed or expanded node after the call to <Table>.CollapseExpand.
  • 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

<Table>.CollapseExpand does not modify 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 : wd250obj.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment