<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Welcome to ShanthaKumar&#039;s Blog &#187; jQuery</title>
	<atom:link href="http://ktskumar.com/blog/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://ktskumar.com/blog</link>
	<description>SharePoint, Silverlight and more.........</description>
	<lastBuildDate>Thu, 10 Jun 2010 01:42:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Hide Fields in SharePoint List Form Pages</title>
		<link>http://ktskumar.com/blog/2009/08/20/hide-fields-in-sharepoint-list-form-pages/</link>
		<comments>http://ktskumar.com/blog/2009/08/20/hide-fields-in-sharepoint-list-form-pages/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 17:21:34 +0000</pubDate>
		<dc:creator>Shantha Kumar</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Fields]]></category>
		<category><![CDATA[List Pages]]></category>

		<guid isPermaLink="false">http://ktskumar.com/blog/?p=230</guid>
		<description><![CDATA[I tried this evening very funny about hiding SharePoint List Fields in NewForm and EditForm pages of the List.
The result is ver simple when i used JQuery, just in a few lines for getting the result of what i need.
In my list i have Five Fields , on that we have CheckBox Yes or no [...]]]></description>
			<content:encoded><![CDATA[<p>I tried this evening very funny about hiding SharePoint List Fields in NewForm and EditForm pages of the List.<br />
The result is ver simple when i used <a href="http://www.jquery.com">JQuery</a>, just in a few lines for getting the result of what i need.</p>
<div id="attachment_231" class="wp-caption alignnone" style="width: 479px"><img class="size-full wp-image-231" title="fieldhide1" src="http://ktskumar.com/blog/wp-content/uploads/2009/08/fieldhide1.JPG" alt="Show Fields" width="469" height="269" /><p class="wp-caption-text">Fig-1 Show Fields</p></div>
<div id="attachment_232" class="wp-caption alignnone" style="width: 480px"><img class="size-full wp-image-232" title="fieldhide2" src="http://ktskumar.com/blog/wp-content/uploads/2009/08/fieldhide2.JPG" alt="Hide Fields" width="470" height="146" /><p class="wp-caption-text">Fig-2 Hide Fields</p></div>
<p>In my list i have Five Fields , on that we have CheckBox Yes or no type field use to show or hide the other fields.</p>
<p>The Checkbox title is ShowFields, if that checkbox is selected, the three fields will be Visible on the page,<br />
if that Checkbox is uncheked those fields are gone to be hidden.</p>
<p>I used Content Editor webpart for adding JQuery script, if u want to add CEWP to NewForm and EditForm pages, just type  &amp;ToolPaneView=2 on the end of the url<br />
(eg., <a href="http://server/Lists/SampleList/NewForm.aspx?RootFolder=%2FLists%2FSampleList&amp;Source=http%3A%2F%2Fserver%2FLists%2FSapleList%2FAllItems%2Easpx&amp;ToolPaneView=2">http://server/Lists/SampleList/NewForm.aspx?RootFolder=%2FLists%2FSampleList&amp;Source=http%3A%2F%2Fserver%2FLists%2FSapleList%2FAllItems%2Easpx&amp;ToolPaneView=2</a> )</p>
<p>Or wen ca also use the SharePoint Desinger as a editor to the Page</p>
<p>Add the following jquery code in ContentEditor WebPart</p>
<div class="codecss">
<p>
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;<a href="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js%22%3E%3C/script">http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js&#8221;&gt;&lt;/script</a>&gt;<br />
&lt;script&gt;<br />
$(document).ready(function()<br />
{<br />
$(&#8221;input[title$='ShowFields']&#8220;).click(function()<br />
{</p>
<p>$(&#8221;input[title$='Category']&#8220;).parent(&#8217;span&#8217;).parent(&#8217;td&#8217;).parent(&#8217;tr&#8217;).toggle();<br />
$(&#8221;textarea[title$='Comments']&#8220;).parent(&#8217;span&#8217;).parent(&#8217;td&#8217;).parent(&#8217;tr&#8217;).toggle();<br />
$(&#8221;input[title$='First Name']&#8220;).parent(&#8217;span&#8217;).parent(&#8217;td&#8217;).parent(&#8217;tr&#8217;).toggle();</p>
<p>});</p>
<p>});<br />
&lt;/script&gt;
</p>
</div>
<p>In the above code the inputfield with the title ShowFields is Clicked, that click event fires the fields to be hide or show.</p>
]]></content:encoded>
			<wfw:commentRss>http://ktskumar.com/blog/2009/08/20/hide-fields-in-sharepoint-list-form-pages/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Calling SharePoint webservice using JQuery</title>
		<link>http://ktskumar.com/blog/2009/07/25/calling-sharepoint-webservice-using-jquery/</link>
		<comments>http://ktskumar.com/blog/2009/07/25/calling-sharepoint-webservice-using-jquery/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 01:52:45 +0000</pubDate>
		<dc:creator>Shantha Kumar</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[WebService]]></category>

		<guid isPermaLink="false">http://ktskumar.com/blog/?p=185</guid>
		<description><![CDATA[
This post will explains you about, how to connect and retrieve the SharePoint data’s by calling SharePoint webservices using JQuery. This will be helpful in displaying SharePoint content in Pages without using Server side scripts and other long coding; we can achieve that by using simple JQuery methods.
For that we need to download the JQuery [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>This post will explains you about, how to connect and retrieve the SharePoint data’s by calling SharePoint webservices using JQuery. This will be helpful in displaying SharePoint content in Pages without using Server side scripts and other long coding; we can achieve that by using simple JQuery methods.</p>
<p>For that we need to download the <a href="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" target="_blank">JQuery</a> file and SharePoint out of the box webservice.</p>
<p>Add the following line in SharePoint Masterpage or any other pages in SharePoint using SharePoint Designer or in Content-Editor webpart.</p>
<p><strong>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;http://[Site]/js/jquery-1.3.2.min.js&#8221;&gt;&lt;/script&gt;</strong></p>
<p>Now we have to call the SharePoint Web Service by using <a href="http://docs.jquery.com/Ajax/jQuery.ajax" target="_blank">jQuery.ajax(options)</a> method.</p>
<div class="codecss">$.ajax({</p>
<p>url: &#8220;http://[Site]/_vti_bin/Webs.asmx&#8221;,</p>
<p>type: &#8220;POST&#8221;,</p>
<p>dataType: &#8220;xml&#8221;,</p>
<p>data: request Data,</p>
<p>complete: Function(XMLHttpRequest, string),</p>
<p>contentType: &#8220;text/xml; charset=\&#8221;utf-8\&#8221;"</p>
<p>});</p></div>
<p>url:<span style="white-space: pre;"> </span>Specify the webservice url to call<br />
type:<span style="white-space: pre;"> </span>Specify the type of request (get or post)<br />
dataType:  Type of data returned from server.<br />
Data:<span style="white-space: pre;"> </span>The request data to be sent to the server<br />
Complete: The funcutin to be called after the request finishes, The function gets passed two arguments: The XMLHttpRequest object and a string describing the type of success of the request.</p>
<div><strong>Example:</strong></div>
<p>The following code used to get all the sub sites under the Site Collecion. We can paste this code on Content Editor web part itself</p>
<div class="codecss">
<p>&lt;script&gt;</p>
<p>$(document).ready(function()</p>
<p>{</p>
<p>$.ajax(</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>url: &#8220;http://[Site]/_vti_bin/Webs.asmx&#8221;,</p>
<p><span style="white-space: pre;"> </span>type: &#8220;POST&#8221;,</p>
<p><span style="white-space: pre;"> </span>dataType: &#8220;xml&#8221;,</p>
<p><span style="white-space: pre;"> </span>data: &#8220;&lt;soap:Envelope xmlns:soap=&#8217;http://schemas.xmlsoap.org/soap/envelope/&#8217;&gt; \</p>
<p><span style="white-space: pre;"> </span> <span style="white-space: pre;"> </span> &lt;soap:Body&gt; \</p>
<p><span style="white-space: pre;"> </span>&lt;GetAllSubWebCollection xmlns=&#8217;http://schemas.microsoft.com/sharepoint/soap/&#8217; /&gt; \</p>
<p><span style="white-space: pre;"> </span> <span style="white-space: pre;"> </span>&lt;/soap:Body&gt; \</p>
<p><span style="white-space: pre;"> </span> &lt;/soap:Envelope&gt;&#8221;,</p>
<p><span style="white-space: pre;"> </span>complete: getWebs,</p>
<p><span style="white-space: pre;"> </span>contentType: &#8220;text/xml; charset=\&#8221;utf-8\&#8221;"</p>
<p>error:errorData</p>
<p>});</p>
<p>}</p>
<p>);</p>
<p>function getWebs(xmlData, status) {</p>
<p>$(xmlData.responseXML).find(&#8221;Web&#8221;).each(function() {</p>
<p>$(&#8221;#dataweb&#8221;).append(&#8221;&lt;li&gt;&lt;a href=&#8217;&#8221;+$(this).attr(&#8221;Url&#8221;)+&#8221;&#8216;&gt;&#8221; + $(this).attr(&#8221;Title&#8221;) + &#8220;&lt;/a&gt;&lt;/li&gt;&#8221;);</p>
<p>});</p>
<p>}</p>
<p>function errorData(xmlData, status,errorThrown)</p>
<p>{</p>
<p>$(“#dataweb”).append(“&lt;li&gt;”+errorThrown+”&lt;/li&gt;”);</p>
<p>}</p>
<p>&lt;/script&gt;</p>
<p>&lt;h3&gt; Sub-Sites: &lt;/h3&gt;</p>
<p>&lt;ol id=&#8221;dataweb&#8221;&gt;&lt;/ol&gt;</p></div>
<p>We can get the request data to be sent to the server on following url of web service,</p>
<p><strong> http://[Site]/_vti_bin/Webs.asmx?op=GetAllSubWebCollection</strong></p>
<div style="border:1px solid black; background-color:#e5e5cc; padding:5px;">POST /_vti_bin/Webs.asmx HTTP/1.1</p>
<p>Host: localhost</p>
<p>Content-Type: text/xml; charset=utf-8</p>
<p>Content-Length: length</p>
<p>SOAPAction: &#8220;http://schemas.microsoft.com/sharepoint/soap/GetAllSubWebCollection&#8221;</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;</p>
<p>&lt;soap:Envelope xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns:xsd=&#8221;http://www.w3.org/2001/XMLSchema&#8221; xmlns:soap=&#8221;http://schemas.xmlsoap.org/soap/envelope/&#8221;&gt;</p>
<p>&lt;soap:Body&gt;</p>
<p>&lt;GetAllSubWebCollection xmlns=&#8221;http://schemas.microsoft.com/sharepoint/soap/&#8221; /&gt;</p>
<p>&lt;/soap:Body&gt;</p>
<p>&lt;/soap:Envelope&gt;</p></div>
<p>The complete option returns the output if the type of request is success otherwise the error option is called.</p>
<p>The output is in following format,</p>
<div class="codecss">&lt;Webs xmlns=&#8221;http://schemas.microsoft.com/sharepoint/soap/&#8221;&gt;</p>
<p>&lt;Web Title=&#8221;Site1_Name&#8221; Url=&#8221;http://Server_Name/sites/Site_Name&#8221; /&gt;</p>
<p>&lt;Web Title=&#8221;Site2_Name&#8221; Url=&#8221;http://Server_Name/sites/Site_Name/Subsite_1&#8243; /&gt;</p>
<p>&lt;Web Title=&#8221;Site3_Name&#8221; Url=&#8221;http://Server_Name/sites/Site_Name/Subsite_1/Subsite_2&#8243; /&gt;</p>
<p>.</p>
<p>.</p>
<p>&lt;/Webs&gt;</p></div>
<div>By using this result, we can loop through this xml data and get the web site title and url, as mentioned in getWebs method.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ktskumar.com/blog/2009/07/25/calling-sharepoint-webservice-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
