Welcome Guest Search | Active Topics | Sign In | Register

Splitter Expand/Collapse Event Options
nickbell
Posted: Friday, July 15, 2011 12:31:59 PM
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
eo_support
Posted: Friday, July 15, 2011 12:56:04 PM
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
nickbell
Posted: Monday, July 18, 2011 6:36:06 AM
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
eo_support
Posted: Monday, July 18, 2011 11:46:31 AM
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!
nickbell
Posted: Wednesday, July 20, 2011 7:12:43 AM
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
eo_support
Posted: Wednesday, July 20, 2011 8:05:37 AM
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.aspx

You 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
nickbell
Posted: Wednesday, July 20, 2011 12:47:46 PM
Rank: Newbie
Groups: Member

Joined: 5/10/2011
Posts: 9
Yes, that worked perfectly. Thanks for your help.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.