<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Jan Tielens' Bloggings</title><link>http://weblogs.asp.net/jan/default.aspx</link><description>Joy, frustration, excitement, madness, aha's, headaches, ... codito ergo sum!</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>SharePoint Connections 2010 &amp; SharePINT with Belgian Beer in Amsterdam</title><link>http://weblogs.asp.net/jan/archive/2010/01/14/sharepoint-connections-2010-amp-sharepint-with-belgian-beer-in-amsterdam.aspx</link><pubDate>Thu, 14 Jan 2010 06:44:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7310338</guid><dc:creator>Jan Tielens</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7310338</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2010/01/14/sharepoint-connections-2010-amp-sharepint-with-belgian-beer-in-amsterdam.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;Next week (18th and 19th of January, 2010) the &lt;A href="http://www.devconnections.com/speurope/" mce_href="http://www.devconnections.com/speurope/"&gt;Microsoft SharePoint Connections 2010&lt;/A&gt; will be held in Amsterdam RAI (The Netherlands). There is a great lineup of &lt;A href="http://www.devconnections.com/shows/NED2010SP/default.asp?c=2&amp;amp;s=149" mce_href="http://www.devconnections.com/shows/NED2010SP/default.asp?c=2&amp;amp;s=149"&gt;speakers&lt;/A&gt; and &lt;A href="http://www.devconnections.com/shows/NED2010SP/default.asp?c=1&amp;amp;s=149" mce_href="http://www.devconnections.com/shows/NED2010SP/default.asp?c=1&amp;amp;s=149"&gt;sessions&lt;/A&gt; over there, so I'm sure it will be a very interesting event! I will be presenting three sessions, one on Monday and two on Tuesday:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Client-Side Technologies in SharePoint 2010&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Silverlight and SharePoint 2010: Better Together&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Advanced Web Part Development in SharePoint 2010&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;I'm also very proud to mention that &lt;A href="http://www.u2u.be/" mce_href="http://www.u2u.be"&gt;&lt;STRONG&gt;U2U&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt; will be sponsering the SharePINT community event on Monday evening. &lt;/STRONG&gt;As a Belgian company we are of course buying you guys some real Belgian beer (Leffe)! So make sure to visit the expo area of the conference after the last session on Monday and feel free to say hi. :-)&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7310338" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>May I introduce you to Lis Tielens</title><link>http://weblogs.asp.net/jan/archive/2009/12/22/may-i-introduce-you-to-lis-tielens.aspx</link><pubDate>Tue, 22 Dec 2009 21:33:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7288512</guid><dc:creator>Jan Tielens</dc:creator><slash:comments>19</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7288512</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2009/12/22/may-i-introduce-you-to-lis-tielens.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;I'm very happy to announce that this morning our daugher Lis was born. She and her mother are recovering from the C-section but they are doing well. For more news (in Dutch), feel free to check out&amp;nbsp;our family blog: &lt;A href="http://kids.neleenjan.net/"&gt;http://kids.neleenjan.net&lt;/A&gt;.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG style="WIDTH: 500px; HEIGHT: 410px" src="http://farm5.static.flickr.com/4028/4206072145_438008cc3b.jpg" width=500 height=410 mce_src="http://farm5.static.flickr.com/4028/4206072145_438008cc3b.jpg"&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7288512" width="1" height="1"&gt;</description></item><item><title>Free BIWUG Event on SharePoint 2010 Development</title><link>http://weblogs.asp.net/jan/archive/2009/12/10/free-biwug-event-on-sharepoint-2010-development.aspx</link><pubDate>Thu, 10 Dec 2009 14:53:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7275501</guid><dc:creator>Jan Tielens</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7275501</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2009/12/10/free-biwug-event-on-sharepoint-2010-development.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;Next week (December, 17th) the Belgian Information Worker User Group (BIWUG, &lt;A href="http://www.biwug.be/"&gt;http://www.biwug.be&lt;/A&gt;) is organizing an evening full of SharePoint 2010 development topics. I'm talking about the Client Object Models at 19:30, but make sure to check out the full agenda:&lt;/P&gt;
&lt;LI&gt;18:00 - 18:30: Welcome 
&lt;LI&gt;18:30 - 19:00: Introduction to SharePoint Server 2010 (&lt;A href="http://karinebosch.wordpress.com/" target=_blank&gt;&lt;U&gt;&lt;FONT color=#6699cc&gt;Karine Bosch&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt; – SharePoint MVP) 
&lt;LI&gt;19:00 - 19:30: LINQ to SharePoint (&lt;A href="http://blog.developpez.com/eyskens/" target=_blank&gt;&lt;U&gt;&lt;FONT color=#6699cc&gt;Stephane Eyskens&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt; – SharePoint MVP) 
&lt;LI&gt;19:30 - 20:00: Client Object Model (&lt;A href="http://weblogs.asp.net/jan/" target=_blank&gt;&lt;U&gt;&lt;FONT color=#6699cc&gt;Jan Tielens&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt; – SharePoint MVP) 
&lt;LI&gt;20:00 - 20:15: Break 
&lt;LI&gt;20:15 - 20:45: Business Connectivity Services (Frank Cleynen) 
&lt;LI&gt;20:45 - 21:15: Workflow (Peter Plessers) &lt;/LI&gt;
&lt;P&gt;The meeting is hosted by Ordina at their offices in Mechelen. More details and free registration can be found on the &lt;A href="http://www.biwug.be/" mce_href="http://www.biwug.be/"&gt;BIWUG site&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7275501" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>SharePoint 2010 Project Deployment Issues in Visual Studio 2010</title><link>http://weblogs.asp.net/jan/archive/2009/11/27/sharepoint-2010-project-deployment-issues-in-visual-studio-2010.aspx</link><pubDate>Fri, 27 Nov 2009 05:25:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7265770</guid><dc:creator>Jan Tielens</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7265770</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2009/11/27/sharepoint-2010-project-deployment-issues-in-visual-studio-2010.aspx#comments</comments><description>&lt;p&gt;Recently I ran into the following issue when I tried to deploy a SharePoint 2010 Project in Visual Studio 2010 Beta 2. In the output window the following message was displayed and the deployment failed:&lt;/p&gt;&lt;p&gt;&lt;b&gt;Error occurred in deployment step ‘Retract Solution’: The local SharePoint server is not accessible. Check that the server is running and connected to the SharePoint farm.&lt;/b&gt;&lt;br&gt;&lt;br&gt;It turned out (thank you Event Viewer!) that the account that triggers the Deploy action in Visual Studio 2010 (typically the account you used to login in Windows) needs to have permissions in both the &lt;b&gt;Configuration &lt;/b&gt;database and the &lt;b&gt;Content &lt;/b&gt;database.&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7265770" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>SharePoint 2010 Public Beta Available on MSDN</title><link>http://weblogs.asp.net/jan/archive/2009/11/16/sharepoint-2010-public-beta-available-on-msdn.aspx</link><pubDate>Mon, 16 Nov 2009 17:29:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7256843</guid><dc:creator>Jan Tielens</dc:creator><slash:comments>15</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7256843</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2009/11/16/sharepoint-2010-public-beta-available-on-msdn.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;Finally the public betas of SharePoint 2010 (both SharePoint Foundation and SharePoint Server),&amp;nbsp;Office 2010,&amp;nbsp;SharePoint Designer 2010 and&amp;nbsp;Visio 2010&amp;nbsp;are available on &lt;A href="https://msdn.microsoft.com/en-us/subscriptions/securedownloads/default.aspx" mce_href="https://msdn.microsoft.com/en-us/subscriptions/securedownloads/default.aspx"&gt;MSDN Subscriptions&lt;/A&gt;, so start your download engines right now! :-)&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://storage.tielens.name/sp2010betaonmsdn.jpg" mce_src="http://storage.tielens.name/sp2010betaonmsdn.jpg"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;If you don't see the download, you can use &lt;A href="https://msdn.microsoft.com/en-us/subscriptions/securedownloads/default.aspx?PV=42%3a393%3aEXE%3aen%3ax64" mce_href="https://msdn.microsoft.com/en-us/subscriptions/securedownloads/default.aspx?PV=42%3a393%3aEXE%3aen%3ax64"&gt;this direct link&lt;/A&gt; (make sure you are signed in to the Download Center before you click the link).&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7256843" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>Introducing SharePoint 2010 Training at U2U</title><link>http://weblogs.asp.net/jan/archive/2009/11/06/introducing-sharepoint-2010-training-at-u2u.aspx</link><pubDate>Fri, 06 Nov 2009 06:12:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7248178</guid><dc:creator>Jan Tielens</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7248178</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2009/11/06/introducing-sharepoint-2010-training-at-u2u.aspx#comments</comments><description>&lt;P&gt;During the last couple of weeks, we at &lt;A href="http://www.u2u.be/" mce_href="http://www.u2u.be"&gt;U2U&lt;/A&gt; have been very busy building course material for our upcoming SharePoint 2010 courses. We expect that lots of experienced SharePoint developers, power users and administrators are very eager to get up to speed with the new version of SharePoint as soon as possible. That’s why the first course that we’ve build is titled &lt;STRONG&gt;&lt;A href="http://www.u2u.be/CoursePage.aspx?CODE=USP10U" target=_blank mce_href="http://www.u2u.be/CoursePage.aspx?CODE=USP10U"&gt;Upgrade to SharePoint 2010&lt;/A&gt;&lt;/STRONG&gt;. This course will focus on all the exciting new stuff in SharePoint 2010, so people with SharePoint experience will get all the relevant info as quickly as possible. Because an administrator is probably not interested in developer stuff, we’ve chosen to split the course into three different parts:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Part 1: Tools and Technologies (2 days)&lt;BR&gt;&lt;/STRONG&gt;The focus of the first part of this course is on everything what’s new in SharePoint 2010 from a power user perspective. That means: everything you can configure in SharePoint 2010 without writing custom code. We’ll start with an overview of the new SharePoint 2010 platform, after that all the important new features will be discussed separately. Although this part will not involve building code customizations, it’s important for technical people (developers, architects, IT-Pro’s …) as well to know about these important new and enhanced features.&lt;BR&gt;&lt;STRONG&gt;Part 2: The Development Platform (2 days)&lt;/STRONG&gt;&lt;BR&gt;SharePoint 2007 already was a very extensible platform: as a developer you could enhance and extend the out-of-the-box functionality using some powerful techniques. Unfortunately developing for SharePoint 2007 often required to developer to spend lots of time writing XML, using command line utilities,… This part of the course will focus on the new development tools in Visual Studio 2010 which will make the life of SharePoint developers a lot easier, and the new developer opportunities in SharePoint 2010.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Part 3: Administration and Configuration (1 day)&lt;BR&gt;&lt;/STRONG&gt;Also for IT-Pro’s and System Administrators SharePoint 2010 has lots of new functionality. In this final part of the course, we’ll focus on how SharePoint 2010 can make the life of administrators significant easier.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;If you are a &lt;STRONG&gt;developer or architect &lt;/STRONG&gt;I’d recommend you to follow all three parts of the course (yes even the administration and configuration part). If you are a &lt;STRONG&gt;power user, end user, manager or business decision maker &lt;/STRONG&gt;(thus not a very technical person), I’d recommend you to attend the first part of our course. Finally if you are an &lt;STRONG&gt;IT-Pro or system administration&lt;/STRONG&gt;, part 1 and 3 are relevant for you. You can read &lt;A href="http://www.u2u.be/CoursePage.aspx?CODE=USP10U" mce_href="http://www.u2u.be/CoursePage.aspx?CODE=USP10U"&gt;the full course description at the U2U site&lt;/A&gt;, and check out the schedule (the course is already scheduled in Brussels, Belgium in December and January, but we can deliver &lt;A href="http://www.u2u.be/Onsite.aspx" mce_href="http://www.u2u.be/Onsite.aspx"&gt;on-site courses as well&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;In the near future U2U will expand its SharePoint 2010 training offerings to facilitate the needs of everybody who wants to get in the SharePoint 2010 game, even if you don’t have experience with the previous versions of SharePoint. So make sure you visit the &lt;A href="http://www.u2u.be/" mce_href="http://www.u2u.be"&gt;U2U site&lt;/A&gt; once in a while to see if there is anything new. Alternatively you can subscribe to our newsletter over there, or you can follow us on Twitter as well (&lt;A href="http://twitter.com/u2u" mce_href="http://twitter.com/u2u"&gt;@u2u&lt;/A&gt;) or visit &lt;A href="http://www.facebook.com/home.php#/pages/U2U/158147774827" mce_href="http://www.facebook.com/home.php#/pages/U2U/158147774827"&gt;our Facebook page&lt;/A&gt;&amp;nbsp;(and become a fan!).&lt;/P&gt;
&lt;P&gt;People that are attending &lt;A href="http://www.microsoft.com/europe/teched/" mce_href="http://www.microsoft.com/europe/teched/"&gt;TechEd Europe in Berlin next week&lt;/A&gt;, make sure to visit the U2U booth to check out our new course material, and to receive &lt;STRONG&gt;a free SharePoint 2010 t-shirt&lt;/STRONG&gt; (just mention that Jan sent you :-) ). If you have any questions and I’m not at the booth, feel free to ask for me. Or you can attend my &lt;A href="http://weblogs.asp.net/jan/archive/2009/11/04/join-my-bof-session-at-teched-europe-about-sharepoint-jquery-and-silverlight.aspx" mce_href="http://weblogs.asp.net/jan/archive/2009/11/04/join-my-bof-session-at-teched-europe-about-sharepoint-jquery-and-silverlight.aspx"&gt;BoF Session about SharePoint, Silverlight and jQuery&lt;/A&gt; on Thursday.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7248178" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>Join my BoF Session at TechEd Europe about SharePoint, jQuery and Silverlight</title><link>http://weblogs.asp.net/jan/archive/2009/11/04/join-my-bof-session-at-teched-europe-about-sharepoint-jquery-and-silverlight.aspx</link><pubDate>Wed, 04 Nov 2009 15:21:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7246992</guid><dc:creator>Jan Tielens</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7246992</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2009/11/04/join-my-bof-session-at-teched-europe-about-sharepoint-jquery-and-silverlight.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;I’ve got the pleasure to be able to present a &lt;A href="http://www.msteched.com/europe/Public/networking.aspx" mce_href="http://www.msteched.com/europe/Public/networking.aspx"&gt;Birds-of-a-Feather&lt;/A&gt; (BoF) session at &lt;A href="http://www.microsoft.com/europe/teched/" mce_href="http://www.microsoft.com/europe/teched/"&gt;TechEd Europe next week&lt;/A&gt;: &lt;STRONG&gt;BOF14 Microsoft SharePoint, jQuery and Microsoft Silverlight: Better Together&lt;/STRONG&gt;. If you are interested in these technologies please join the discussion on Thursday, 12:20 in Theater 6 – Pink.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Feel free to comment if you are planning to attend, it’s nice to know who’ll be there! :-)&lt;/P&gt;
&lt;P align=center mce_keep="true"&gt;&lt;IMG style="WIDTH: 180px; HEIGHT: 199px" align=middle src="http://www.msteched.com/resources/Content_Files/TechEd_Europe_Blog_LP_Speak.gif" width=180 height=199 mce_src="http://www.msteched.com/resources/Content_Files/TechEd_Europe_Blog_LP_Speak.gif"&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7246992" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>Watch the SharePoint Conference Live, from your home/office (9am Pacific, 6pm CET)</title><link>http://weblogs.asp.net/jan/archive/2009/10/19/watch-the-sharepoint-conference-live-from-your-home-office-9am-pacific-6pm-cet.aspx</link><pubDate>Mon, 19 Oct 2009 15:30:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7233046</guid><dc:creator>Jan Tielens</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7233046</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2009/10/19/watch-the-sharepoint-conference-live-from-your-home-office-9am-pacific-6pm-cet.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;In 20 minutes a very important event is going to get started: the &lt;A href="http://www.mssharepointconference.com/Pages/default.aspx" mce_href="http://www.mssharepointconference.com/Pages/default.aspx"&gt;SharePoint Conference 2009&lt;/A&gt;! If you're not in Vegas (like me), get yourself in front of a computer with a big bag of chips, popcorn or whatever snack you prefer, and watch the keynote (featuring Steve Ballmer) live! I'm sure it will be a nice show and expect an avalanche of SharePoint 2010 information to be released shortly afterwards. Also make sure you keep an eye on Twitter, blogs, Facebook etc. to see the reactions of SharePoint fans all over the world. My buddies at EndUserSharePoint are going to cover the conference with lots of real time content, so &lt;A href="http://bit.ly/2Qy21l" target=_blank mce_href="http://bit.ly/2Qy21l"&gt;these pages&lt;/A&gt; will be open on my pc as well. Have fun!&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7233046" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>Assembly-Free jQuery in SharePoint Sites Using the SmartTools jQueryLoader</title><link>http://weblogs.asp.net/jan/archive/2009/10/14/assembly-free-jquery-in-sharepoint-sites-using-the-smarttools-jqueryloader.aspx</link><pubDate>Wed, 14 Oct 2009 18:48:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7229701</guid><dc:creator>Jan Tielens</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7229701</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2009/10/14/assembly-free-jquery-in-sharepoint-sites-using-the-smarttools-jqueryloader.aspx#comments</comments><description>&lt;P&gt;&lt;I&gt;&lt;B&gt;Summary: &lt;/B&gt;The SmartTools jQueryLoader enables the jQuery Javascript library in your SharePoint sites using an effortless and Assembly-Free deployment technique. Additionally the jQueryLoader will dynamically load custom Javascript files, deployed to a Document Library. Seeing is believing: watch this short screencast that shows the deployment and some sample scripts! &lt;/I&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://jqueryloader.codeplex.com/Release/ProjectReleases.aspx" mce_href="http://jqueryloader.codeplex.com/Release/ProjectReleases.aspx"&gt;Download the SmartTools jQueryLoader Installer&lt;/A&gt; from &lt;A href="http://jqueryloader.codeplex.com/" mce_href="http://jqueryloader.codeplex.com/"&gt;the Codeplex project&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.youtube.com/watch?v=8DQrNpnSeXs" mce_href="http://www.youtube.com/watch?v=8DQrNpnSeXs"&gt;Watch the short (8 minutes) screencast&lt;/A&gt; that shows the deployment and some sample scripts.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;If you read my blog you probably know that using the &lt;A href="http://jquery.com/" mce_href="http://jquery.com"&gt;jQuery Javascript library&lt;/A&gt; in SharePoint 2007 sites can enhance and extend the out-of-the-box user interface significantly. But up to now it was time consuming and a tedious job to enable jQuery in SharePoint sites, for example: adding a &lt;B&gt;Content Editor Web Part&lt;/B&gt; to the page, open the properties, copy/paste a script using the Source dialog etc. Even worse: these steps needed to be done on every page where the desired jQuery functionality should become active.&lt;/P&gt;
&lt;P&gt;These issues can be solved by using the new &lt;B&gt;SmartTools jQueryLoader&lt;/B&gt; that I’m releasing today! The SmartTools jQueryloader basically is a Javascript file that dynamically loads additional custom Javascript files stored in a predefined &lt;B&gt;Document Library. &lt;/B&gt;This Document Library has extra columns to specify when and in what order those Javascript files should be loaded. So making available a new &lt;B&gt;js&lt;/B&gt; file (containing your next amazing extension) in your SharePoint sites will be as easy as uploading that file to the Document Library. The jQueryLoader will take care of loading your script accordingly.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://storage.tielens.name/jqueryloader1.jpg" mce_src="http://storage.tielens.name/jqueryloader1.jpg"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The jQueryLoader script itself, and the jQuery library as well, need to be loaded of course in every page in your SharePoint sites. This is accomplished by making a small change to the &lt;B&gt;Master Page &lt;/B&gt;that’s in use in your SharePoint sites. All these configuration steps, including the creation of the Document Library, changing the Master Page, adding the jQueryLoader etc, are executed with an &lt;B&gt;automated installation page. &lt;/B&gt;The really cool thing about this installation page is that it’s a basic SharePoint &lt;B&gt;Site Page &lt;/B&gt;that &lt;B&gt;doesn’t contain any server side code; everything is accomplished using Javascript.&lt;/B&gt; That means that to make use of the jQueryLoader (and its installer), there is nothing that needs to be changed, configured or deployed on your servers! That’s what is called &lt;B&gt;Assembly-Free &lt;/B&gt;by the way.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://storage.tielens.name/jqueryloader2.jpg" mce_src="http://storage.tielens.name/jqueryloader2.jpg"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an overview of the installation steps:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Navigate to &lt;B&gt;any Document Library&lt;/B&gt; in a SharePoint site.&lt;/LI&gt;
&lt;LI&gt;Upload the &lt;B&gt;SmartToosls.jQueryLoader.Install.aspx&lt;/B&gt; file to that Document Library (this file can be deleted after the installation).&lt;/LI&gt;
&lt;LI&gt;Open the uploaded page by just clicking on it.&lt;/LI&gt;
&lt;LI&gt;Select the desired installation options by checking their checkboxes in the list. For a first-time installation you typically check at least the first four checkboxes (see below).&lt;/LI&gt;
&lt;LI&gt;Click the &lt;B&gt;Start Installation &lt;/B&gt;button and keep an eye on the &lt;B&gt;Installation Log &lt;/B&gt;at the bottom of the page.&lt;/LI&gt;
&lt;LI&gt;That’s it!&lt;/LI&gt;&lt;/OL&gt;The different installation options which can be selected are:&lt;BR&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;Create js Document Library&lt;/B&gt;: will create a hidden Document Library called &lt;B&gt;js&lt;/B&gt;. This Document Library will have four custom columns:&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;Autoload &lt;/B&gt;(true/false): to specify if the jQueryLoader should dynamically load the file&lt;/LI&gt;
&lt;LI&gt;&lt;B&gt;Sequence &lt;/B&gt;(number): to specify the order in which the files are loaded&lt;/LI&gt;
&lt;LI&gt;&lt;B&gt;ApplyTo&lt;/B&gt; (text): a regular expression to specify on which pages the file should be loaded&lt;/LI&gt;
&lt;LI&gt;&lt;B&gt;Group&lt;/B&gt; (text): an optional value to group different files together&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;&lt;B&gt;Create or update jquery.js&lt;/B&gt;: will upload the jQuery library to the js Document Library.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;B&gt;Create or update smarttools.jqueryloader.js&lt;/B&gt;: will upload the jQueryLoader script to the js Document Library.&lt;/LI&gt;
&lt;LI&gt;&lt;B&gt;Update the default.master&lt;/B&gt;: will make a change to the default.master Master Page (or the one you select by changing the value in the textbox). This change adds three script tags in the head element of the HTML page.&lt;/LI&gt;
&lt;LI&gt;&lt;B&gt;Update the default.master of a child site&lt;/B&gt;: (optional) will make a change to the Master Page of a child site (see previous option). Notice that this child site will make use of js Document Library of the current site.&lt;/LI&gt;
&lt;LI&gt;&lt;B&gt;Add test Web Part (optional)&lt;/B&gt;: will add a test Web Part to the default.aspx (Home) page of the site to verify if jQuery is active.&lt;/LI&gt;
&lt;LI&gt;&lt;B&gt;Enhanced Tasks View, Task Notifications and AJAX Lists&lt;/B&gt; (all optional): will add various sample scripts to show of the power of jQuery in SharePoint see the demo screencast for more information.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The optional sample scripts are just there to give you an idea what can be accomplished using jQuery in SharePoint sites, and to show you how easy it is to deploy them. The real added value is of course your creativity to build custom scripts making SharePoint even better. Feel free to contact me when you’ve got a cool sample as well!&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://storage.tielens.name/jqueryloader3.jpg" mce_src="http://storage.tielens.name/jqueryloader3.jpg"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7229701" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>"The Office SharePoint Server Standard Web application features feature must be activated" on Windows Server 2008 R2</title><link>http://weblogs.asp.net/jan/archive/2009/10/14/quot-the-office-sharepoint-server-standard-web-application-features-feature-must-be-activated-quot-on-windows-server-2008-r2.aspx</link><pubDate>Wed, 14 Oct 2009 04:45:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7229497</guid><dc:creator>Jan Tielens</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7229497</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2009/10/14/quot-the-office-sharepoint-server-standard-web-application-features-feature-must-be-activated-quot-on-windows-server-2008-r2.aspx#comments</comments><description>
&lt;p&gt;When I was installing a brand new demo environment using Microsoft's latest and greatest platforms (Windows Server 2008 R2 and SQL Server 2008) I ran into an annoying issue related to SharePoint. The slipstreamed installation (including SP2) went fine, but when I tried to create a new Collaboration Portal or Publishing Portal I got the error: "&lt;b&gt;The Office SharePoint Server Standard Web application features feature must be activated at the web application level before this feature can be activated.&lt;/b&gt;".&lt;/p&gt;
&lt;p&gt;After some searching I learned that MOSS SP2 was not correctly applied, re-installing MOSS SP2 solved the issue. Apparently this is a known issue which can be avoided by adding the Web Server Role before running the slipstreamed SharePoint installation.&lt;/p&gt;
&lt;p&gt;Related posts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/8b96663a-ed87-4ab4-bd59-33c7245a76d4" mce_href="http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/8b96663a-ed87-4ab4-bd59-33c7245a76d4"&gt;Error trying to activate Publishing Infrastructure&lt;/a&gt; (on Technet)&lt;a href="http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/8b96663a-ed87-4ab4-bd59-33c7245a76d4" mce_href="http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/8b96663a-ed87-4ab4-bd59-33c7245a76d4"&gt;&lt;br&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://oidatsmyleg.wordpress.com/2009/09/21/add-web-server-role-before-installing-sharepoint/" mce_href="http://oidatsmyleg.wordpress.com/2009/09/21/add-web-server-role-before-installing-sharepoint/"&gt;Add Web Server role before installing SharePoint&lt;/a&gt; (blog post)&lt;br&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;script src="http://sharepointads.com/members/scripts/banner.php?a_aid=jant&amp;amp;a_bid=47c2b53b" type="text/javascript"&gt;&lt;/script&gt;
&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7229497" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>Make SharePoint 2007 Act Like SharePoint 2010, Updated</title><link>http://weblogs.asp.net/jan/archive/2009/09/30/make-sharepoint-2007-act-like-sharepoint-2010-updated.aspx</link><pubDate>Wed, 30 Sep 2009 19:22:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7220395</guid><dc:creator>Jan Tielens</dc:creator><slash:comments>12</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7220395</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2009/09/30/make-sharepoint-2007-act-like-sharepoint-2010-updated.aspx#comments</comments><description>&lt;P&gt;In &lt;A href="http://weblogs.asp.net/jan/archive/2009/09/11/make-sharepoint-2007-act-like-sharepoint-2010-sort-of.aspx" mce_href="http://weblogs.asp.net/jan/archive/2009/09/11/make-sharepoint-2007-act-like-sharepoint-2010-sort-of.aspx"&gt;my previous post&lt;/A&gt; I introduced a small script to extend the Edit Control Block (ECB) of list items and documents. The added menu items in the ECB allow users to update certain metadata fields for that item or document. The cool thing is that everything is happening in the background with the help of &lt;A href="http://jquery.com/" mce_href="http://jquery.com"&gt;jQuery&lt;/A&gt;, even the actual updating of the data. The result: no postbacks or full page loads, pure AJAX goodness just like showcased in the SharePoint 2010 &lt;A href="http://sharepoint.microsoft.com/2010/Sneak_Peek/Pages/Overview-Video.aspx" mce_href="http://sharepoint.microsoft.com/2010/Sneak_Peek/Pages/Overview-Video.aspx"&gt;sneak peek videos&lt;/A&gt;. Today I’m releasing a new and improved version of the script, based on your feedback. Here are the changes:&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;FONT size=3&gt;Column names can have a display name and an internal name&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;In the previous version of the script you’d had to specify the names of the columns you’d like to ajaxify based on the &lt;B&gt;internal name &lt;/B&gt;(which escapes spaces etc). In the new version of the script you can specify the &lt;B&gt;display name &lt;/B&gt;as well. For example this is a possible configuration for a &lt;B&gt;Task &lt;/B&gt;list:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;columns: ["Status", "Priority", "% Complete#PercentComplete", "Description#Body"]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;For the &lt;B&gt;Status &lt;/B&gt;and &lt;B&gt;Priority&lt;/B&gt; columns, no internal names are specified since they are the same as the display names. But notice that the next two columns have a # sign in them. The part preceding the # sign is the display name, the part after the # sign is the internal name from SharePoint.&lt;BR&gt;&lt;BR&gt;&lt;B&gt;&lt;FONT size=3&gt;Column values can have a display name and an internal name. &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;This works exactly as the column names, so if there is a # sign, the first part will be the display value, the second part will be the internal value. For example this is the array of values for the % Complete column of a task list:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;["100%#1.00000000000000", "75%#0.750000000000000", "50%#0.500000000000000", "25%#0.250000000000000", "0%#0"]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Internally percentages are stored as values between 0 and 1. But we’d like show them as real percentages to the user of course: e.g. 100% will be displayed, while 1.00000000000 will be stored in SharePoint.&lt;BR&gt;&lt;BR&gt;&lt;B&gt;&lt;FONT size=3&gt;Multiple lists and document libraries can be configured in the same script. &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Now you can also use the script if there is more than one list view web part on a page: in the &lt;B&gt;lists &lt;/B&gt;option of the &lt;B&gt;ajaxListConfig &lt;/B&gt;variable, multiple lists can be defined based on their name.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;var ajaxListConfig = {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lists: &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp; name: "Tasks",&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; columns: [ ... ], &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; values: [ ... ] },&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp; name: "Issues",&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; columns: [ ... ], &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; values: [ ... ] },&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ],&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; debug: 0, // set to 1 to see log messages&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; animationSpeed: "fast" // possible values: "slow", "normal", "fast" or a number (milliseconds)&lt;BR&gt;};&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;FONT size=3&gt;User entered values are now supported. &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;In the previous version, the user could only use the predefined values for a column (which makes lots of sense for Choice columns). In the new version, if the values option of a list configuration is equal to null (instead of an array of values), dialog is displayed in which the user can fill out a new value. For example in the &lt;B&gt;Task &lt;/B&gt;list below, the &lt;B&gt;Update Description &lt;/B&gt;menu item is displayed, but there is submenu to display the possible values.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://storage.tielens.name/ajaxlistsv2_1.jpg" width=265 height=326 mce_src="http://storage.tielens.name/ajaxlistsv2_1.jpg"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the user clicks on the Update Description menu item, a dialog is displayed to allow the user to modify the value. Once again there are no postbacks. To display the dialog I’m using the &lt;A href="http://www.trentrichardson.com/Impromptu/index.php" mce_href="http://www.trentrichardson.com/Impromptu/index.php"&gt;Imprompty jQuery extension&lt;/A&gt; (included in my script). Notice that there is no Rich Text editing (yet), so HTML tags will be stripped out. Also there is no support for editing Person fields etc.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://storage.tielens.name/ajaxlistsv2_2.jpg" mce_src="http://storage.tielens.name/ajaxlistsv2_2.jpg"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;FONT size=3&gt;Finally ...&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;... some small bug fixes and performance enhancements are done. To use the script, configure it to your needs (when you download it, it’s configured for a default Task and Issue list), then follow these steps:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Navigate to the page where you would like to use it (e.g. http://yoursite//Lists/Tasks/AllItems.aspx for the Task list).&lt;/LI&gt;
&lt;LI&gt;Click Site Actions, Edit Page (top right).&lt;/LI&gt;
&lt;LI&gt;Click Add a Web Part.&lt;/LI&gt;
&lt;LI&gt;Select the Content Editor Web Part in the Miscellaneous section and click Add.&lt;/LI&gt;
&lt;LI&gt;Optionally drag the Content Editor Web Part to the bottom of the screen (otherwise a small space will be displayed on top of the page).&lt;/LI&gt;
&lt;LI&gt;Click open the tool pane in the web part.&lt;/LI&gt;
&lt;LI&gt;Click Source Editor ... in the properties task pane.&lt;/LI&gt;
&lt;LI&gt;Copy and paste the modified script in the Text Entry dialog and click Save.&lt;/LI&gt;
&lt;LI&gt;Click Exit Edit Mode (top right) and verify the result.&lt;/LI&gt;&lt;/OL&gt;You can &lt;A href="http://bit.ly/ODtNS" mce_href="http://bit.ly/ODtNS"&gt;download the script over here&lt;/A&gt;. Let me know if you have any issues and/or any feature requests!&lt;BR&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7220395" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>Make SharePoint 2007 Act Like SharePoint 2010 (sort of ...)</title><link>http://weblogs.asp.net/jan/archive/2009/09/11/make-sharepoint-2007-act-like-sharepoint-2010-sort-of.aspx</link><pubDate>Fri, 11 Sep 2009 17:19:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7201155</guid><dc:creator>Jan Tielens</dc:creator><slash:comments>19</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7201155</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2009/09/11/make-sharepoint-2007-act-like-sharepoint-2010-sort-of.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;A href="http://weblogs.asp.net/jan/archive/2009/09/30/make-sharepoint-2007-act-like-sharepoint-2010-updated.aspx" mce_href="http://weblogs.asp.net/jan/archive/2009/09/30/make-sharepoint-2007-act-like-sharepoint-2010-updated.aspx"&gt;&lt;STRONG&gt;This script has been updated over here&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt;]&lt;/STRONG&gt; I'm pretty sure every SharePoint enthusiast has seen those great &lt;A href="http://sharepoint.microsoft.com/2010/Sneak_Peek/Pages/default.aspx" mce_href="http://sharepoint.microsoft.com/2010/Sneak_Peek/Pages/default.aspx"&gt;Sneak Peek videos&lt;/A&gt; Microsoft released some time ago. And I'm sure that lots of the new features shown were very exciting for lots of you. Since SharePoint 2010 is still quite far away in the future, let's try to bring some of the 2010 stuff to SharePoint 2007! In the &lt;A href="http://sharepoint.microsoft.com/2010/Sneak_Peek/Pages/Overview-Video.aspx" mce_href="http://sharepoint.microsoft.com/2010/Sneak_Peek/Pages/Overview-Video.aspx"&gt;overview video&lt;/A&gt;, &lt;A href="http://blogs.msdn.com/thomriz" mce_href="http://blogs.msdn.com/thomriz"&gt;Tom Rizzo&lt;/A&gt; showed some new user interface functionality, pretty much all of it was heavily using asynchronous Javascript code to dynamically do updates, change layouts etc. All of this of course to prevent those nasty full page reloads. One of the features that caught my eye was the inline editing of list items or documents: without reloading the page, or opening a new page, it's possible in SharePoint 2010 to edit meta data. Pretty cool! And I want to have it in my SharePoint sites, today.&lt;/P&gt;
&lt;P mce_keep="true"&gt;In &lt;A href="http://weblogs.asp.net/jan/archive/2009/09/11/customizing-the-sharepoint-ecb-with-javascript-part-3.aspx" mce_href="http://weblogs.asp.net/jan/archive/2009/09/11/customizing-the-sharepoint-ecb-with-javascript-part-3.aspx"&gt;my previous post&lt;/A&gt; I showed how you can add extra functionality to the Edit Control Block (ECB), let's take that technique and make it more flexible and customizable. Here is the result I'm looking for:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://storage.tielens.name/SharePoint2007as2010.gif" mce_src="http://storage.tielens.name/SharePoint2007as2010.gif"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Notice that everything you see is happening completely at the client side, without any code deployed to the server, without any full page postbacks. So how do you get this working in your SharePoint sites? Just download&amp;nbsp;&lt;A href="http://bit.ly/2BUSKh" mce_href="http://bit.ly/2BUSKh"&gt;this script file&lt;/A&gt; [&lt;A href="about:/jan/archive/2009/09/30/make-sharepoint-2007-act-like-sharepoint-2010-updated.aspx" mce_href="http://weblogs.asp.net/jan/archive/2009/09/30/make-sharepoint-2007-act-like-sharepoint-2010-updated.aspx"&gt;This script has been updated over here&lt;/A&gt;] and open it. On top of the script you'll find the &lt;STRONG&gt;ajaxListConfig&lt;/STRONG&gt; variable which you can change to customize the script:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;FONT face="courier new,courier"&gt;var ajaxListConfig = {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; columns&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :new Array("Status", "Priority"), // columns to ajaxify&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :new Array(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new Array("Not Started", "In Progress", "Completed", &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Deferred", "Waiting on someone else"), // values for Status&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new Array("(1) High", "(2) Normal", "(3) Low") // values for Priority&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; debug&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :0, // set to 1 to see log messages&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; animationSpeed&amp;nbsp; :"slow" // possible values: "slow", "normal", "fast" or a number (milliseconds)&lt;BR&gt;};&lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;When you download the script, it's configured for a default Task list. If you want to enable it on other list types or Document Libraries, or you're running SharePoint in another language than English the following options need to be changed:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;&lt;STRONG&gt;columns&lt;/STRONG&gt;: in the array you need to type the names of the columns you want to ajax-enable&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;&lt;STRONG&gt;values&lt;/STRONG&gt;: for every column defined in the columns option, you need to provide an array of values&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;Optionally you can set the &lt;STRONG&gt;debug &lt;/STRONG&gt;option to 1, so a log window is being displayed in case something goes wrong. The &lt;STRONG&gt;animationSpeed &lt;/STRONG&gt;option allows you to set the speed of the fancy fade in and out effects for the updated values. When all options are set, follow these steps:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Navigate to the page where you would like to use it (e.g. &lt;A href="http://yoursite//Lists/Tasks/AllItems.aspx"&gt;http://yoursite//Lists/Tasks/AllItems.aspx&lt;/A&gt; for the Task list).&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Click &lt;STRONG&gt;Site Actions&lt;/STRONG&gt;, &lt;STRONG&gt;Edit Page&lt;/STRONG&gt; (top right).&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Click &lt;STRONG&gt;Add a Web Part.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Select the &lt;STRONG&gt;Content Editor Web Part&lt;/STRONG&gt; in the &lt;STRONG&gt;Miscellaneous&lt;/STRONG&gt; section and click &lt;STRONG&gt;Add&lt;/STRONG&gt;.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Optionally drag the &lt;STRONG&gt;Content Editor Web Part &lt;/STRONG&gt;to the bottom of the screen (otherwise a small space will be displayed on top of the page).&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Click &lt;STRONG&gt;open the tool pane&lt;/STRONG&gt; in the web part.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Click &lt;STRONG&gt;Source Editor ... &lt;/STRONG&gt;in the properties task pane.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Copy and paste the modified script in the &lt;STRONG&gt;Text Entry &lt;/STRONG&gt;dialog and click &lt;STRONG&gt;Save&lt;/STRONG&gt;.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Click &lt;STRONG&gt;Exit Edit Mode &lt;/STRONG&gt;(top right) and verify the result.&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;Remember when the script doesn't work as expected, set the &lt;STRONG&gt;debug &lt;/STRONG&gt;option to 1 and you'll see the log messages appearing at the bottom right of the screen. Btw, thanks&amp;nbsp;my Twitter&amp;nbsp;buddies&amp;nbsp;who tested the script! (feel free to follow &lt;A href="http://twitter.com/jantielens" mce_href="http://twitter.com/jantielens"&gt;@jantielens&lt;/A&gt;).&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;A href="about:/jan/archive/2009/09/30/make-sharepoint-2007-act-like-sharepoint-2010-updated.aspx" mce_href="http://weblogs.asp.net/jan/archive/2009/09/30/make-sharepoint-2007-act-like-sharepoint-2010-updated.aspx"&gt;&lt;STRONG&gt;This script has been updated over here&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7201155" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>Customizing the SharePoint ECB with Javascript, Part 3</title><link>http://weblogs.asp.net/jan/archive/2009/09/11/customizing-the-sharepoint-ecb-with-javascript-part-3.aspx</link><pubDate>Fri, 11 Sep 2009 13:00:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7200843</guid><dc:creator>Jan Tielens</dc:creator><slash:comments>12</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7200843</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2009/09/11/customizing-the-sharepoint-ecb-with-javascript-part-3.aspx#comments</comments><description>Other articles in this series:&lt;BR&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://weblogs.asp.net/jan/archive/2009/09/03/customizing-the-sharepoint-ecb-with-javascript-part-1.aspx" mce_href="http://weblogs.asp.net/jan/archive/2009/09/03/customizing-the-sharepoint-ecb-with-javascript-part-1.aspx"&gt;Customizing the SharePoint ECB with Javascript, Part 1&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://weblogs.asp.net/jan/archive/2009/09/04/customizing-the-sharepoint-ecb-with-javascript-part-2.aspx" mce_href="http://weblogs.asp.net/jan/archive/2009/09/04/customizing-the-sharepoint-ecb-with-javascript-part-2.aspx"&gt;Customizing the SharePoint ECB with Javascript, Part 2&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;In the previous articles I explained the basic technique to add custom menu items to the &lt;SPAN style="FONT-WEIGHT: bold"&gt;Edit Control Block &lt;/SPAN&gt;(ECB) using Javascript. Basically it comes down to writing a Javascript function called &lt;SPAN style="FONT-WEIGHT: bold"&gt;Custom_AddListMenuItems&lt;/SPAN&gt; or &lt;SPAN style="FONT-WEIGHT: bold"&gt;Custom_AddDocLibMenuItems&lt;/SPAN&gt; (respectively for adding menu items to the ECB of Lists and Document Libraries). In these custom functions you can use the &lt;SPAN style="FONT-WEIGHT: bold"&gt;CAMOpt&lt;/SPAN&gt; Javascript function (found in the default core.js file) to add as many items as you want. Using the &lt;SPAN style="FONT-WEIGHT: bold"&gt;CASubM &lt;/SPAN&gt;function you can also build hierarchical menus.&lt;/P&gt;
&lt;P&gt;The next thing that I would like to discuss is how to create "context sensitive menu items" in the ECB using these techniques. What do I mean with "context sensitive"? Let’s take a look at the out-of-the-box ECB of a Document Library. In that ECB a menu item is displayed to &lt;SPAN style="FONT-WEIGHT: bold"&gt;Check Out &lt;/SPAN&gt;a document. But this menu item is only displayed when the document is not yet checked out. When the document is checked out, the ECB displays the &lt;SPAN style="FONT-WEIGHT: bold"&gt;Check In &lt;/SPAN&gt;and &lt;SPAN style="FONT-WEIGHT: bold"&gt;Discard Check Out &lt;/SPAN&gt;menu items instead. So based on the metadata of the document, the ECB is different in this scenario.&lt;/P&gt;
&lt;P&gt;&lt;IMG align=top src="http://storage.tielens.name/ecbjavascript3_1.jpg" width=212 height=325 mce_src="http://storage.tielens.name/ecbjavascript3_1.jpg"&gt; &amp;nbsp; &amp;nbsp; &lt;IMG src="http://storage.tielens.name/ecbjavascript3_2.jpg" width=207 height=345 mce_src="http://storage.tielens.name/ecbjavascript3_2.jpg"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To illustrate how you can build context sensitive ECB menu items yourself, let’s take the following example: we’ll enhance the ECB of a default &lt;SPAN style="FONT-WEIGHT: bold"&gt;Task list&lt;/SPAN&gt; so it shows menu items to quickly mark a task as Completed, In Progress etc. In the following screenshot the ECB for &lt;SPAN style="FONT-WEIGHT: bold"&gt;Test Task 1&lt;/SPAN&gt; is displayed. The &lt;SPAN style="FONT-WEIGHT: bold"&gt;Status&lt;/SPAN&gt; of that task is set to &lt;SPAN style="FONT-WEIGHT: bold"&gt;Not Started&lt;/SPAN&gt;, so the &lt;SPAN style="FONT-WEIGHT: bold"&gt;Update Status&lt;/SPAN&gt; menu item only displays In Progress, Complete, Deferred and Waiting child menu items.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://storage.tielens.name/ecbjavascript3_3.jpg" mce_src="http://storage.tielens.name/ecbjavascript3_3.jpg"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the same task list, there is also a &lt;SPAN style="FONT-WEIGHT: bold"&gt;Test Task 2&lt;/SPAN&gt; item for which the status is set to &lt;SPAN style="FONT-WEIGHT: bold"&gt;In Progress&lt;/SPAN&gt;. The &lt;SPAN style="FONT-WEIGHT: bold"&gt;Update Status&lt;/SPAN&gt; menu item in the ECB now displays Not Started, Complete, Deferred and Waiting.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://storage.tielens.name/ecbjavascript3_4.jpg" mce_src="http://storage.tielens.name/ecbjavascript3_4.jpg"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the customized ECB is configured in a Javascript function (Custom_AddListMenuItems in this case), we need to be able to retrieve the Status value of the item for which the ECB is currently being rendered. The &lt;SPAN style="FONT-WEIGHT: bold"&gt;core.js&lt;/SPAN&gt; and &lt;SPAN style="FONT-WEIGHT: bold"&gt;init.js&lt;/SPAN&gt; out-of-the-box Javascript files, give us little meta data information: only the item ID, checked out status etc are available. In this case technically it is possible to retrieve the Status value of the list item by querying the &lt;SPAN style="FONT-WEIGHT: bold"&gt;HTML DOM&lt;/SPAN&gt;. Although this technique would work, it would only work if the needed meta data is actually displayed. E.g. if the &lt;SPAN style="FONT-WEIGHT: bold"&gt;Status &lt;/SPAN&gt;column would not be displayed in the view, the information could not be retrieved. Therefore I’m using another technique that retrieves the necessary meta data information by making a call to the &lt;SPAN style="FONT-WEIGHT: bold"&gt;lists.asmx &lt;/SPAN&gt;web service. This web service has a web method called &lt;SPAN style="FONT-WEIGHT: bold"&gt;GetListItems &lt;/SPAN&gt;that can retrieve all meta data for one or more list items (as described in an &lt;A href="http://weblogs.asp.net/jan/archive/2009/05/06/querying-sharepoint-list-items-using-jquery.aspx" mce_href="http://weblogs.asp.net/jan/archive/2009/05/06/querying-sharepoint-list-items-using-jquery.aspx"&gt;earlier post&lt;/A&gt;). Once we have the meta data, the rendering of the ECB menu items is easy:&lt;/P&gt;
&lt;P style="FONT-FAMILY: courier new,courier"&gt;function Custom_AddListMenuItems(m, ctx) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var soapEnv = &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;lt;soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;soapenv:Body&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;listName&amp;gt;" + ctx.listName + "&amp;lt;/listName&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;viewFields&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ViewFields&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;FieldRef Name='Status' /&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ViewFields&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/viewFields&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;query&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Query&amp;gt;&amp;lt;Where&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Eq&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;FieldRef Name='ID' /&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Value Type='Integer'&amp;gt;" + currentItemID + "&amp;lt;/Value&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Eq&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Where&amp;gt;&amp;lt;/Query&amp;gt;\&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/query&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/GetListItems&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/soapenv:Body&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/soapenv:Envelope&amp;gt;";&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var wsurl = ctx.HttpRoot + "/_vti_bin/lists.asmx";&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $.ajax({&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; async: false,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url: wsurl,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type: "POST",&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataType: "xml",&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data: soapEnv,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; complete: function(xData, status) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var status = $(xData.responseXML).find("z\\:row:eq(0)").attr("ows_Status");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var menuItem = CASubM(m,"Update Status");&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var statusOptions = new Array("Not Started", "In Progress", &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Completed", "Deferred", "Waiting on someone else");&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(var i in statusOptions) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var statusOption = statusOptions[i];&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(statusOption&amp;nbsp; != status)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAMOpt(menuItem, statusOption , &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "changeTaskStatus('" + wsurl + "','" + ctx.listName + "','" + &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; currentItemID + "','" + statusOption + "');");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contentType: "text/xml; charset=\"utf-8\""&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAMSep(m);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;First the SOAP Envelope to send to the &lt;SPAN style="FONT-WEIGHT: bold"&gt;GetListItems &lt;/SPAN&gt;web method is constructed (&lt;SPAN style="FONT-WEIGHT: bold"&gt;soapEnv &lt;/SPAN&gt;variable); it uses the &lt;SPAN style="FONT-WEIGHT: bold"&gt;listName &lt;/SPAN&gt;property of the &lt;SPAN style="FONT-WEIGHT: bold"&gt;ctx &lt;/SPAN&gt;object (defined by SharePoint in the init.js), and the &lt;SPAN style="FONT-WEIGHT: bold"&gt;currentItemID &lt;/SPAN&gt;(defined by SharePoint in the core.js). The &lt;A href="http://jquery.com/" mce_href="http://jquery.com"&gt;jQuery&lt;/A&gt; &lt;SPAN style="FONT-WEIGHT: bold"&gt;ajax &lt;/SPAN&gt;method is used to make a the web service call. When the data is retrieved (the &lt;SPAN style="FONT-WEIGHT: bold"&gt;complete &lt;/SPAN&gt;option of the ajax method) the current &lt;SPAN style="FONT-WEIGHT: bold"&gt;Status &lt;/SPAN&gt;value is extracted and stored in the &lt;SPAN style="FONT-WEIGHT: bold"&gt;status &lt;/SPAN&gt;variable. Next a new menu item is added to the ECB using the &lt;SPAN style="FONT-WEIGHT: bold"&gt;CASubM &lt;/SPAN&gt;function (since this menu item will contain child items). Finally there is a loop over all possible Status values (stored in the &lt;SPAN style="FONT-WEIGHT: bold"&gt;statusOptions &lt;/SPAN&gt;array); every possible Status is added as a sub menu, except the Status that is currently assigned to the task item. Notice that the third parameter of the &lt;SPAN style="FONT-WEIGHT: bold"&gt;CAMOpt &lt;/SPAN&gt;function is a Javascript call to the &lt;SPAN style="FONT-WEIGHT: bold"&gt;changeTaskStatus &lt;/SPAN&gt;function, passing the web service URL, the list ID, the item ID and the selected status as parameters.&lt;/P&gt;
&lt;P&gt;The &lt;SPAN style="FONT-WEIGHT: bold"&gt;changeTaskStatus &lt;/SPAN&gt;function is pretty straight forward: once again a web service call is made, this time to the &lt;SPAN style="FONT-WEIGHT: bold"&gt;UpdateListItems &lt;/SPAN&gt;web method of the &lt;SPAN style="FONT-WEIGHT: bold"&gt;lists.asmx &lt;/SPAN&gt;web service. The SOAP Envelope sent to this web method contains a &lt;SPAN style="FONT-WEIGHT: bold"&gt;Batch &lt;/SPAN&gt;element in which an update is described of the Task list item.&lt;/P&gt;
&lt;P style="FONT-FAMILY: courier new,courier"&gt;function changeTaskStatus(wsurl, list, itemid, newstatus) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var batch =&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;lt;Batch OnError=\"Continue\"&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Method ID=\"1\" Cmd=\"Update\"&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Field Name=\"ID\"&amp;gt;" + itemid + "&amp;lt;/Field&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Field Name=\"Status\"&amp;gt;" + newstatus + "&amp;lt;/Field&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Method&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Batch&amp;gt;";&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var soapEnv =&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;lt;?xml version=\"1.0\" encoding=\"utf-8\"?&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;soap:Body&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;UpdateListItems xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\"&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;listName&amp;gt;" + list + "&amp;lt;/listName&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;updates&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; " + batch + "&amp;lt;/updates&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/UpdateListItems&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/soap:Body&amp;gt; \&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/soap:Envelope&amp;gt;";&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $.ajax({&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url: wsurl,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; beforeSend: function(xhr) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xhr.setRequestHeader("SOAPAction",&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "http://schemas.microsoft.com/sharepoint/soap/UpdateListItems");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type: "POST",&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataType: "xml",&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data: soapEnv,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; complete: function(xData, result) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.location.href=window.location.href;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contentType: "text/xml; charset=utf-8"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR&gt;} &lt;/P&gt;
&lt;P&gt;When the web service call is done (the &lt;SPAN style="FONT-WEIGHT: bold"&gt;complete &lt;/SPAN&gt;option of the ajax method) the page is refreshed by setting the &lt;SPAN style="FONT-WEIGHT: bold"&gt;href &lt;/SPAN&gt;of the &lt;SPAN style="FONT-WEIGHT: bold"&gt;window.location &lt;/SPAN&gt;property to it’s current value. As a result the page will display the updated value of the Status.&lt;/P&gt;
&lt;P&gt;Although this is pretty cool, it’s a pity of course that everything is happening using client side Javascript; &lt;SPAN style="FONT-WEIGHT: bold"&gt;except updating the value of the Status column in the HTML page &lt;/SPAN&gt;(which done with a full page refresh). Let’s try to fix this! To get to the location in the HTML DOM where the Status of the Task item is displayed is quite complex due to how SharePoint generates the HTML for a List view. The &lt;SPAN style="FONT-WEIGHT: bold"&gt;getItemTD &lt;/SPAN&gt;function below will get a reference to the &lt;SPAN style="FONT-WEIGHT: bold"&gt;TD &lt;/SPAN&gt;element for a specific Task item. First of all this method selects a table element with the ID set to the combination of the list ID and view ID. Notice that this table ID needs to be escaped for jQuery to make the selection. Next the &lt;SPAN style="FONT-WEIGHT: bold"&gt;TR &lt;/SPAN&gt;element (row) is selected for the Task item, based on the ID of a table nested on the TR which is the same as the item ID. After that the &lt;SPAN style="FONT-WEIGHT: bold"&gt;header row &lt;/SPAN&gt;is selected so the &lt;SPAN style="FONT-WEIGHT: bold"&gt;index &lt;/SPAN&gt;of the Status column can be calculated. Using this index the correct TD element (table cell) is selected and returned.&lt;/P&gt;
&lt;P style="FONT-FAMILY: courier new,courier"&gt;function getItemTD(itemid) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var tableid = ctx.listName + "-" + ctx.view;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // escape the table id ({ and } should become \{ and \}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tableid = tableid.replace(/{/g, "\\{").replace(/}/g, "\\}");&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // select them TR for the item&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $itemrow = $("#" + tableid + " table[id='" + itemid + "']").parent().parent();&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // select the header row&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $headerrow = $("&amp;gt;tr:eq(0)", $itemrow.parent());&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // select the table in the header row for the specified column&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $idtable = $("th&amp;gt;div&amp;gt;table[Name='Status']", $headerrow);&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // calculate the index of the column, based on the idtable&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var columnIndex =$("&amp;gt;th",$headerrow).index($idtable.parent().parent());&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // based on the index, let's get the TD&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $("&amp;gt;td:eq(" + columnIndex + ")", $itemrow);&lt;BR&gt;} &lt;/P&gt;
&lt;P&gt;To make us of this function the complete option of the ajax function, used in the changeTaskStatus function, has to be changed:&lt;/P&gt;
&lt;P style="FONT-FAMILY: courier new,courier"&gt;...&lt;BR&gt;complete: function(xData, result) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; getItemTD(itemid).text(newstatus);&lt;BR&gt;},&lt;BR&gt;...&lt;/P&gt;
&lt;P&gt;The &lt;SPAN style="FONT-WEIGHT: bold"&gt;getItemTD &lt;/SPAN&gt;function is used to select the table cell which should be updated with the new value. The result is that now the Status of a Task item can be updated, both in the SharePoint database and the web UI, &lt;SPAN style="FONT-WEIGHT: bold"&gt;without full page postbacks!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;You can download the &lt;A href="http://bit.ly/1o0kGn" mce_href="http://bit.ly/1o0kGn"&gt;full source code of this sample over here&lt;/A&gt;. To use it, navigate to a &lt;SPAN style="FONT-WEIGHT: bold"&gt;default Task &lt;/SPAN&gt;list (e.g. http://yoursite/Lists/Tasks/AllItems.aspx) and add a &lt;SPAN style="FONT-WEIGHT: bold"&gt;Content Editor Web Part &lt;/SPAN&gt;to the page. Open the Tool Pane of the Content Editor Web Part and paste the downloaded script in the &lt;SPAN style="FONT-WEIGHT: bold"&gt;Source &lt;/SPAN&gt;property of the web part (detailed instructions to add the web part can be found &lt;A href="http://weblogs.asp.net/jan/archive/2009/09/03/customizing-the-sharepoint-ecb-with-javascript-part-1.aspx" mce_href="http://weblogs.asp.net/jan/archive/2009/09/03/customizing-the-sharepoint-ecb-with-javascript-part-1.aspx"&gt;over here&lt;/A&gt;). Notice that on top of the script a reference is made to the jQuery library hosted by Google. Once again, if you host the jQuery library yourself (e.g. in a Document Library), feel free to update the URL.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7200843" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>URL Shortening in SharePoint with bit.ly</title><link>http://weblogs.asp.net/jan/archive/2009/09/04/url-shortening-in-sharepoint-with-bit-ly.aspx</link><pubDate>Fri, 04 Sep 2009 15:00:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7191779</guid><dc:creator>Jan Tielens</dc:creator><slash:comments>11</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7191779</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2009/09/04/url-shortening-in-sharepoint-with-bit-ly.aspx#comments</comments><description>
&lt;p&gt;In my two &lt;a href="http://weblogs.asp.net/jan/archive/2009/09/03/customizing-the-sharepoint-ecb-with-javascript-part-1.aspx" mce_href="http://weblogs.asp.net/jan/archive/2009/09/03/customizing-the-sharepoint-ecb-with-javascript-part-1.aspx"&gt;previous posts&lt;/a&gt; about customizing the Edit Control Block (or ECB for short) with Javascript, I showed some basic examples of what can be accomplished with this technique. Now it’s time to build a real life example instead of menu items which show Hello World dialog boxes.&lt;/p&gt;

&lt;p&gt;I’m pretty sure everybody who is using SharePoint has sent a link to a document in a Document Library to somebody else (in an email message for example). So you probably know that links to documents (or list items) can become pretty long if the document is located in a Document Library on a site deeply buried in a hierarchy. Already some time ago the internet community has solved the issue of long URL’s (which were a pain in newsgroups for example, or too long for Twitter messages): URL shortening. The idea is pretty basic: you can request a short URL (typically containing a generated code) for a long URL. When somebody uses the short URL, the long URL is retrieved and the user is redirected. There are many sites on the internet that provide this service for free, in this article I will be using &lt;a href="http://bit.ly" mce_href="http://bit.ly"&gt;bit.ly&lt;/a&gt; because they have a pretty nice API you can work with as a developer. For example this link &lt;a href="http://bit.ly/1btOBN"&gt;http://bit.ly/1btOBN&lt;/a&gt; will navigate to &lt;a href="http://weblogs.asp.net/jan/archive/2009/09/04/customizing-the-sharepoint-ecb-with-javascript-part-2.aspx"&gt;http://weblogs.asp.net/jan/archive/2009/09/04/customizing-the-sharepoint-ecb-with-javascript-part-2.aspx&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So what’s the idea? Instead of having to copy the link of a SharePoint document or list item to the clipboard, navigate to bit.ly and request a short URL over there; we’ll build this functionality directly into the SharePoint web user interface. The screenshot below shows the ECB of a normal Document Library, as you can see there is an extra menu item Shorten Link with bit.ly that has three child menu items.&lt;/p&gt;

&lt;p mce_keep="true"&gt;&lt;img src="http://storage.tielens.name/sharepointbitly1.jpg" mce_src="http://storage.tielens.name/sharepointbitly1.jpg"&gt;&lt;/p&gt;

&lt;p&gt;Once again, in my previous post I go into the details about how you can build a nested ECB menu item by just using Javascript. So let’s quickly discuss the code to build the menu items:&lt;br&gt;&lt;br&gt;&lt;font face="courier new,courier"&gt;function Custom_AddDocLibMenuItems(m, ctx) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var itemLink = window.location.protocol + "//" + window.location.host + &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GetAttributeFromItemTable(itemTable, "Url", "ServerUrl");&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return addBitlyMenuItems(m, ctx, itemLink);&lt;br&gt;}&lt;br&gt;&lt;br&gt;function Custom_AddListMenuItems(m, ctx) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var itemLink = window.location.protocol + "//" + window.location.host + &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ctx.displayFormUrl + "?ID=" + currentItemID;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return addBitlyMenuItems(m, ctx, itemLink);&lt;br&gt;}&lt;br&gt;&lt;br&gt;function addBitlyMenuItems(m, ctx, url) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var shortenMenu = CASubM(m,"Shorten Link with bit.ly", "/_layouts/images/RAT16.GIF");&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAMOpt(shortenMenu, "Shorten and Display", "getShortUrl('" + &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url + "', shortenAndDisplay)", "");&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAMOpt(shortenMenu, "Shorten and Copy to Clipboard", &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "getShortUrl('" + url + "', shortenAndCopy)");&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAMSep(shortenMenu);&amp;nbsp; // separator&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAMOpt(shortenMenu, "Show Statistics for Short Link", &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "getShortUrl('" + url + "', shortenAndShowStats)", "/_layouts/images/GRA16.GIF");&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAMSep(m); // separator&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;br&gt;}&lt;br&gt;&lt;/font&gt;&lt;br&gt;Because I want to show the ECB menu item both in Lists and Document Libraries, I’ve implemented both the &lt;b&gt;Custom_AddDocLibMenuItems &lt;/b&gt;and &lt;b&gt;Custom_AddListMenuItems &lt;/b&gt;Javascript functions. In those functions a string is constructed that contains a link to either the list item or to the document. Once we’ve got that URL, the &lt;b&gt;addBitlyMenuItems &lt;/b&gt;function is called. This function will build the parent menu item in the ECB and the three child menu items which will actually do the actions. Every action menu item calls a custom Javascript function called &lt;b&gt;getShortUrl &lt;/b&gt;which has a parameter for the long URL and a callback function. The getShortUrl function builds an URL to call the bit.ly REST API. This URL is called with the help of the &lt;a href="http://jquery.com" mce_href="http://jquery.com"&gt;jQuery&lt;/a&gt; &lt;b&gt;getJSON&lt;/b&gt; function. Note that to make use of the bit.ly API you need to have a free account and a corresponding key.&lt;br&gt;&lt;br&gt;&lt;font face="courier new,courier"&gt;function getShortUrl(url, callback) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var bitlyURL = "http://api.bit.ly/shorten?"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + "version=2.0.1"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + "&amp;amp;longUrl=" + escape(url)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + "&amp;amp;login=YOUR_LOGIN" + &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + "&amp;amp;apiKey=YOUR_KEY" + &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + "&amp;amp;history=1" + &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + "&amp;amp;format=json&amp;amp;callback=?";&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $.getJSON(bitlyURL, function(data){&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; callback(data.results[url].shortUrl);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br&gt;}&lt;br&gt;&lt;/font&gt;&lt;br&gt;Once the &lt;b&gt;getJSON&lt;/b&gt; function receives the data from bit.ly, the callback function (which was passed as a parameter) is called, passing along the shortened URL.&lt;/p&gt;

