Stump the Panel: SharePoint Q&A

Immediate solutions for common SharePoint questions
It is currently Tue May 21, 2013 6:20 am

All times are UTC - 5 hours [ DST ]


Forum rules


What you are viewing is an archive of Stump the Panel. It remains for reference purposes. Please post all new questions on NothingButSharePoint.com
https://www.nothingbutsharepoint.com/sites/eusp/Forum



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Preserving Sort/Group options after postback
PostPosted: Fri Apr 15, 2011 11:37 am 
Offline

Joined: Tue Aug 31, 2010 6:53 am
Posts: 36
Hi all

Has anyone found a way to preserve DVWP sort and group selections between page invocations? I have, say, a multiple item list DVWP from whichj i can select individual items for update. On hitting OK or Cancel in the specific item's EditForm, the list view is reloaded from the server and the sort/group selections are lost. This is proving quite annoying to some of our users. I wondered if a solution using JavaScript and maybe cookies would be feasible and was about to go into the code but thought I'd see if someone's been there already?

Many thanks
Tim


Top
 Profile  
 
 Post subject: Re: Preserving Sort/Group options after postback
PostPosted: Tue May 03, 2011 9:16 am 
Offline

Joined: Tue Aug 31, 2010 6:53 am
Posts: 36
Well, I'm not sure if I stumped the panel or not but I have found a solution to this one.

Basically I have added an event handler (change) to the Sort and Group controls (after giving them an id in the xsl code) that saves the selected values in two cookies. On document ready I have code that interrogates these cookies and, if set, reinstates the selections into the Sort/Group select boxes then triggers a change event on them so that a server postback is triggered and the page re-renders with whatever selections had previously been made.

It's not totally elegant as you see the page load then immediately reload (if selections had been previously made) but it's a lot better than nothing. I imagine a more elegant solution would require some server-side scripting to apply the settings on the first rendering of the page?

If anyone has a neater solution, I'd love to hear of it.

Tim.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group