|
Rank: Newbie Groups: Member
Joined: 5/10/2011 Posts: 9
|
Hi, is it possible to capture the expand/collapse event of the splitter. I would like to execute some code when the user clicks the expand button on the divider.
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You won't be able to capture expand/collapse event specifically, you can handle the Splitter's ClientSideOnResized event. That event is triggered when user expands/collapses the splitter and resizes the splitter.
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 5/10/2011 Posts: 9
|
Hi, thanks for you reply. I have implemented a solution where I handle the ClientSideOnResize event in javascript and then use your ScriptEvent to post back to the server. The problem now is that each post back seems to cause a resize event to get called on the Splitter so now I have an infinite loop.
Can you explain why a post back would cause the Splitter to resize? Is there any way around this?
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
That makes sense. The splitter will resize itself on page load. This is necessary because certain size properties is only be known after the page is loaded (for example, if you set a DIV's size through a CSS class that is defined in an external CSS file, then that DIV's size will only be known after that CSS file is loaded and applied).
To avoid this problem, you can either change your code NOT to post back right after the page is loaded, or change your code to check the new splitter pane's state and only posts back if the splitter panel's state changes.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 5/10/2011 Posts: 9
|
Thanks. Can you please assist me with the implementation of your latter suggestion to check the state of the splitter pane before posting back. I have tried the following javascript to get the state property but is doesn't return a value.
var splStatus = document.getElementById("<%=SplitterMenu.ClientID%>").state;
Is this what I should be doing?
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, No. You will need to use our client side API to do it. See here for more details: http://doc.essentialobjects.com/library/1/clientapi_howto.aspxYou will need to get the Splitter object first, then call getLeftPane/getRightPane to get the SplitterPane object, then call getState to get the SplitterPane's state. Thanks
|
|
Rank: Newbie Groups: Member
Joined: 5/10/2011 Posts: 9
|
Yes, that worked perfectly. Thanks for your help.
|
|