&lt;p&gt;The three callback functions used in the &lt;b&gt;addBitlyMenuItems &lt;/b&gt;function, will each do a specific action: show the shortened link, copy the link to the clipboard or navigate to the bit.ly statistics page. The &lt;b&gt;shortenAndDisplay &lt;/b&gt;is the most complex of those three; this function will display the shortened URL in a &lt;b&gt;DIV &lt;/b&gt;centered on top of the page. Once again jQuery is used&amp;nbsp;for manipulating the HTML DOM to dynamically render the DIV.&lt;br&gt;&lt;br&gt;&lt;font face="courier new,courier"&gt;function shortenAndDisplay(url) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("body").append("&amp;lt;div id='shortUrlDiv' class='ms-vb' style='position:absolute; \&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; background-color:White; padding:10px; border-width:1px; border-style:solid; \&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; border-color:Black;display:none; position:absolute;'&amp;gt;URL shortened to:&amp;lt;h2&amp;gt;" + &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url + "&amp;lt;/h2&amp;gt;&amp;lt;a href='#' id='shortUrlDivClose'&amp;gt;Close&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;");&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var $shortUrlDiv = $("#shortUrlDiv");&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var topPos = (document.body.clientHeight - $shortUrlDiv.height()) / 2;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var leftPos = (document.body.clientWidth - $shortUrlDiv.width()) / 2;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("#shortUrlDivClose", $shortUrlDiv).click(function() { &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(this).parent().hide("fast", function() { $(this).remove(); });&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("#shortUrlDiv").css("top", topPos).css("left", leftPos).show("fast");&lt;br&gt;}&lt;/font&gt;&lt;br&gt;&lt;br&gt;The result of this function looks like this:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://storage.tielens.name/sharepointbitly2.jpg" mce_src="http://storage.tielens.name/sharepointbitly2.jpg"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;The other two callback functions are very easy to implement. Notice that to show the bit.ly statistics page for a shortened link, you just need to add a &lt;b&gt;+&lt;/b&gt; sign to that link.&lt;/p&gt;

&lt;p&gt;&lt;font face="courier new,courier"&gt;function shortenAndCopy(url) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; clipboardData.setData("Text", url);&lt;br&gt;}&lt;br&gt;function shortenAndShowStats(url) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.location = url + "+";&lt;br&gt;}&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;The complete source code &lt;a href="http://storage.tielens.name/SharePointShortUrlsCode.zip" mce_href="http://storage.tielens.name/SharePointShortUrlsCode.zip"&gt;can be downloaded from here&lt;/a&gt;. You will notice that I’ve made the code somewhat easier to configure by adding a configuration variable at the top:&lt;/p&gt;

