<?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: Drag and drop category management with CakePHP</title>
	<atom:link href="http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/</link>
	<description>Helping you solve those tough coding problems!</description>
	<lastBuildDate>Fri, 12 Mar 2010 14:15:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: buy 2moons dil</title>
		<link>http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/comment-page-1/#comment-898</link>
		<dc:creator>buy 2moons dil</dc:creator>
		<pubDate>Sat, 12 Dec 2009 07:06:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.endyourif.com/?p=214#comment-898</guid>
		<description>Man hey, you have problems width ‘, ” by posting in your blog  a simple solution for : allow textarea html tag by comment posting.</description>
		<content:encoded><![CDATA[<p><code>Man hey, you have problems width ‘, ” by posting in your blog  a simple solution for : allow textarea html tag by comment posting.</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eugen</title>
		<link>http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/comment-page-1/#comment-695</link>
		<dc:creator>Eugen</dc:creator>
		<pubDate>Fri, 04 Sep 2009 19:14:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.endyourif.com/?p=214#comment-695</guid>
		<description>Man hey, you have problems width &#039;, &quot; by posting in your blog :( a simple solution for : allow textarea html tag by comment posting.</description>
		<content:encoded><![CDATA[<p><code>Man hey, you have problems width &#8216;, &#8221; by posting in your blog <img src='http://www.endyourif.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  a simple solution for : allow textarea html tag by comment posting.</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eugen</title>
		<link>http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/comment-page-1/#comment-694</link>
		<dc:creator>Eugen</dc:creator>
		<pubDate>Fri, 04 Sep 2009 19:09:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.endyourif.com/?p=214#comment-694</guid>
		<description>app\views\categories\index.ctp file:


link(array(&#039;jquery&#039;, &#039;jquery-ui&#039;), false);
?&gt;

$(document).ready(function(){
//set up the droppable list elements
$(&quot;ul li&quot;).droppable({
accept: &quot;.ui-draggable&quot;,
hoverClass: &#039;droppable-hover&#039;,
greedy: true,
tolerance: &#039;pointer&#039;,
drop: function(ev, ui) {
var dropEl = this;
var dragEl = $(ui.draggable);

// get category id
var parent_id = this.id.substring(9);
// get category name
var category_name = $(dragEl.find(&quot;span&quot;).get(0)).html();

if (!isNaN(parent_id) &amp;&amp; category_name.length &gt; 0) {
var data;
var url = &quot;/path/Categories/&quot;;

// see if we are adding or editing
if (dragEl.attr(&quot;id&quot;).substring(0, 9) == &quot;category_&quot;) {
// get the current id
var id = dragEl.attr(&quot;id&quot;).substring(9);
data = { &#039;data[Category][id]&#039;: id, &#039;data[Category][name]&#039;: category_name, &#039;data[Category][parent_id]&#039;: parent_id };
url += &quot;edit&quot;;
} else {
data = { &#039;data[Category][name]&#039;: category_name, &#039;data[Category][parent_id]&#039;: parent_id };
url += &quot;add&quot;;
}

// post to our page to save our category
$.post(url, data, function() {
$.get(&quot;categories/index/isAjax:1&#8243;&quot;, function (data) { destroyDraggable(); $(&quot;#content&quot;).html(data); setupDraggable(); });
});

}
}
});

setupDraggable();
});

function updateDragBox() {
$($(&quot;#ui-draggable&quot;).find(&quot;span&quot;).get(0)).html($(&quot;#CategoryName&quot;).val());
}

function setupDraggable() {
$(&quot;#ui-draggable&quot;).draggable({
containment: &#039;#categories&#039;,
stop: function(e,ui) {
$(this).animate({ left: 0, top:0 }, 500);
$(this).html();
}
});

$(&quot;#category_0&#8243;&quot;).find(&quot;li&quot;).draggable({
containment: &#039;#categories&#039;,
});

}

function destroyDraggable() {
$(&quot;#ui-draggable&quot;).draggable(&#039;destroy&#039;);
$(&quot;#category_0&#8243;&quot;).find(&quot;li&quot;).draggable(&#039;destroy&#039;);
}



#categories {
padding: 1em 0.5em;
width: 90%;
}

ul li {
background-color: #FFFFFF;
border: 1px solid #000000;
list-style: none;
margin: 1em 0;
padding: 1em;
}

ul li.droppable-hover {
background-color: #FFF000;
}

#category {
border: 1px solid #000000;
margin-top: 1em;
padding: 1em;
width: 97%;
}

#ui-draggable {
background: #FF0000;
padding: 1em;
position: relative;
width: 300px;
}






element(&#039;draw_category&#039;, array(&#039;data&#039; =&gt; $categories)); ?&gt;



Enter a category name in the text box below, then drag the object below into the category you wish it to be a part of.



input(&#039;Category.name&#039;, array(&#039;onkeyup&#039; =&gt; &#039;updateDragBox()&#039;)); ?&gt;





</description>
		<content:encoded><![CDATA[<p><code>app\views\categories\index.ctp file:</p><p>link(array(&#8216;jquery&#8217;, &#8216;jquery-ui&#8217;), false);<br />?&gt;</p><p>$(document).ready(function(){<br />//set up the droppable list elements<br />$(&#8220;ul li&#8221;).droppable({<br />accept: &#8220;.ui-draggable&#8221;,<br />hoverClass: &#8216;droppable-hover&#8217;,<br />greedy: true,<br />tolerance: &#8216;pointer&#8217;,<br />drop: function(ev, ui) {<br />var dropEl = this;<br />var dragEl = $(ui.draggable);</p><p>// get category id<br />var parent_id = this.id.substring(9);<br />// get category name<br />var category_name = $(dragEl.find(&#8220;span&#8221;).get(0)).html();</p><p>if (!isNaN(parent_id) &amp;&amp; category_name.length &gt; 0) {<br />var data;<br />var url = &#8220;/path/Categories/&#8221;;</p><p>// see if we are adding or editing<br />if (dragEl.attr(&#8220;id&#8221;).substring(0, 9) == &#8220;category_&#8221;) {<br />// get the current id<br />var id = dragEl.attr(&#8220;id&#8221;).substring(9);<br />data = { &#8216;data[Category][id]&#8216;: id, &#8216;data[Category][name]&#8216;: category_name, &#8216;data[Category][parent_id]&#8216;: parent_id };<br />url += &#8220;edit&#8221;;<br />} else {<br />data = { &#8216;data[Category][name]&#8216;: category_name, &#8216;data[Category][parent_id]&#8216;: parent_id };<br />url += &#8220;add&#8221;;<br />}</p><p>// post to our page to save our category<br />$.post(url, data, function() {<br />$.get(&#8220;categories/index/isAjax:1&#8243;&#8221;, function (data) { destroyDraggable(); $(&#8220;#content&#8221;).html(data); setupDraggable(); });<br />});</p><p>}<br />}<br />});</p><p>setupDraggable();<br />});</p><p>function updateDragBox() {<br />$($(&#8220;#ui-draggable&#8221;).find(&#8220;span&#8221;).get(0)).html($(&#8220;#CategoryName&#8221;).val());<br />}</p><p>function setupDraggable() {<br />$(&#8220;#ui-draggable&#8221;).draggable({<br />containment: &#8216;#categories&#8217;,<br />stop: function(e,ui) {<br />$(this).animate({ left: 0, top:0 }, 500);<br />$(this).html();<br />}<br />});</p><p>$(&#8220;#category_0&#8243;&#8221;).find(&#8220;li&#8221;).draggable({<br />containment: &#8216;#categories&#8217;,<br />});</p><p>}</p><p>function destroyDraggable() {<br />$(&#8220;#ui-draggable&#8221;).draggable(&#8216;destroy&#8217;);<br />$(&#8220;#category_0&#8243;&#8221;).find(&#8220;li&#8221;).draggable(&#8216;destroy&#8217;);<br />}</p><p>#categories {<br />padding: 1em 0.5em;<br />width: 90%;<br />}</p><p>ul li {<br />background-color: #FFFFFF;<br />border: 1px solid #000000;<br />list-style: none;<br />margin: 1em 0;<br />padding: 1em;<br />}</p><p>ul li.droppable-hover {<br />background-color: #FFF000;<br />}</p><p>#category {<br />border: 1px solid #000000;<br />margin-top: 1em;<br />padding: 1em;<br />width: 97%;<br />}</p><p>#ui-draggable {<br />background: #FF0000;<br />padding: 1em;<br />position: relative;<br />width: 300px;<br />}</p><p>element(&#8216;draw_category&#8217;, array(&#8216;data&#8217; =&gt; $categories)); ?&gt;</p><p>Enter a category name in the text box below, then drag the object below into the category you wish it to be a part of.</p><p>input(&#8216;Category.name&#8217;, array(&#8216;onkeyup&#8217; =&gt; &#8216;updateDragBox()&#8217;)); ?&gt;</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 2moons dil</title>
		<link>http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/comment-page-1/#comment-685</link>
		<dc:creator>2moons dil</dc:creator>
		<pubDate>Sat, 22 Aug 2009 03:03:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.endyourif.com/?p=214#comment-685</guid>
		<description>Well, to soon to say if it’s good, but at least it’s well designed. I mean I thought I would be blocked after adding some interests, but the site helps you to add more. Cheers</description>
		<content:encoded><![CDATA[<p><code>Well, to soon to say if it’s good, but at least it’s well designed. I mean I thought I would be blocked after adding some interests, but the site helps you to add more. Cheers</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ML</title>
		<link>http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/comment-page-1/#comment-664</link>
		<dc:creator>ML</dc:creator>
		<pubDate>Mon, 13 Jul 2009 14:52:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.endyourif.com/?p=214#comment-664</guid>
		<description>Sorry, the characters that needed replacing naturally rendered as a quote in the above post. I meant to indicate that:   &amp; # 8 2 4 3 ;  (without the spaces) were replaced.</description>
		<content:encoded><![CDATA[<p><code>Sorry, the characters that needed replacing naturally rendered as a quote in the above post. I meant to indicate that:   &amp; # 8 2 4 3 ;  (without the spaces) were replaced.</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ML</title>
		<link>http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/comment-page-1/#comment-663</link>
		<dc:creator>ML</dc:creator>
		<pubDate>Mon, 13 Jul 2009 13:55:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.endyourif.com/?p=214#comment-663</guid>
		<description>To run the index.ctp view without javascript errors, I had to replace &#8243; with a &quot; (a double quote) and in line 56 above, I had to remove the quote inside html. So line 56 became $(this).html();

Do these changes look correct? It works in Firefox, but in IE7 I get the javascript error &#039;Expected identify, string, or number&quot; at line 61 above.

Most grateful for any help. Thanks for a terrific article!</description>
		<content:encoded><![CDATA[<p><code>To run the index.ctp view without javascript errors, I had to replace &#8243; with a &#8221; (a double quote) and in line 56 above, I had to remove the quote inside html. So line 56 became $(this).html();</p><p>Do these changes look correct? It works in Firefox, but in IE7 I get the javascript error &#8216;Expected identify, string, or number&#8221; at line 61 above.</p><p>Most grateful for any help. Thanks for a terrific article!</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: maple story mesos</title>
		<link>http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/comment-page-1/#comment-637</link>
		<dc:creator>maple story mesos</dc:creator>
		<pubDate>Fri, 26 Jun 2009 01:13:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.endyourif.com/?p=214#comment-637</guid>
		<description>Great article, again. These informations are especially useful ...</description>
		<content:encoded><![CDATA[<p><code>Great article, again. These informations are especially useful &#8230;</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: maple story mesos</title>
		<link>http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/comment-page-1/#comment-636</link>
		<dc:creator>maple story mesos</dc:creator>
		<pubDate>Fri, 26 Jun 2009 01:13:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.endyourif.com/?p=214#comment-636</guid>
		<description>Wonderful article. I been looking for one on a similar note. I guess you always have something up your sleeve.</description>
		<content:encoded><![CDATA[<p><code>Wonderful article. I been looking for one on a similar note. I guess you always have something up your sleeve.</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waseem Khan</title>
		<link>http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/comment-page-1/#comment-621</link>
		<dc:creator>Waseem Khan</dc:creator>
		<pubDate>Wed, 27 May 2009 05:59:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.endyourif.com/?p=214#comment-621</guid>
		<description>Hi I read an article of yours on sitereference.com titled &quot;How to get indexed by Google in ONE hour&quot;, I like it and actually I had done the same when I was new in google.

I have some pages indexed in google for the top ranking. 

I am afraid if you would allow or no but can we have a 2 way linking to each others blog. My blog address is:

http://blog.pakcoders.com

Put the keywords &quot;How to build Ajax AutoSuggest&quot; and you will see my blog on the second ranking and it has been there since months.

Thanks, waiting for your reply.</description>
		<content:encoded><![CDATA[<p><code>Hi I read an article of yours on sitereference.com titled &#8220;How to get indexed by Google in ONE hour&#8221;, I like it and actually I had done the same when I was new in google.</p><p>I have some pages indexed in google for the top ranking. </p><p>I am afraid if you would allow or no but can we have a 2 way linking to each others blog. My blog address is:</p><p><a href="http://blog.pakcoders.com" rel="nofollow">http://blog.pakcoders.com</a></p><p>Put the keywords &#8220;How to build Ajax AutoSuggest&#8221; and you will see my blog on the second ranking and it has been there since months.</p><p>Thanks, waiting for your reply.</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke</title>
		<link>http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/comment-page-1/#comment-610</link>
		<dc:creator>Luke</dc:creator>
		<pubDate>Tue, 21 Apr 2009 13:44:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.endyourif.com/?p=214#comment-610</guid>
		<description>what Abba and Derick said. But not what the others said - babies who need demos and can&#039;t read reasonably laid out code should get a grip. I don&#039;t see their blogs informing people! Bah. 

nice article. There was an aritcle before about doing similar thing with ext-js. JQuery is more common now, so intresting.</description>
		<content:encoded><![CDATA[<p><code>what Abba and Derick said. But not what the others said &#8211; babies who need demos and can&#8217;t read reasonably laid out code should get a grip. I don&#8217;t see their blogs informing people! Bah. </p><p>nice article. There was an aritcle before about doing similar thing with ext-js. JQuery is more common now, so intresting.</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derick Ng</title>
		<link>http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/comment-page-1/#comment-263</link>
		<dc:creator>Derick Ng</dc:creator>
		<pubDate>Wed, 18 Mar 2009 09:37:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.endyourif.com/?p=214#comment-263</guid>
		<description>Yeah, as what Abba mentioned by including the RequestHandler component, you can check for an Ajax request using &lt;code&gt;$this-&gt;RequestHandler-&gt;isAjax()&lt;/code&gt;. The other thing to note is that the RequestHandler component will automatically check for Ajax headers and set the layout to &quot;ajax&quot;. So one step saved as well. ;)</description>
		<content:encoded><![CDATA[<p><code>Yeah, as what Abba mentioned by including the RequestHandler component, you can check for an Ajax request using </code><code>$this-&gt;RequestHandler-&gt;isAjax()</code>. The other thing to note is that the RequestHandler component will automatically check for Ajax headers and set the layout to &#8220;ajax&#8221;. So one step saved as well. <img src='http://www.endyourif.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abba Bryant</title>
		<link>http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/comment-page-1/#comment-39</link>
		<dc:creator>Abba Bryant</dc:creator>
		<pubDate>Fri, 13 Mar 2009 17:46:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.endyourif.com/?p=214#comment-39</guid>
		<description>Instead of abusing named params use the RequestHandler to check for ajax ( it uses XhttpRequestedWith header I believe - supported by mootools, jquery, prototype that I know of )</description>
		<content:encoded><![CDATA[<p><code>Instead of abusing named params use the RequestHandler to check for ajax ( it uses XhttpRequestedWith header I believe &#8211; supported by mootools, jquery, prototype that I know of )</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Štěpán Pilař</title>
		<link>http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/comment-page-1/#comment-37</link>
		<dc:creator>Štěpán Pilař</dc:creator>
		<pubDate>Fri, 13 Mar 2009 14:27:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.endyourif.com/?p=214#comment-37</guid>
		<description>I&#039;ve been forced to switch from Protoype + script.aculo.us to jQuery and this seems like an useful tip how create the functionality I like.

But! But I have to agree with Adam that lack of examples is the reason why I just quickly scrolled through your post. Usually I even don&#039;t bother myself with trying to read because as soon as I realize which blog this is (having the most common WP skin makes the site easily forgettable) I close the tab with the thought &quot;This is the blog without examples, doesn&#039;t worth reading&quot;.</description>
		<content:encoded><![CDATA[<p><code>I&#8217;ve been forced to switch from Protoype + script.aculo.us to jQuery and this seems like an useful tip how create the functionality I like.</p><p>But! But I have to agree with Adam that lack of examples is the reason why I just quickly scrolled through your post. Usually I even don&#8217;t bother myself with trying to read because as soon as I realize which blog this is (having the most common WP skin makes the site easily forgettable) I close the tab with the thought &#8220;This is the blog without examples, doesn&#8217;t worth reading&#8221;.</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ruben cabagti</title>
		<link>http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/comment-page-1/#comment-36</link>
		<dc:creator>ruben cabagti</dc:creator>
		<pubDate>Fri, 13 Mar 2009 09:14:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.endyourif.com/?p=214#comment-36</guid>
		<description>I&#039;ve been looking for this before but now it came out. Thanks.</description>
		<content:encoded><![CDATA[<p><code>I&#8217;ve been looking for this before but now it came out. Thanks.</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamie</title>
		<link>http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/comment-page-1/#comment-34</link>
		<dc:creator>Jamie</dc:creator>
		<pubDate>Thu, 12 Mar 2009 11:39:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.endyourif.com/?p=214#comment-34</guid>
		<description>I was going to place an online demo, but I was afraid people would abuse it and write offensive things that would offend others.</description>
		<content:encoded><![CDATA[<p><code>I was going to place an online demo, but I was afraid people would abuse it and write offensive things that would offend others.</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/comment-page-1/#comment-33</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Thu, 12 Mar 2009 05:56:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.endyourif.com/?p=214#comment-33</guid>
		<description>I personally know how much effort is required to publish an article like this, however you should put in the extra effort and have a working online example to help people visualise what you&#039;re talking about.

Best of luck for your future articles!</description>
		<content:encoded><![CDATA[<p><code>I personally know how much effort is required to publish an article like this, however you should put in the extra effort and have a working online example to help people visualise what you&#8217;re talking about.</p><p>Best of luck for your future articles!</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>
