Salesforce

How Do I Set the Tree Control to Display the Expand Button Only in Nodes with Child Nodes? (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

How Do I Set the Tree Control to Display the Expand Button Only in Nodes with Child Nodes? (Magic xpa 4.x)

Node Preload = False

Node Preload = True


By default, each node of a tree has a small ‘+’ or ‘-’ button next to it. Clicking on a ‘+’ will expand a node, and clicking on a ‘-’ will collapse the node. However, initially all the nodes will have a ‘+’ in front of them, because the engine has not fetched any of the subrecords and so does not “know” if any exist. Once the user clicks on the node, the ‘+’ will disappear if there are no subrecords.

You can change this behavior by instructing the engine to preload all the records in the tree. Then the leaf nodes will be correctly marked, with no expand button.

Turning on preload

  1. Select the Tree control.

  2. Set Control Properties -> Node Preload to True.

Now the expand and collapse buttons will only show when they are relevant.

Note: Setting Node Preload to True might make the tree take perceptibly longer to load if there are a lot of records.

See also

The Online and Rich Client Samples projects (program TR09 and RTR09)

Reference
Attachment 
Attachment