<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: SharePoint 2010 &#8211; The view selector is back!</title>
	<atom:link href="http://spjsblog.com/2011/10/27/sharepoint-2010-the-view-selector-is-back/feed/" rel="self" type="application/rss+xml" />
	<link>http://spjsblog.com/2011/10/27/sharepoint-2010-the-view-selector-is-back/</link>
	<description>JavaScript tricks for SharePoint</description>
	<lastBuildDate>Wed, 22 May 2013 22:15:02 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Francis G</title>
		<link>http://spjsblog.com/2011/10/27/sharepoint-2010-the-view-selector-is-back/#comment-7903</link>
		<dc:creator>Francis G</dc:creator>
		<pubDate>Sun, 24 Mar 2013 14:12:09 +0000</pubDate>
		<guid isPermaLink="false">http://sharepointjavascript.wordpress.com/?p=3402#comment-7903</guid>
		<description><![CDATA[Hi,

Thanks for this code snippet!
Do you have any idea how to support folders? Currently it&#039;s always redirecting to the root folder. I tried to append the rootfolder to the &#039;relUrl&#039; but that doesn&#039;t seem to fix it for folders.

function buildCustomViewMenuSucceeded() {

//Get the rootfolder from the querystring + escape
rtFolder = encodeURIComponent(getParameterByName(&quot;RootFolder&quot;));
alert(rtFolder);
	var viewInfo, currViewObj, viewEnumerator, view;
	viewInfo = [];
	currViewObj = {};
	viewEnumerator = this.customViewCollection.getEnumerator();
	while (viewEnumerator.moveNext()) {
		view = viewEnumerator.get_current();
theRelViewUrlWithParams=view.get_serverRelativeUrl()+&#039;?RootFolder=&#039;+rtFolder;
		viewInfo.push({title:view.get_title(),guid:view.get_id(),relUrl:theRelViewUrlWithParams });
	}
	for(var key in viewInfo){
matchingPathName=unescape(location.pathname)+&#039;?RootFolder=&#039;+rtFolder;

checkbool = matchingPathName == viewInfo[key].relUrl;
		if(checkbool){
			currViewObj = viewInfo[key];
		}		
	}
	buildMenu(currViewObj);
}


Kr,

Francis]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thanks for this code snippet!<br />
Do you have any idea how to support folders? Currently it&#8217;s always redirecting to the root folder. I tried to append the rootfolder to the &#8216;relUrl&#8217; but that doesn&#8217;t seem to fix it for folders.</p>
<p>function buildCustomViewMenuSucceeded() {</p>
<p>//Get the rootfolder from the querystring + escape<br />
rtFolder = encodeURIComponent(getParameterByName(&#8220;RootFolder&#8221;));<br />
alert(rtFolder);<br />
	var viewInfo, currViewObj, viewEnumerator, view;<br />
	viewInfo = [];<br />
	currViewObj = {};<br />
	viewEnumerator = this.customViewCollection.getEnumerator();<br />
	while (viewEnumerator.moveNext()) {<br />
		view = viewEnumerator.get_current();<br />
theRelViewUrlWithParams=view.get_serverRelativeUrl()+&#8217;?RootFolder=&#8217;+rtFolder;<br />
		viewInfo.push({title:view.get_title(),guid:view.get_id(),relUrl:theRelViewUrlWithParams });<br />
	}<br />
	for(var key in viewInfo){<br />
matchingPathName=unescape(location.pathname)+&#8217;?RootFolder=&#8217;+rtFolder;</p>
<p>checkbool = matchingPathName == viewInfo[key].relUrl;<br />
		if(checkbool){<br />
			currViewObj = viewInfo[key];<br />
		}<br />
	}<br />
	buildMenu(currViewObj);<br />
}</p>
<p>Kr,</p>
<p>Francis</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ed</title>
		<link>http://spjsblog.com/2011/10/27/sharepoint-2010-the-view-selector-is-back/#comment-6117</link>
		<dc:creator>Ed</dc:creator>
		<pubDate>Thu, 17 Jan 2013 15:23:37 +0000</pubDate>
		<guid isPermaLink="false">http://sharepointjavascript.wordpress.com/?p=3402#comment-6117</guid>
		<description><![CDATA[THANKS!!!!
You made my day!]]></description>
		<content:encoded><![CDATA[<p>THANKS!!!!<br />
You made my day!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Adams</title>
		<link>http://spjsblog.com/2011/10/27/sharepoint-2010-the-view-selector-is-back/#comment-6116</link>
		<dc:creator>Ben Adams</dc:creator>
		<pubDate>Tue, 21 Aug 2012 14:00:10 +0000</pubDate>
		<guid isPermaLink="false">http://sharepointjavascript.wordpress.com/?p=3402#comment-6116</guid>
		<description><![CDATA[This is awesome - I have literally spent several days searching for a solution and yours was a life-saver!!  It works like a charm.  As a note, I am using a second CEWP with the following HTML to show the ribbon on that page as well as the view:



setTimeout(function() {
    var elem = document.getElementById(&quot;MSOZoneCell_WebPartWPQ2&quot;);
    if(elem != null) {
        var dummyevent = new Array();
        dummyevent[&quot;target&quot;] = elem;
        dummyevent[&quot;srcElement&quot;] = elem;
        WpClick(dummyevent);
    }
}, 2000);]]></description>
		<content:encoded><![CDATA[<p>This is awesome &#8211; I have literally spent several days searching for a solution and yours was a life-saver!!  It works like a charm.  As a note, I am using a second CEWP with the following HTML to show the ribbon on that page as well as the view:</p>
<p>setTimeout(function() {<br />
    var elem = document.getElementById(&#8220;MSOZoneCell_WebPartWPQ2&#8243;);<br />
    if(elem != null) {<br />
        var dummyevent = new Array();<br />
        dummyevent["target"] = elem;<br />
        dummyevent["srcElement"] = elem;<br />
        WpClick(dummyevent);<br />
    }<br />
}, 2000);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laurence</title>
		<link>http://spjsblog.com/2011/10/27/sharepoint-2010-the-view-selector-is-back/#comment-6115</link>
		<dc:creator>Laurence</dc:creator>
		<pubDate>Mon, 06 Aug 2012 16:13:51 +0000</pubDate>
		<guid isPermaLink="false">http://sharepointjavascript.wordpress.com/?p=3402#comment-6115</guid>
		<description><![CDATA[Many thanks Alexander - this works perfectly. I have spent a long time trying to find out how to get the view selector back. This is something that should be standard in SP 2010.]]></description>
		<content:encoded><![CDATA[<p>Many thanks Alexander &#8211; this works perfectly. I have spent a long time trying to find out how to get the view selector back. This is something that should be standard in SP 2010.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander Bautz</title>
		<link>http://spjsblog.com/2011/10/27/sharepoint-2010-the-view-selector-is-back/#comment-6114</link>
		<dc:creator>Alexander Bautz</dc:creator>
		<pubDate>Sat, 30 Jun 2012 08:30:55 +0000</pubDate>
		<guid isPermaLink="false">http://sharepointjavascript.wordpress.com/?p=3402#comment-6114</guid>
		<description><![CDATA[No problem. This file is interpreted it as a web page and not as text, you should right click the file and select &quot;save target as&quot;. 

Alexander ]]></description>
		<content:encoded><![CDATA[<p>No problem. This file is interpreted it as a web page and not as text, you should right click the file and select &#8220;save target as&#8221;. </p>
<p>Alexander </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AW</title>
		<link>http://spjsblog.com/2011/10/27/sharepoint-2010-the-view-selector-is-back/#comment-6113</link>
		<dc:creator>AW</dc:creator>
		<pubDate>Sat, 30 Jun 2012 00:59:28 +0000</pubDate>
		<guid isPermaLink="false">http://sharepointjavascript.wordpress.com/?p=3402#comment-6113</guid>
		<description><![CDATA[The link works. I am just used to seeing the code show up directly from the .txt file, and it&#039;s blank for me now with an object expected error. I just did a &quot;view source&quot; though and saved it as a .js file. So, I&#039;m good to go now. Thanks for sharing!

Sorry for the extra question.

Alan]]></description>
		<content:encoded><![CDATA[<p>The link works. I am just used to seeing the code show up directly from the .txt file, and it&#8217;s blank for me now with an object expected error. I just did a &#8220;view source&#8221; though and saved it as a .js file. So, I&#8217;m good to go now. Thanks for sharing!</p>
<p>Sorry for the extra question.</p>
<p>Alan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander Bautz</title>
		<link>http://spjsblog.com/2011/10/27/sharepoint-2010-the-view-selector-is-back/#comment-6112</link>
		<dc:creator>Alexander Bautz</dc:creator>
		<pubDate>Fri, 29 Jun 2012 21:44:32 +0000</pubDate>
		<guid isPermaLink="false">http://sharepointjavascript.wordpress.com/?p=3402#comment-6112</guid>
		<description><![CDATA[I&#039;m not sure I follow you - does the link not work?

I have tested it and it does for me.

Alexander]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure I follow you &#8211; does the link not work?</p>
<p>I have tested it and it does for me.</p>
<p>Alexander</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AW</title>
		<link>http://spjsblog.com/2011/10/27/sharepoint-2010-the-view-selector-is-back/#comment-6111</link>
		<dc:creator>AW</dc:creator>
		<pubDate>Fri, 29 Jun 2012 21:39:55 +0000</pubDate>
		<guid isPermaLink="false">http://sharepointjavascript.wordpress.com/?p=3402#comment-6111</guid>
		<description><![CDATA[Hi Alex,

I am unable to get to the code. Could you update once again please?

Thanks!]]></description>
		<content:encoded><![CDATA[<p>Hi Alex,</p>
<p>I am unable to get to the code. Could you update once again please?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander Bautz</title>
		<link>http://spjsblog.com/2011/10/27/sharepoint-2010-the-view-selector-is-back/#comment-6110</link>
		<dc:creator>Alexander Bautz</dc:creator>
		<pubDate>Fri, 27 Jan 2012 23:37:28 +0000</pubDate>
		<guid isPermaLink="false">http://sharepointjavascript.wordpress.com/?p=3402#comment-6110</guid>
		<description><![CDATA[Hi,
Have the master page been modified?

Alexander]]></description>
		<content:encoded><![CDATA[<p>Hi,<br />
Have the master page been modified?</p>
<p>Alexander</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://spjsblog.com/2011/10/27/sharepoint-2010-the-view-selector-is-back/#comment-6109</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Wed, 25 Jan 2012 19:13:01 +0000</pubDate>
		<guid isPermaLink="false">http://sharepointjavascript.wordpress.com/?p=3402#comment-6109</guid>
		<description><![CDATA[I get nothing but an error: &quot;document.getElementById(...)&#039; is null or not an object&quot;]]></description>
		<content:encoded><![CDATA[<p>I get nothing but an error: &#8220;document.getElementById(&#8230;)&#8217; is null or not an object&#8221;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
