<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Jquery image selector Facebook style</title>
	<atom:link href="http://www.codethatmatters.com/2010/02/jquery-image-selector-facebook-style/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codethatmatters.com/2010/02/jquery-image-selector-facebook-style/</link>
	<description>Pylons, rails, jQuery and other stuff that matters</description>
	<lastBuildDate>Wed, 25 Jan 2012 10:20:28 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ruan</title>
		<link>http://www.codethatmatters.com/2010/02/jquery-image-selector-facebook-style/comment-page-1/#comment-943</link>
		<dc:creator>Ruan</dc:creator>
		<pubDate>Wed, 25 May 2011 09:17:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.codethatmatters.com/?p=179#comment-943</guid>
		<description>Hi Guys,

First of all, to the both of you (Bjorn &amp; EspadaV8), brilliant improvements/alterations to the Image Selector.

However, I have a question.

My knowledge on jQuery is very limited, and I&#039;m having trouble trying to achieve a certain goal.

I&#039;ve implemented the plugin and made a few changes to suit my needs, and all works well. For each list item that is selected, the list item is assigned a unique &quot;id&quot; attribute that corresponds with the row ID I&#039;ve retrieved from a list of people in the database. For example:

Row 1 in database:
ID: 1
Name: John
Surname: Doe.

When the list item (John Doe) is selected, it gets assigned an &quot;id&quot; attribute of &quot;recipient_1&quot; - the &quot;1&quot; being the row id of the database.

