on 03-14-2006 10:07 AM - last edited on 02-03-2024 7:11 PM by postmig_api_4
hi everybody,
The thing is in tree having parent nodes are there each parent node having corresponding child nodes are there
whenever i clik the parent node then i am getting child nodes again i am cliking another parent node that corresponding nodes are coming but previous child nodes are also staying like that it does not goes that child nodes how it possible
The thing is clik any number of parent nodes but i want only one parent node childs will display on the screeen
tony
Tony,
First option: (not sure if it works) make child nodes singleton, this way only elements on lead selection path should be visible.
Second: bind "expanded" property of TreeNodeType to some boolean attribute, say IsExpanded, for every onAction in tree save current parent and if previously saved instance exists set IsExpanded to false.
Valery Silaev
EPAM Systems
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tony,
I've found even better way.
To make discution concrete, let us assume that I have node Companies and child node (non-singleton) Products, both with attribute Name (string)
1. Add 2 attributes to node Companies, both type boolean, first one IsExpanded, second one IsExpanded<b>X</b>
2. Make attribute IsExpanded<b>X</b> calculated, getter and setter should be generated.
3. Add the following at the end of view controller (between "//@@begin others" and "//@end"):
private IPrivate<ViewName>.ICompaniesElement _elLastCompany;
4. Write code for getter of IsExpanded<b>X</b>:
return element.getIsExpanded();
5. Write code for setter of IsExpanded<b>X</b>:
element.setIsExpanded( value );
if ( value )
{
if ( null != _elLastCompany && element != _elLastCompany )
{
// Skip phantoms
if ( null != _elLastCompany.node() )
_elLastCompany.setIsExpanded( false );
}
_elLastCompany = element;
}
else if ( element == _elLastCompany )
{
_elLastCompany = null;
}
6. Create Tree UI control, set Companies as data source
7. Create TreeNodeType for node Companies, bind property "text" to Companies.Name, <b>bind property "expanded" to IsExpanded<i>X</i></b>.
8. Create TreeItemType for node Products, bind property "text" to Companies.Products.Name
Build, deploy, run
Valery Silaev
EPAM Systems
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.