Rank: Advanced Member Groups: Member
Joined: 8/24/2007 Posts: 130
|
I am using a treeview control that I have placed in a callback panel. I have a second call back panel that has dyanamic content. Both panels are grouped. I have specified a ClientSideOnItemClick handler for the tree view. Within this handler, I call eo_Callback on the second callback panel. The problem I am having is that when I select a tree node, the tree group expands and then collapses again when the call back returns. This does not look good.
I have found that if I remove the group relationship between the two callback panels, the problem goes away. However, I need these panels grouped, so this is not a solution.
I have also tried setting Expanded=true on the selected tree in the Execute handler, but when I do this, the group partially expands, stops, then fully expands a second later. This also does not look good.
Is there any way of disabling auto-expand on node selection?
Regards
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
The easiest way is to use trigger instead of eo_Callback to trigger the callback. In order to do that, you would need to:
1. Remove your ClientSideOnItemClick handler; 2. Set the TreeView's RaisesServerEvent to true; 3. Set the TreeView as a Trigger of either CallbackPanel control;
After you do this, when you click the TreeView node, since it knows that it will go back to the server side immediately (because RaisesServerEvent is true), it will not play the expand effect. Instead it will simply notify the server that a node has been clicked, and the server side will then expand it. Once the page comes back (via CallbackPanel or not), the node will show as expanded.
If you orginally have more code in ClientSideOnItemClick that calling eo_Callback, you can consider moving them into the CallbackPanel's ClientSideAfterUpdate handler when you no longer use ClientSideOnItemClick.
Thanks
|