Welcome Guest Search | Active Topics | Sign In | Register

SaveStateCrossPages on Splitter Options
Mikael Lehmann
Posted: Saturday, March 15, 2008 2:27:23 AM
Rank: Member
Groups: Member

Joined: 6/17/2007
Posts: 17
Hi,
I can't find any way to use a "SaveStateCrossPages-function" when using a splitter. If the user resizes the left pane and moves to another page then the left pane returns to it's original position.

Thanks
eo_support
Posted: Saturday, March 15, 2008 8:14:39 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi Mikael,

Unfortunately it doesn't have that. Unlike Menu/TreeView, splitter is rarely directly associated with navigation, which makes it a bit odd to have such a property --- just like you wouldn't expect such a property on a TextBox control.

SaveStateCrossPage works by either append the state information to the navigate Url or from a cookie, so you can do the same. For example, instead of having a link

Code: HTML/ASPX
<a href="Page2.aspx">go to page2</a>


You can have:

Code: HTML/ASPX
<a href="javascript void goto('Page2.aspx');">go to page2</a>


Where "goto" is a JavaScript function you would implement:

Code: JavaScript
function goto(url)
{
    //Get the splitter position
    var leftPaneWidth = Splitter1.getLeftPane().getWidth();
    
    //Append it to the target Url
    if (url.indexOf("?") > 0)
        url = url + "&spliter_pos=" + leftPaneWidth;
    else
        url = url + "?splitter_pos=" + leftPaneWidth;

    //Navigate to the target Url
    window.open(url, "_self");
}


You would then modify your server side code to set the splitter's left pane's Width based on query string argument "splitter_pos".

Thanks
Mikael Lehmann
Posted: Saturday, March 15, 2008 9:16:21 AM
Rank: Member
Groups: Member

Joined: 6/17/2007
Posts: 17
Ok, thanks!


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.