&lt;p&gt;&lt;font face="courier new,courier"&gt;var shortenConfig = {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; debug: 0,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // set this value to 1 to see debug information&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bitlyLogin: "spdemo",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // bit.ly account, below API key&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bitlyAPIKey:"R_877718dd86f418d0ee840c08af717a68",&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bitlyHistory: 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // set this value to 1 to add to bit.ly history&lt;br&gt;};&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;When you set the debug variable to 1, another DIV is dynamically added to the page and will show some log messages. When the bitlyHistory variable is set to 1, bit.ly will add the shortened link to the bit.ly account (so you can track it). Once again, if you plan to use this, go to bit.ly and sign up to get your own login and API key. On top of my code there is a reference to the jQuery library hosted by Google. If you have deployed jQuery locally, feel free to change the script reference. To use the code, just navigate to a Document Library or List, and add a new Content Editor web part to that page. As the HTML source of the web part, copy and paste the entire code that you've downloaded. (For a detailed description how to add the Content Editor web part, check &lt;a href="http://weblogs.asp.net/jan/archive/2009/09/03/customizing-the-sharepoint-ecb-with-javascript-part-1.aspx" mce_href="http://weblogs.asp.net/jan/archive/2009/09/03/customizing-the-sharepoint-ecb-with-javascript-part-1.aspx"&gt;an earlier article&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;
&lt;script src="http://sharepointads.com/members/scripts/banner.php?a_aid=jant&amp;amp;a_bid=47c2b53b" type="text/javascript"&gt;&lt;/script&gt;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7191779" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>Customizing the SharePoint ECB with Javascript, Part 2</title><link>http://weblogs.asp.net/jan/archive/2009/09/04/customizing-the-sharepoint-ecb-with-javascript-part-2.aspx</link><pubDate>Fri, 04 Sep 2009 04:15:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7191520</guid><dc:creator>Jan Tielens</dc:creator><slash:comments>9</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jan/rsscomments.aspx?PostID=7191520</wfw:commentRss><comments>http://weblogs.asp.net/jan/archive/2009/09/04/customizing-the-sharepoint-ecb-with-javascript-part-2.aspx#comments</comments><description>&lt;p&gt;Other articles in this series:&lt;br&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://weblogs.asp.net/jan/archive/2009/09/03/customizing-the-sharepoint-ecb-with-javascript-part-1.aspx" mce_href="http://weblogs.asp.net/jan/archive/2009/09/03/customizing-the-sharepoint-ecb-with-javascript-part-1.aspx"&gt;Customizing the SharePoint ECB with Javascript, Part 1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://weblogs.asp.net/jan/archive/2009/09/11/customizing-the-sharepoint-ecb-with-javascript-part-3.aspx" mce_href="http://weblogs.asp.net/jan/archive/2009/09/11/customizing-the-sharepoint-ecb-with-javascript-part-3.aspx"&gt;Customizing the SharePoint ECB with Javascript, Part 3&lt;/a&gt;&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br&gt;In the &lt;a href="http://weblogs.asp.net/jan/archive/2009/09/03/customizing-the-sharepoint-ecb-with-javascript-part-1.aspx" mce_href="http://weblogs.asp.net/jan/archive/2009/09/03/customizing-the-sharepoint-ecb-with-javascript-part-1.aspx"&gt;previous article in this series&lt;/a&gt; I explained how to add menu items in the &lt;b&gt;Edit Control Block&lt;/b&gt; of Lists and Document Libraries. The menu items added so far are all displayed at the same level; directly in the ECB. It is possible however to build hierarchical menus (menu items with sub menu items) using this technique as well. A good example of a hierarchical menu in the ECB is the default &lt;b&gt;Send To&lt;/b&gt; menu:&lt;/p&gt;&lt;p&gt;&lt;img src="http://storage.tielens.name/ecbjavascript2_1.jpg" mce_src="http://storage.tielens.name/ecbjavascript2_1.jpg"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Actually this is very easy to accomplish, instead of the &lt;b&gt;CAMOpt&lt;/b&gt; Javascript function discussed in the previous post, the function &lt;b&gt;CASubM&lt;/b&gt; can be used to create fly-out menu items (the ‘parent’ menu items). The following code snippet makes use of this technique:&lt;/p&gt;&lt;p&gt;&lt;font face="courier new,courier"&gt;function Custom_AddListMenuItems(m, ctx) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var menuItem = CASubM(m,"Menu Item", "/_layouts/images/LWV16.GIF")&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAMOpt(menuItem, "Sub Menu Item 1", "alert('Hello World!');");&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAMOpt(menuItem, "Sub Menu Item 2", "alert('Hello World!');");&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var subMenuItem = CASubM(menuItem,"Sub Menu Item 3")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAMOpt(subMenuItem, "Sub Menu Item 4", "alert('Hello World!');");&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAMOpt(subMenuItem, "Sub Menu Item 5", "alert('Hello World!');");&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAMSep(m); // separator&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false; // render the default menu items too&lt;br&gt;}&lt;/font&gt;&lt;/p&gt;&lt;p&gt;When this code is dropped in a Content Editor web part on a List page for example (see the previous article for the steps to follow), the rendered ECB will have the &lt;b&gt;Menu Item &lt;/b&gt;at the first level. This item contains three child menu items; the third child on itself contains two additional child menu items.&lt;/p&gt;&lt;p&gt;&lt;img src="http://storage.tielens.name/ecbjavascript2_2.jpg" mce_src="http://storage.tielens.name/ecbjavascript2_2.jpg"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;As already mentioned the key to this technique is the &lt;b&gt;CASubM &lt;/b&gt;Javascript function. The return value is a reference to the menu item that is created; it is this instance that is used as a parameter of the &lt;b&gt;CAMOpt &lt;/b&gt;function to specify on which level the menu item should be created. The &lt;b&gt;CASubM &lt;/b&gt;function can have 6 parameters (the first two are required):&lt;/p&gt;&lt;ol&gt;&lt;li&gt;a reference to the parent menu (just like the CAMOpt function)&lt;/li&gt;&lt;li&gt;the text to display&lt;/li&gt;&lt;li&gt;the URL of an icon for the menu item&lt;/li&gt;&lt;li&gt;the HTML alt attribute value of the icon&lt;/li&gt;&lt;li&gt;the HTML sequence attribute value of the menu item&lt;/li&gt;&lt;li&gt;the HTML description attribute value of the icon&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;The code discussed above is a basic sample that does nothing more than displaying a &lt;b&gt;Hello World &lt;/b&gt;message box when one of the list items is clicked. In real life you probably want to do something interesting when the user clicks on an ECB menu item; let’s try to create the following ECB:&lt;/p&gt;&lt;p&gt;&lt;img src="http://storage.tielens.name/ecbjavascript2_3.jpg" mce_src="http://storage.tielens.name/ecbjavascript2_3.jpg"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The code to render the Open in New Window menu item, including the sub menu items, goes as follows:&lt;/p&gt;&lt;p&gt;&lt;font face="courier new,courier"&gt;function Custom_AddListMenuItems(m, ctx) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var openMenu = CASubM(m,"Open in New Window");&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAMOpt(openMenu, "View Item", "alert('Todo');");&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAMOpt(openMenu, "Edit Item", &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "alert('Todo');", "/_layouts/images/edititem.gif");&lt;br&gt;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false; // render the default menu items too&lt;br&gt;}&lt;/font&gt;&lt;/p&gt;&lt;p&gt;So far nothing new or exciting, the challenge however is to come up with the Javascript functions which will be called when the &lt;b&gt;View Item &lt;/b&gt;or &lt;b&gt;Edit Item &lt;/b&gt;sub menu items are clicked (now they just display a dialog box). The issue (or challenge) is that the Javascript function needs to now for which item in the List or Document Library the ECB is rendered. Once again the &lt;b&gt;core.js &lt;/b&gt;is helping us out; it contains code that populates some context information about these items. There is for example a variable in the core.js called &lt;b&gt;currentItemID &lt;/b&gt;which contains the ID of&amp;nbsp; the List item or Document for which the ECB is being rendered. Some other interesting variables at the same location are: &lt;b&gt;currentItemIcon&lt;/b&gt;, &lt;b&gt;currentItemFileUrl&lt;/b&gt;, &lt;b&gt;currentItemCheckedOutUserId&lt;/b&gt; and &lt;b&gt;currentItemModerationStatus&lt;/b&gt;. For a full list, just open the &lt;b&gt;core.js&lt;/b&gt; file in the \12 hive and you’ll see all of them at the top. Besides those variables there is also an object called &lt;b&gt;ctx&lt;/b&gt; with even more information about the List or Document Library itself. The &lt;b&gt;ctx&lt;/b&gt; object is defined in the &lt;b&gt;init.js&lt;/b&gt;, and has properties like &lt;b&gt;listName&lt;/b&gt;, &lt;b&gt;view&lt;/b&gt;, &lt;b&gt;displayFormUrl&lt;/b&gt; etc. So if we adopt the code to build some URL’s which will be opened in a new window, the work is done.&lt;/p&gt;&lt;p&gt;&lt;font face="courier new,courier"&gt;function Custom_AddListMenuItems(m, ctx) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var viewURL = window.location.protocol + "//" + window.location.host + &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ctx.displayFormUrl + "?ID=" + currentItemID;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var editURL = window.location.protocol + "//" + window.location.host + &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ctx.editFormUrl + "?ID=" + currentItemID;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var openMenu = CASubM(m,"Open in New Window");&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAMOpt(openMenu, "View Item", "window.open('" + viewURL + "');");&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAMOpt(openMenu, "Edit Item", &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "window.open('" + editURL + "');", "/_layouts/images/edititem.gif");&lt;br&gt;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false; // render the default menu items too&lt;br&gt;}&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Using the variables found in the core.js and init.js files, you have access to the most basic set of metadata. But quite often it’s necessary to have access to even more metadata like non default fields etc. In the next article in this series, I’ll show you how this can be accomplished.&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7191520" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jan/archive/tags/SharePoint/default.aspx">SharePoint</category></item></channel></rss>