<?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>SharePoint Fun &#187; JQuery</title>
	<atom:link href="http://blog.qumsieh.ca/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.qumsieh.ca</link>
	<description>Developer's blog related to ASP.NET, SharePoint and Telerik Web Controls</description>
	<lastBuildDate>Tue, 27 Jul 2010 03:07:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Hide Columns in SharePoint New, Edit and Disp Forms</title>
		<link>http://blog.qumsieh.ca/2010/02/16/hide-columns-in-sharepoint-new-edit-and-disp-forms/</link>
		<comments>http://blog.qumsieh.ca/2010/02/16/hide-columns-in-sharepoint-new-edit-and-disp-forms/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 22:36:38 +0000</pubDate>
		<dc:creator>shereen</dc:creator>
				<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://blog.qumsieh.ca/?p=639</guid>
		<description><![CDATA[Hiding columns in SharePoint is nothing new really, there have been several articles written on this topic. The approach for doing this, however, does inspire some debate in terms of what the best practice is. Let&#8217;s say we can agree that there are three ways to get this done: Using the built in content types [...]]]></description>
			<content:encoded><![CDATA[<p>Hiding columns in SharePoint is nothing new really, there have been several articles written on this topic. The approach for doing this, however, does inspire some debate in terms of what the best practice is. Let&#8217;s say we can agree that there are three ways to get this done:</p>
<ol>
<li>Using the built in content types to specify which columns you wish to be hidden.</li>
<li>Using jQuery and a content editor web part to hide the columns as desired.</li>
<li>Hide the columns programmatically using code.</li>
</ol>
<p>I just wanted to make some comments on all three. The content type approach is a good one and relatively simple to implement. Once you&#8217;ve enabled content types for your list or library, click on the default content type, let&#8217;s say it&#8217;s Item, and choose the column you&#8217;d like to have hidden and simply set it&#8217;s column settings to Hidden. Here is an excellent reference for this technique: <a href="http://littletalk.wordpress.com/2009/03/30/hide-remove-title-column-from-sharepoint-list/" target="_blank">http://littletalk.wordpress.com/2009/03/30/hide-remove-title-column-from-sharepoint-list/</a>.</p>
<p>Ok so the above works good, but what happens if you only want to introduce these hidden columns on your <strong>New</strong> and <strong>Edit</strong> forms but not your <strong>Disp</strong> form as an example. Or what if your scenario requires that they are hidden from all default <strong>New</strong>, <strong>Edit</strong> and <strong>Disp</strong> forms, but you have some custom SharePoint Designer disp forms that you&#8217;ve created that those fields need to be visible on. The content type approach will hide the column for all forms and so that won&#8217;t always work. We need something more granular.</p>
<p>So there is where the jQuery approach comes in handy. Some great resources for this:</p>
<ul>
<li>Paul Galvin has written some great articles on this topic over at <a href="http://endusersharepoint.com" target="_blank">EndUserSharePoint</a> &#8211; <a href="http://www.endusersharepoint.com/2009/06/17/quick-and-easy-use-jquery-to-hide-a-text-field-on-a-sharepoint-form/" target="_blank">http://www.endusersharepoint.com/2009/06/17/quick-and-easy-use-jquery-to-hide-a-text-field-on-a-sharepoint-form/</a> and <a href="http://www.endusersharepoint.com/2009/06/18/quick-and-easy-a-better-way-to-use-jquery-to-hide-a-text-field-on-a-sharepoint-form/" target="_blank">http://www.endusersharepoint.com/2009/06/18/quick-and-easy-a-better-way-to-use-jquery-to-hide-a-text-field-on-a-sharepoint-form/</a></li>
</ul>
<p>As per the comments by Nathan Ahlstrom in the second link noted above, the final fix for me was to use:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'nobr:contains(&quot;Completion time&quot;)'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">closest</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'tr'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'nobr:contains(&quot;Score&quot;)'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">closest</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'tr'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Please note that I had to add quotes around the <strong>tr</strong> tag for this to work for me.</p>
<p>The final approach uses some custom code and the object model to hide columns for a given list. <a href="http://www.sharepointkings.com/2008/05/how-to-hide-column-of-sharepoint-list.html">http://www.sharepointkings.com/2008/05/how-to-hide-column-of-sharepoint-list.html</a>. Now I&#8217;m not entirely sure how this works with custom forms besides the <strong>New</strong>, <strong>Edit</strong> and <strong>Disp</strong> forms, and until I have time to try out, I won&#8217;t know the answer to that. It&#8217;s worth mentioning because it does give you some granularity in that you can specify hidden properties per form.</p>
<p>That&#8217;s all for now. Please send in your comments if you have them, would love to hear from you.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.qumsieh.ca/2010/02/16/hide-columns-in-sharepoint-new-edit-and-disp-forms/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jqGrid Text/Word Wrapping</title>
		<link>http://blog.qumsieh.ca/2009/12/03/jqgrid-textword-wrapping/</link>
		<comments>http://blog.qumsieh.ca/2009/12/03/jqgrid-textword-wrapping/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 04:54:31 +0000</pubDate>
		<dc:creator>shereen</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://blog.qumsieh.ca/?p=598</guid>
		<description><![CDATA[Just a quick post for anyone else having this issue. I am working with the latest version of jqGrid, and I am dealing with cell data that is longer than the width of the cell making it difficult to see. I wanted to have this data wrap and the height of the cell adjust to [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick post for anyone else having this issue. I am working with the latest version of <a href="http://www.trirand.com/blog/">jqGrid</a>, and I am dealing with cell data that is longer than the width of the cell making it difficult to see. I wanted to have this data wrap and the height of the cell adjust to fit the wrapped content.</p>
<p>I found a <a href="http://www.trirand.com/blog/?page_id=393/help/word-wrap-support&#038;value=word%2525wrap%25251&#038;search=2">ton of useful</a> info on the jqGrid forums but it didn&#8217;t quite get me there.</p>
<p>The forum article in the above link suggests that you add the follwing CSS to your page:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">.ui-jqgrid tr.jqgrow td {
    white-space: normal !important;
}</pre></td></tr></table></div>

<p>The above worked great for FF, but in IE, it would wrap the content, but the cell height would not auto adjust and therefore you really couldn&#8217;t see the full content. So I made a couple more changes as per the code snippet below and this seemed to work for me.</p>
<p>So the <strong>height:auto</strong> forces the cell height to auto adjust based on the size of the wrapped content. I haven&#8217;t noticed any side effects of changing this. If anyone has I&#8217;d love to hear about it. The<strong> vertical-align:top</strong> ensures that the text positions at the top so that the cells with less content don&#8217;t disappear in the centre due to the larger cell blocks. And finally, I added a bit of <strong>padding</strong> so that my cells don&#8217;t look oddly aligned due to the vertical-align bit, but that&#8217;s optional. It&#8217;ll work without it.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">.ui-jqgrid tr.jqgrow td {
    white-space: normal !important;
    height:auto;
    vertical-align:text-top;
    padding-top:2px;
}</pre></td></tr></table></div>

<p>If anyone else has run into this issue or has had to make a similar change, add your contribution to the comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.qumsieh.ca/2009/12/03/jqgrid-textword-wrapping/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery &#8211; Get All Divs Whose ID Starts With</title>
		<link>http://blog.qumsieh.ca/2009/11/12/jquery-get-all-divs-whose-id-starts-with/</link>
		<comments>http://blog.qumsieh.ca/2009/11/12/jquery-get-all-divs-whose-id-starts-with/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 21:46:23 +0000</pubDate>
		<dc:creator>shereen</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://blog.qumsieh.ca/?p=584</guid>
		<description><![CDATA[Structure: 1 2 3 4 &#60;div id=&#34;thisismydiv1&#34;&#62;&#60;/div&#62; &#60;div id=&#34;thisismydiv2&#34;&#62;&#60;/div&#62; &#60;div id=&#34;thisismydiv3&#34;&#62;&#60;/div&#62; &#60;div id=&#34;thisismydiv4&#34;&#62;&#60;/div&#62; To return an array of all divs that start with &#8216;thisismydiv&#8217;, you would use the following: 1 var divList = $&#40;&#34;div[id^='thisismydiv']&#34;&#41;; The above translates to, find me all divs whose id starts with &#8216;thisismydiv&#8217;. You could now do something cool like add [...]]]></description>
			<content:encoded><![CDATA[<p>Structure:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;thisismydiv1&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;thisismydiv2&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;thisismydiv3&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;thisismydiv4&quot;&gt;&lt;/div&gt;</pre></td></tr></table></div>

<p>To return an array of all divs that start with &#8216;thisismydiv&#8217;, you would use the following:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> divList <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div[id^='thisismydiv']&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>The above translates to, find me all divs whose id starts with &#8216;thisismydiv&#8217;. You could now do something cool like add a class to all those divs:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div[id^='thisismydiv']&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'myClass'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.qumsieh.ca/2009/11/12/jquery-get-all-divs-whose-id-starts-with/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery UI Tabs &#8211; Creating Closable Tabs</title>
		<link>http://blog.qumsieh.ca/2009/10/29/jquery-ui-tabs-creating-closable-tabs/</link>
		<comments>http://blog.qumsieh.ca/2009/10/29/jquery-ui-tabs-creating-closable-tabs/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 19:05:51 +0000</pubDate>
		<dc:creator>shereen</dc:creator>
				<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://blog.qumsieh.ca/?p=568</guid>
		<description><![CDATA[Ok, so this is really a follow up to my previous post where I outlined how to build jQuery Tabs that Open and Close. I did end that post with a small TODO for myself: integrate the close capability into the tab itself so the user didn&#8217;t have to click a button to close that [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so this is really a follow up to my previous <a href="http://blog.qumsieh.ca/2009/10/27/building-jquery-tabs-that-open-close/">post</a> where I outlined how to build jQuery Tabs that Open and Close. I did end that post with a small TODO for myself: integrate the close capability into the tab itself so the user didn&#8217;t have to click a button to close that tab.</p>
<p>Now after doing a bit of digging, I learned that this is actually functionality that is in the works for future releases of jQuery UI. Ticket <a href="http://dev.jqueryui.com/ticket/3924" target="_blank">3924</a> is currently open and in development, which is a good sign. Further investigation landed me on this page: <a href="http://jsbin.com/uqage">http://jsbin.com/uqage</a> which is a fantastic example of how the Closable Tabs concept could work.</p>
<p>My final solution involved me tweaking the above to work as follows:</p>
<h3>Setting Up the HTML</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;mytabs&quot;&gt; 
   &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#tabs-home&quot;&gt;My Projects Home&lt;/a&gt;&lt;/li&gt;
   &lt;/ul&gt;
   &lt;div id=&quot;tabs-home&quot;&gt;
      &lt;h3&gt;Welcome to My Projects Home&lt;/h3&gt;
      &lt;p&gt;&lt;a href=&quot;#&quot; onclick=&quot;addTab('myActiveProjects', 'My Active Projects', 'RadGrid1')&quot;&gt;My Active Projects&lt;/a&gt;&lt;/p&gt;
      &lt;p&gt;&lt;a href=&quot;#&quot; onclick=&quot;addTab('mySalesActivities', 'My Sales Activities', 'RadGrid2')&quot;&gt;My Sales Activities&lt;/a&gt;&lt;/p&gt;
   &lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;tabs-myActiveProjects&quot; style=&quot;display:none;&quot;&gt;
&lt;h3&gt;My Active Projects&lt;/h3&gt;
&nbsp;
&lt;/div&gt;
&lt;div id=&quot;tabs-mySalesActivities&quot; style=&quot;display:none;&quot;&gt;
&lt;h3&gt;My Sales Activities&lt;/h3&gt;
&nbsp;
&lt;/div&gt;</pre></td></tr></table></div>

<h3>Wiring Up the Javascript</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span>init<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// tabs init with a custom tab template and an &quot;add&quot; callback filling in the content</span>
    <span style="color: #003366; font-weight: bold;">var</span> $tabs <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#mytabs&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tabs</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        tabTemplate<span style="color: #339933;">:</span> <span style="color: #3366CC;">'&lt;li&gt;&lt;a href=&quot;#{href}&quot;&gt;#{label}&lt;/a&gt; &lt;span class=&quot;ui-test&quot;&gt;&lt;img src=&quot;images/cross.png&quot; /&gt;&lt;/span&gt;&lt;/li&gt;'</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// close icon: removing the tab on click</span>
    <span style="color: #006600; font-style: italic;">// note: closable tabs gonna be an option in the future - see http://dev.jqueryui.com/ticket/3924</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#mytabs span.ui-test'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">live</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> index <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #339933;">,</span>$tabs<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">index</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#mytabs span.ui-test'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#mytabs&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tabs</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'select'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> addTab<span style="color: #009900;">&#40;</span>tabID<span style="color: #339933;">,</span> tabName<span style="color: #339933;">,</span> grid<span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// double check to see if tab is already open</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a[href^=#tabs-&quot;</span><span style="color: #339933;">+</span> tabID <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;]&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a[href^=#tabs-&quot;</span><span style="color: #339933;">+</span> tabID <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;]&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
        currentTabID <span style="color: #339933;">=</span> tabID<span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">// this will add a tab via the standard method</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#mytabs&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tabs</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;add&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;#tabs-&quot;</span> <span style="color: #339933;">+</span> tabID<span style="color: #339933;">,</span>tabName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#tabs-&quot;</span> <span style="color: #339933;">+</span> tabID<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;display&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;block&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#mytabs&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tabs</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'select'</span><span style="color: #339933;">,</span> tabID<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h3>Finalizing the Styles</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;script type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> src<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;jquery-1.3.2.min.js&quot;</span><span style="color: #00AA00;">&gt;</span>&lt;/script<span style="color: #00AA00;">&gt;</span>
&lt;script type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> src<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;jquery-ui-1.7.2.custom.min.js&quot;</span><span style="color: #00AA00;">&gt;</span>&lt;/script<span style="color: #00AA00;">&gt;</span>
&lt;link type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> href<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;styles/smoothness/jquery-ui-1.7.2.custom.css&quot;</span> rel<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> /<span style="color: #00AA00;">&gt;</span>
&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
    <span style="color: #cc00cc;">#mytabs</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1em</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
    <span style="color: #cc00cc;">#mytabs</span> li <span style="color: #6666ff;">.ui-test</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0.5em</span> <span style="color: #933;">0.4em</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<p>Please, please leave a comment if you have any difficulty with this and I&#8217;ll do my best to help!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.qumsieh.ca/2009/10/29/jquery-ui-tabs-creating-closable-tabs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Building jQuery Tabs That Open &amp; Close</title>
		<link>http://blog.qumsieh.ca/2009/10/27/building-jquery-tabs-that-open-close/</link>
		<comments>http://blog.qumsieh.ca/2009/10/27/building-jquery-tabs-that-open-close/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 18:55:39 +0000</pubDate>
		<dc:creator>shereen</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://blog.qumsieh.ca/?p=553</guid>
		<description><![CDATA[jQuery is obviously a really powerful tool. If you&#8217;ve done any work with it, you don&#8217;t need convincing. My latest project involving jQuery was a bit tricky because I couldn&#8217;t find anything that detailed how to generate a tab once a user clicked on a link, and then how to close that tab if the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jQuery.com">jQuery</a> is obviously a really powerful tool. If you&#8217;ve done any work with it, you don&#8217;t need convincing. My latest project involving jQuery was a bit tricky because I couldn&#8217;t find anything that detailed how to generate a tab once a user clicked on a link, and then how to close that tab if the user clicked the close button. Here is my setup:</p>
<ol>
<li>I needed to create a page with some static links, that when clicked on would spawn a new tab.</li>
<li>The content area for each tab would contain a <strong>Close</strong> button that would remove the tab and hide the div contents. I didn&#8217;t want the div contents removed because I wanted users to be able to open the tabs again if they wanted to.</li>
</ol>
<p><strong>NOTE</strong>: I did attempt to dynamically generate the div contents by using a jQuery append statement on the content divs, but I ran into issues with this when placing a <a href="http://www.telerik.com">Telerik</a> RadGrid onto the page and had to abandon that approach.</p>
<p>Building the above with the <a href="http://docs.jquery.com/UI/Tabs">jQuery UI Tabs</a> library took me part of the way there. In the end, my solution looks as follows:</p>
<h3>Building the UI Tabs</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;mytabs&quot;&gt; 
   &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#tabs-home&quot;&gt;My Projects Home&lt;/a&gt;&lt;/li&gt;
   &lt;/ul&gt;
   &lt;div id=&quot;tabs-home&quot;&gt;
      &lt;h3&gt;Welcome to My Projects Home&lt;/h3&gt;
      &lt;p&gt;&lt;a href=&quot;#&quot; onclick=&quot;showTab('myActiveProjects', 'My Active Projects')&quot;&gt;My Active Projects&lt;/a&gt;&lt;/p&gt;
      &lt;p&gt;&lt;a href=&quot;#&quot; onclick=&quot;showTab('mySalesActivities', 'My Sales Activities')&quot;&gt;My Sales Activities&lt;/a&gt;&lt;/p&gt;
   &lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;tabs-myActiveProjects&quot; style=&quot;display:none;&quot;&gt;
    &lt;h3&gt;My Active Projects&lt;/h3&gt;
    &lt;p&gt;&lt;input type=&quot;button&quot; name=&quot;killTab&quot; value=&quot;Close&quot; onclick=&quot;hideTab('myActiveProjects')&quot; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&quot;tabs-mySalesActivities&quot; style=&quot;display:none;&quot;&gt;
    &lt;h3&gt;My Sales Activities&lt;/h3&gt;
    &lt;p&gt;&lt;input type=&quot;button&quot; name=&quot;killTab&quot; value=&quot;Close&quot; onclick=&quot;hideTab('mySalesActivities')&quot; /&gt;&lt;/p&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<h3>Wiring Up The Javascript</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#mytabs&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tabs</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> showTab<span style="color: #009900;">&#40;</span>tabID<span style="color: #339933;">,</span> tabName<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    currentTabID <span style="color: #339933;">=</span> tabID<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// this will add a tab via the standard method</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#mytabs&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tabs</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;add&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;#tabs-&quot;</span> <span style="color: #339933;">+</span> tabID<span style="color: #339933;">,</span> tabName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#tabs-&quot;</span> <span style="color: #339933;">+</span> tabID<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;display&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;block&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#mytabs&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tabs</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'select'</span><span style="color: #339933;">,</span> tabID<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> hideTab<span style="color: #009900;">&#40;</span>tabID<span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#tabs-&quot;</span> <span style="color: #339933;">+</span> tabID<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;display&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;none&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a[href^=#tabs-&quot;</span><span style="color: #339933;">+</span> tabID <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;]&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#mytabs&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tabs</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'select'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span>init<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Don&#8217;t forget to include the jQuery UI JS file and the corresponding CSS. You&#8217;ll also need to include the jQuery JS file as well. If you have any troubles with this, drop me a note.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;jquery-1.3.2.min.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;jquery-ui-1.7.2.custom.min.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>link type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/css&quot;</span> href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;styles/smoothness/jquery-ui-1.7.2.custom.css&quot;</span> rel<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;stylesheet&quot;</span> <span style="color: #339933;">/&gt;</span></pre></td></tr></table></div>

<p>My next step with the above is to relocate the <strong>Close</strong> button so that it is an &#8216;X&#8217; image on the tab itself that when clicked on would close the tab. I&#8217;ll update once I figure that out! Good times!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.qumsieh.ca/2009/10/27/building-jquery-tabs-that-open-close/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>JQuery AutoComplete extraParams and CheckBoxes</title>
		<link>http://blog.qumsieh.ca/2009/09/08/jquery-autocomplete-extraparams-and-checkboxes/</link>
		<comments>http://blog.qumsieh.ca/2009/09/08/jquery-autocomplete-extraparams-and-checkboxes/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 18:29:05 +0000</pubDate>
		<dc:creator>shereen</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://blog.qumsieh.ca/?p=468</guid>
		<description><![CDATA[I love jQuery. I work with it quite a lot on various projects. One of the coolest features in my humble opinion is AutoComplete. There are a ton of different plugins you can work with, some are variations of others, but for the most part, they work pretty darn good out of the box. I [...]]]></description>
			<content:encoded><![CDATA[<p>I love jQuery. I work with it quite a lot on various projects. One of the coolest features in my humble opinion is AutoComplete. There are a ton of different plugins you can work with, some are variations of others, but for the most part, they work pretty darn good out of the box.</p>
<p>I have been trying unsuccessfully over the past hour or so to pass in the value of a checkbox as a parameter to my AutoComplete plugin as follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;">cacheLength<span style="color: #008000;">:</span><span style="color: #FF0000;">0</span>,
minChars<span style="color: #008000;">:</span><span style="color: #FF0000;">2</span>,
max<span style="color: #008000;">:</span><span style="color: #FF0000;">20</span>,
autoFill<span style="color: #008000;">:</span><span style="color: #0600FF;">false</span>,
extraParams<span style="color: #008000;">:</span> <span style="color: #000000;">&#123;</span> active <span style="color: #008000;">:</span> $<span style="color: #000000;">&#40;</span><span style="color: #666666;">'input[name=status]'</span><span style="color: #000000;">&#41;</span>.<span style="color: #008000;">is</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">':checked'</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Now the issue I was encountering was regardless of what the state of the checkbox was, checked or unchecked, the AutoComplete plugin always returned it&#8217;s initial value. So if by default it was unchecked, it always returned false. If by default it was checked, it always returned true.</p>
<p>After a bit of digging, I finally stumbled across this site that explains that the value is locked in once the AutoComplete plugin is initialized: <a href="http://stackoverflow.com/questions/1216222/jquery-passing-checkbox-values">http://stackoverflow.com/questions/1216222/jquery-passing-checkbox-values</a></p>
<p>So to solve the issue:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;">cacheLength<span style="color: #008000;">:</span><span style="color: #FF0000;">0</span>,
minChars<span style="color: #008000;">:</span><span style="color: #FF0000;">2</span>,
max<span style="color: #008000;">:</span><span style="color: #FF0000;">20</span>,
autoFill<span style="color: #008000;">:</span><span style="color: #0600FF;">false</span>,
extraParams<span style="color: #008000;">:</span> <span style="color: #000000;">&#123;</span>
    active <span style="color: #008000;">:</span> function<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> 
        <span style="color: #0600FF;">return</span> $<span style="color: #000000;">&#40;</span><span style="color: #666666;">'input[name=status]'</span><span style="color: #000000;">&#41;</span>.<span style="color: #008000;">is</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">':checked'</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span> 
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Awesome! Thanks to Stack Overflow and <a href="http://stackoverflow.com/users/6440/redsquare">redsquare</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.qumsieh.ca/2009/09/08/jquery-autocomplete-extraparams-and-checkboxes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JQuery Accessing the Client Generated ID of ASP.NET Controls</title>
		<link>http://blog.qumsieh.ca/2009/03/26/jquery-accessing-the-client-generated-id-of-aspnet-controls/</link>
		<comments>http://blog.qumsieh.ca/2009/03/26/jquery-accessing-the-client-generated-id-of-aspnet-controls/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 19:59:30 +0000</pubDate>
		<dc:creator>shereen</dc:creator>
				<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://blog.qumsieh.ca/?p=389</guid>
		<description><![CDATA[Ok, so we all know that ASP.NET controls, or any control for that matter with the runat=&#8221;server&#8221; tag, will generate a funky client ID when rendered on the page. Sometimes, we need to get at those controls via some client side javascript so that we may manipulate their properties or simply get/set their values. If [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so we all know that ASP.NET controls, or any control for that matter with the runat=&#8221;server&#8221; tag, will generate a funky client ID when rendered on the page.</p>
<p>Sometimes, we need to get at those controls via some client side javascript so that we may manipulate their properties or simply get/set their values.</p>
<p>If you&#8217;re not already familiar with <strong>JQuery</strong>, you need to take 5 minutes of your day and read up on it. It&#8217;s a very light javascript library that any decent developer should have in their toolbelt.</p>
<p><a href="http://jquery.com/">http://jquery.com/</a></p>
<p>Now <a href="http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery">getting started</a> with <strong>JQuery</strong> is pretty simple. It doesn&#8217;t matter what type of app you&#8217;re building, you simply need to download the jquery-1.3.2.min.js (this is the current version as of the time i wrote this post) file and include it in the <strong>HEAD</strong> tag your page:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;jquery-1.3.2.min.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Some examples of what you can do with <strong>JQeury</strong> (I got most of this from reading the documentation):</p>
<p><strong>Example 1 &#8211; DOM Ready</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// execute any code here that you'd like to be run as soon as the dom is ready. You may often</span>
    <span style="color: #006600; font-style: italic;">// want to show/hide certain controls on page load</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>Example 2 &#8211; Determine if an ASP.NET radio button is checked</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> radio <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&lt;%= radioButton.ClientID %&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> domRadio <span style="color: #339933;">=</span> radio<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> isChecked <span style="color: #339933;">=</span> domRadio.<span style="color: #660066;">checked</span><span style="color: #339933;">;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&lt;</span>input type<span style="color: #008000;">=</span><span style="color: #666666;">&quot;radio&quot;</span> id<span style="color: #008000;">=</span><span style="color: #666666;">&quot;radioButton&quot;</span> name<span style="color: #008000;">=</span><span style="color: #666666;">&quot;age&quot;</span> value<span style="color: #008000;">=</span><span style="color: #666666;">&quot;20&quot;</span> runat<span style="color: #008000;">=</span><span style="color: #666666;">&quot;server&quot;</span> <span style="color: #008000;">/&gt;</span></pre></td></tr></table></div>

<p>This is the most important part:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&lt;%= radioButton.ClientID %&gt;&quot;</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p><strong>radioButton.ClientID</strong> gets replaced with the automatically generated ASP.NET client id of this control. When I was working with prototypejs, I used to use the class selector to get a handle to these controls: $(&#8220;.className&#8221;) so naturally I started doing the same thing when I began working with JQuery. I wasn&#8217;t entirely happy with this method because it added what was otherwise an unnecessary property to my controls. </p>
<p>After discovering .ClientID, I use it most often. I still use the class selector but for different reasons. For example, if i want to show/hide a specific <strong>TR</strong> tag within a table, here is how I would do that:</p>
<p><strong>Example 3 &#8211; Show/Hide</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>isChecked<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.rowHide&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.rowHide&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;tr class=&quot;rowHide&quot;&gt;
    &lt;td&gt;some data&lt;/td&gt;
&lt;/tr&gt;</pre></td></tr></table></div>

<p><strong>Example 4 &#8211; Set the url for a link tag</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&lt;%= link.ClientID %&gt;&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    href<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;/pages/mypage.aspx?id=&quot;</span> <span style="color: #339933;">+</span> id<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>


<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&lt;</span>a id<span style="color: #008000;">=</span><span style="color: #666666;">&quot;link&quot;</span> target<span style="color: #008000;">=</span><span style="color: #666666;">&quot;_blank&quot;</span> runat<span style="color: #008000;">=</span><span style="color: #666666;">&quot;server&quot;</span><span style="color: #008000;">&gt;</span>My Link<span style="color: #008000;">&lt;/</span>a<span style="color: #008000;">&gt;</span></pre></div></div>

<p>I&#8217;ll be writing a post that describes in detail how to leverage <strong>JQuery</strong> to build autocomplete functionality into your SharePoint applications. Some users prefer the ASP.NET Ajax route, but in my humble opinion, <strong>JQuery</strong> is far easier to configure and use.</p>
<p>If anyone would like to see that sooner, just ping me and I&#8217;ll send some notes of how I achieved this.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.qumsieh.ca/2009/03/26/jquery-accessing-the-client-generated-id-of-aspnet-controls/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>JQuery, Microsoft &amp; Visual Studio</title>
		<link>http://blog.qumsieh.ca/2008/10/13/jquery-microsoft-visual-studio/</link>
		<comments>http://blog.qumsieh.ca/2008/10/13/jquery-microsoft-visual-studio/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 01:16:53 +0000</pubDate>
		<dc:creator>shereen</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://blog.qumsieh.ca/?p=83</guid>
		<description><![CDATA[I came across something very interesting last week and just wanted to make a note of it here. I&#8217;ve talked before about including prototypejs in your SharePoint application pages, but a recent announcement from Microsoft has made me consider using an alternative. You can read about Microsoft&#8217;s news to include JQuery in Visual Studio on [...]]]></description>
			<content:encoded><![CDATA[<p>I came across something very interesting last week and just wanted to make a note of it here. I&#8217;ve talked before about including prototypejs in your SharePoint application pages, but a recent announcement from Microsoft has made me consider using an alternative.</p>
<p>You can read about Microsoft&#8217;s news to include JQuery in Visual Studio on Scott&#8217;s <a href="http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx">blog</a>.</p>
<blockquote><p>&#8220;The jQuery intellisense annotation support will be available as a free web-download in a few weeks (and will work great with VS 2008 SP1 and the free Visual Web Developer 2008 Express SP1)&#8221;</p></blockquote>
<p>I&#8217;ll be looking into JQuery in the next couple weeks to see how it performs against prototypejs and i&#8217;ll post any findings here, so stay tuned!</p>
<p>Erik was kind enough to post some info related to prototype and the content editor not behaving well together. It seems that JQuery might work better in this scenario. You can read more about that <a href="http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/959681f1-61d4-4b11-8e43-40c793f2c2d7">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.qumsieh.ca/2008/10/13/jquery-microsoft-visual-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
