You can expand or collapse all chart nodes in the tree
or organization charts on a visual dashboard programmatically. See
an example of expanding or collapsing the chart nodes on the basis
of the DEMO.EMPLOYEE
example project.
Before you begin
You must have a visual dashboard with an added Organization
Chart or Tree Chart.
About this task
To expand or collapse all the chart nodes:
Procedure
- In the
DEMO.EMPLOYEE
example project,
add a button and set its Caption value to Expand
All.
- Add the action Set Values on the Click event
with the expression:
OrganizationChart1.DataLocator.ExpandedNodes=field("Query1",
"EMPLOYEE_ID")
Note: The separator in the expression
depends on the locale settings.
- Add a button and set its Caption value
to Collapse All.
- Add the action Set Values on the Click event
with the expression:
OrganizationChart1.DataLocator.CollapsedNodes=field("Query1",
"EMPLOYEE_ID")
Note: The separator in the expression
depends on the locale settings.
- Click Runtime tab and expand all
chart nodes by clicking the Expand All and
collapse them all by clicking Collapse All.
Note: If you add the example buttons to the Data Template they
will work only with the node connected with this Data Template.