You can save the chart nodes state in the Tree Chart or
Organization Chart on a visual dashboard programmatically. See an
example of saving the chart nodes state 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 save the chart nodes state:
Procedure
- In the
DEMO.EMPLOYEE
example project,
add two global parameters ExpandedNodesSaved and CollapsedNodesSaved of
the Text type.
- Add two buttons to the project: Button1 and Button2.
- For Button1 specify the Caption property
as Save.
- Add the action Set Values on the Click event.
In the Add New Action wizard specify two actions:
ExpandedNodesSaved=OrganizationChart1.DataLocator.ExpandedNodes
CollapsedNodesSaved=OrganizationChart1.DataLocator.CollapsedNodes
- For Button2 specify the Caption property
as Load.
- Add the action Set Values on the Click event.
In the Add New Action wizard specify two actions:
OrganizationChart1.DataLocator.ExpandedNodes=ExpandedNodesSaved
OrganizationChart1.DataLocator.CollapsedNodes=CollapsedNodesSaved
Note: At first, it is necessary to bind the value of ExpandedNodes,
and then the value of the CollapsedNodes property.
- Click Runtime tab. Expand and collapse
the nodes. Click the Save button to write the
nodes state to the global parameters.
- Expand and collapse the nodes, click the Load button
to restore the tree to the state saved by clicking the Save button.