<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Howto use the Ext JS Treeview (Ext.tree) with Ruby on Rails</title>
	<link>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Thu, 09 Sep 2010 12:54:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: Martin Rehfeld</title>
		<link>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-45117</link>
		<pubDate>Sun, 12 Oct 2008 19:56:48 +0000</pubDate>
		<guid>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-45117</guid>
					<description>@baddog/#19: I think you spoke a bit too soon. As Alex and Phillip already pointed out in comment #15 and #18, the newly introduced Rails default of ActiveRecord::Base.include_root_in_json broke the original code as the JSON gets nested one level deeper than the TreeLoader can work with. I have just updated the above model code as Alex suggested, so we are good to go even with Rails 2.1's defaults now.
Regarding a potential deprecation of add_child in acts_as_nested set: That's incorrect information - the whole act_as_nested_set has been moved out of Rails core into a separate plugin, which might be the reason why certain API references list that method as deprecated.

HTH,
Martin</description>
		<content:encoded><![CDATA[<p>@baddog/#19: I think you spoke a bit too soon. As Alex and Phillip already pointed out in comment #15 and #18, the newly introduced Rails default of ActiveRecord::Base.include_root_in_json broke the original code as the JSON gets nested one level deeper than the TreeLoader can work with. I have just updated the above model code as Alex suggested, so we are good to go even with Rails 2.1&#8217;s defaults now.<br />
Regarding a potential deprecation of add_child in acts_as_nested set: That&#8217;s incorrect information - the whole act_as_nested_set has been moved out of Rails core into a separate plugin, which might be the reason why certain API references list that method as deprecated.</p>
<p>HTH,<br />
Martin
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: baddog</title>
		<link>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-45113</link>
		<pubDate>Sun, 12 Oct 2008 19:12:08 +0000</pubDate>
		<guid>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-45113</guid>
					<description>This howto is almost completely our of date.  addChild has been deprecated.  The id returned by the tree control is not an integer, so the rest of the code doesn't work.  Is there an update somewhere that I missed?
-bd</description>
		<content:encoded><![CDATA[<p>This howto is almost completely our of date.  addChild has been deprecated.  The id returned by the tree control is not an integer, so the rest of the code doesn&#8217;t work.  Is there an update somewhere that I missed?<br />
-bd
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Phillip Oertel</title>
		<link>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-41954</link>
		<pubDate>Thu, 14 Aug 2008 00:03:43 +0000</pubDate>
		<guid>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-41954</guid>
					<description>regarding Rails 2.1 and Category.include_root_in_json:

including the root node in the JSON serialization is a new default for rails (see config/initializers/new_rails_defaults). but that breaks the example, so this default has to be set to false.

i think the cleanest way to do this is adding 
ActiveRecord::Base.include_root_in_json = false 
to environment.rb.

phillip</description>
		<content:encoded><![CDATA[<p>regarding Rails 2.1 and Category.include_root_in_json:</p>
<p>including the root node in the JSON serialization is a new default for rails (see config/initializers/new_rails_defaults). but that breaks the example, so this default has to be set to false.</p>
<p>i think the cleanest way to do this is adding<br />
ActiveRecord::Base.include_root_in_json = false<br />
to environment.rb.</p>
<p>phillip
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Pauli</title>
		<link>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-39341</link>
		<pubDate>Tue, 22 Jul 2008 22:50:45 +0000</pubDate>
		<guid>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-39341</guid>
					<description>The following tutorial is EXT JS vs CakePHP, but it implements drag and drop -- it will be helpful for most Rubists to read it, because the corresponding Ruby should be relatively easy to figure out.

http://blogs.bigfish.tv/adam/2008/02/12/drag-and-drop-using-ext-js-with-the-cakephp-tree-behavior/

PS. I'm not affiliated with the site, just found it first, before this one</description>
		<content:encoded><![CDATA[<p>The following tutorial is EXT JS vs CakePHP, but it implements drag and drop &#8212; it will be helpful for most Rubists to read it, because the corresponding Ruby should be relatively easy to figure out.</p>
<p><a href='http://blogs.bigfish.tv/adam/2008/02/12/drag-and-drop-using-ext-js-with-the-cakephp-tree-behavior/' rel='nofollow'>http://blogs.bigfish.tv/adam/2008/02/12/drag-and-drop-using-ext-js-with-the-cakephp-tree-behavior/</a></p>
<p>PS. I&#8217;m not affiliated with the site, just found it first, before this one
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: jaigouk</title>
		<link>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-38517</link>
		<pubDate>Tue, 08 Jul 2008 15:06:08 +0000</pubDate>
		<guid>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-38517</guid>
					<description>WOW. Thanks for this great tutorial.
And as Alex said, that one line is needed to run on Rails2.1.</description>
		<content:encoded><![CDATA[<p>WOW. Thanks for this great tutorial.<br />
And as Alex said, that one line is needed to run on Rails2.1.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Alex Tugarev</title>
		<link>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-36562</link>
		<pubDate>Sat, 21 Jun 2008 07:26:31 +0000</pubDate>
		<guid>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-36562</guid>
					<description>Thank you for this tutorial!

I've just started using Ext with Rails and I like it. But I had some stones on my way following this tutorial. Because I've started my last app with the latest 2.1 version of Rails and the output was broken I had to make some research for differences of Rails versions.

You have to insert this code line
&lt;code&gt;
# add to model/category.rb
Category.include_root_in_json = false
&lt;/code&gt;
to run on Rails 2.1.

Or maybe you have a better idea how to use the changed to_json methode?

Thanks 
Alex</description>
		<content:encoded><![CDATA[<p>Thank you for this tutorial!</p>
<p>I&#8217;ve just started using Ext with Rails and I like it. But I had some stones on my way following this tutorial. Because I&#8217;ve started my last app with the latest 2.1 version of Rails and the output was broken I had to make some research for differences of Rails versions.</p>
<p>You have to insert this code line<br />
<code><br />
# add to model/category.rb<br />
Category.include_root_in_json = false<br />
</code><br />
to run on Rails 2.1.</p>
<p>Or maybe you have a better idea how to use the changed to_json methode?</p>
<p>Thanks<br />
Alex
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: martin.rehfeld</title>
		<link>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-25667</link>
		<pubDate>Tue, 19 Feb 2008 12:15:51 +0000</pubDate>
		<guid>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-25667</guid>
					<description>@#13/Vipin: Maybe you could look into using a Ext state provider, i.e.
&lt;code&gt;Ext.state.Manager.setProvider(new Ext.state.CookieProvider());&lt;/code&gt; and make the tree stateful (add &lt;code&gt;stateful:true&lt;/code&gt; to its options). I am not sure if this works out of the box but it should enable you to keep the expansion state between page reloads (if it does not work out of the box, look into tweaking &lt;code&gt;tree.stateEvents&lt;/code&gt;)</description>
		<content:encoded><![CDATA[<p>@#13/Vipin: Maybe you could look into using a Ext state provider, i.e.<br />
<code>Ext.state.Manager.setProvider(new Ext.state.CookieProvider());</code> and make the tree stateful (add <code>stateful:true</code> to its options). I am not sure if this works out of the box but it should enable you to keep the expansion state between page reloads (if it does not work out of the box, look into tweaking <code>tree.stateEvents</code>)
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Vipin</title>
		<link>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-25664</link>
		<pubDate>Tue, 19 Feb 2008 11:18:27 +0000</pubDate>
		<guid>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-25664</guid>
					<description>Hi All,

i have another problem. am loading the tree from db. when am adding a new node to the tree, i need to display it immediately. but when am refreshing the page my tree is being collapsed and root node is visible. tree.expandAll(); method expands all the nodes but i need a selected branch only (where am added the new node). how can i do it? please help me.

Thanks in advance.
Vipin</description>
		<content:encoded><![CDATA[<p>Hi All,</p>
<p>i have another problem. am loading the tree from db. when am adding a new node to the tree, i need to display it immediately. but when am refreshing the page my tree is being collapsed and root node is visible. tree.expandAll(); method expands all the nodes but i need a selected branch only (where am added the new node). how can i do it? please help me.</p>
<p>Thanks in advance.<br />
Vipin
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: martin.rehfeld</title>
		<link>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-25147</link>
		<pubDate>Mon, 11 Feb 2008 11:05:19 +0000</pubDate>
		<guid>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-25147</guid>
					<description>@Tom/#11: I'd probably just define a alternate getter named &lt;code&gt;text&lt;/code&gt; for your &lt;code&gt;name&lt;/code&gt; attribute in &lt;code&gt;category.rb&lt;/code&gt; and then change the body of &lt;code&gt;to_json_with_leaf&lt;/code&gt; to read &lt;code&gt;self.to_json_without_leaf(options.merge(:methods =&gt; [:leaf, :text]))&lt;/code&gt;. HTH</description>
		<content:encoded><![CDATA[<p>@Tom/#11: I&#8217;d probably just define a alternate getter named <code>text</code> for your <code>name</code> attribute in <code>category.rb</code> and then change the body of <code>to_json_with_leaf</code> to read <code>self.to_json_without_leaf(options.merge(:methods => [:leaf, :text]))</code>. HTH
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Tom</title>
		<link>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-25133</link>
		<pubDate>Mon, 11 Feb 2008 08:50:40 +0000</pubDate>
		<guid>http://inside.glnetworks.de/2008/01/26/howto-use-the-ext-js-treeview-exttree-with-ruby-on-rails/#comment-25133</guid>
					<description>Thank you very much for your tutorial!
Does anybody know how to change the fact that I need a &quot;text&quot;-column in my database? I would like to have a column called &quot;name&quot; to be loaded in order to display a tree's node. I haven't been able to find those config parameters.

Thank you very much in advance,
Tom</description>
		<content:encoded><![CDATA[<p>Thank you very much for your tutorial!<br />
Does anybody know how to change the fact that I need a &#8220;text&#8221;-column in my database? I would like to have a column called &#8220;name&#8221; to be loaded in order to display a tree&#8217;s node. I haven&#8217;t been able to find those config parameters.</p>
<p>Thank you very much in advance,<br />
Tom
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