So in short, all the list items in the entire &quot;fcbklist&quot; unordered list that has an id attribute starting with &quot;recipient_&quot; means that the person is selected as a recipient and added to the recipient list - which is a different div container containing the selected recipients. Each recipient element in the recipient list (they&#039;re all div elements) has a corresponding id attribute which starts with &quot;recipientItem_&quot;, which in this case would be &quot;recipientItem_1&quot; for John Doe. The recipient element also has a &quot;remove&quot; button that enables the removal of the recipient. So when clicked on, the recipient element is removed from the recipient list via &quot;$(&quot;#recipientItem_&quot; + recipientID).remove();&quot;. 

All this works perfectly fine, though the problem I&#039;m facing is that I&#039;m not able to deselect the corresponding list item in the &quot;fcbklist&quot; whenever the &quot;remove&quot; button in the recipient list is clicked.

I&#039;ve tried the following for example:

$.fcbkListSelection.addToSelected(&quot;#recipient_1&quot;);

but I get an error that the function does not exist.

How would I go about calling the &quot;addToSelected&quot; or any other function in the fcbkListSelection plugin from an anchor link in order to deselect the corresponding list item?</description>
		<content:encoded><![CDATA[<p>Hi Guys,</p>
<p>First of all, to the both of you (Bjorn &amp; EspadaV8), brilliant improvements/alterations to the Image Selector.</p>
<p>However, I have a question.</p>
<p>My knowledge on jQuery is very limited, and I&#8217;m having trouble trying to achieve a certain goal.</p>
<p>I&#8217;ve implemented the plugin and made a few changes to suit my needs, and all works well. For each list item that is selected, the list item is assigned a unique &#8220;id&#8221; attribute that corresponds with the row ID I&#8217;ve retrieved from a list of people in the database. For example:</p>
<p>Row 1 in database:<br />
ID: 1<br />
Name: John<br />
Surname: Doe.</p>
<p>When the list item (John Doe) is selected, it gets assigned an &#8220;id&#8221; attribute of &#8220;recipient_1&#8243; &#8211; the &#8220;1&#8243; being the row id of the database.</p>
<p>So in short, all the list items in the entire &#8220;fcbklist&#8221; unordered list that has an id attribute starting with &#8220;recipient_&#8221; means that the person is selected as a recipient and added to the recipient list &#8211; which is a different div container containing the selected recipients. Each recipient element in the recipient list (they&#8217;re all div elements) has a corresponding id attribute which starts with &#8220;recipientItem_&#8221;, which in this case would be &#8220;recipientItem_1&#8243; for John Doe. The recipient element also has a &#8220;remove&#8221; button that enables the removal of the recipient. So when clicked on, the recipient element is removed from the recipient list via &#8220;$(&#8221;#recipientItem_&#8221; + recipientID).remove();&#8221;. </p>
<p>All this works perfectly fine, though the problem I&#8217;m facing is that I&#8217;m not able to deselect the corresponding list item in the &#8220;fcbklist&#8221; whenever the &#8220;remove&#8221; button in the recipient list is clicked.</p>
<p>I&#8217;ve tried the following for example:</p>
<p>$.fcbkListSelection.addToSelected(&#8221;#recipient_1&#8243;);</p>
<p>but I get an error that the function does not exist.</p>
<p>How would I go about calling the &#8220;addToSelected&#8221; or any other function in the fcbkListSelection plugin from an anchor link in order to deselect the corresponding list item?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EspadaV8</title>
		<link>http://www.codethatmatters.com/2010/02/jquery-image-selector-facebook-style/comment-page-1/#comment-87</link>
		<dc:creator>EspadaV8</dc:creator>
		<pubDate>Tue, 05 Oct 2010 03:03:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.codethatmatters.com/?p=179#comment-87</guid>
		<description>Just a minor improvement to the above code. Instead of calling 

removeValue();
hiddenCheck();

Before you remove the &#039;itemselected&#039; class, just call &#039;addToSelected&#039; and that will do the magic. It also meant that the &#039;Selected (1)&#039; will show the correct number.

Also, instead of doing the .each() for every fcbklist_item, you can just select the &#039;itemselected&#039; ones.


obj.click(function(){
    //check if this is already selected. in that case it should be deselected
    deselect_this = false;	
    if(parseInt(obj.attr(&quot;class&quot;).indexOf(&quot;selected&quot;)) &gt; -1)
    {
        deselect_this = true;
    }

    //deselecting all items
    $(&quot;li .fcbklist_item.itemselected&quot;).each(function(x, obj2)
    {
        obj2 = $(obj2);
        addToSelected(obj2);
        obj2.removeClass(&quot;itemselected&quot;);
        obj2.parents(&quot;li&quot;).removeClass(&quot;liselected&quot;);
        obj2.parents(&quot;li&quot;).removeAttr(&quot;addedid&quot;);
    });

    //if the clicked item should be deselected, do so
    if(!deselect_this)
    {
        addToSelected(obj);
        obj.toggleClass(&quot;itemselected&quot;);
        obj.parents(&quot;li&quot;).toggleClass(&quot;liselected&quot;);
    }
});</description>
		<content:encoded><![CDATA[<p>Just a minor improvement to the above code. Instead of calling </p>
<p>removeValue();<br />
hiddenCheck();</p>
<p>Before you remove the &#8216;itemselected&#8217; class, just call &#8216;addToSelected&#8217; and that will do the magic. It also meant that the &#8216;Selected (1)&#8217; will show the correct number.</p>
<p>Also, instead of doing the .each() for every fcbklist_item, you can just select the &#8216;itemselected&#8217; ones.</p>
<p>obj.click(function(){<br />
    //check if this is already selected. in that case it should be deselected<br />
    deselect_this = false;<br />
    if(parseInt(obj.attr(&#8221;class&#8221;).indexOf(&#8221;selected&#8221;)) &gt; -1)<br />
    {<br />
        deselect_this = true;<br />
    }</p>
<p>    //deselecting all items<br />
    $(&#8221;li .fcbklist_item.itemselected&#8221;).each(function(x, obj2)<br />
    {<br />
        obj2 = $(obj2);<br />
        addToSelected(obj2);<br />
        obj2.removeClass(&#8221;itemselected&#8221;);<br />
        obj2.parents(&#8221;li&#8221;).removeClass(&#8221;liselected&#8221;);<br />
        obj2.parents(&#8221;li&#8221;).removeAttr(&#8221;addedid&#8221;);<br />
    });</p>
<p>    //if the clicked item should be deselected, do so<br />
    if(!deselect_this)<br />
    {<br />
        addToSelected(obj);<br />
        obj.toggleClass(&#8221;itemselected&#8221;);<br />
        obj.parents(&#8221;li&#8221;).toggleClass(&#8221;liselected&#8221;);<br />
    }<br />
});</p>
]]></content:encoded>
	</item>
</channel>
</rss>

