# LiveTree substitute

**URL:** <https://www.ruby-forum.com/t/livetree-substitute/136749>\
**Category:** Rails\
**Created:** [May 6, 2008, 2:33am UTC](https://www.ruby-forum.com/t/livetree-substitute/136749 "2008-05-06T02:33:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![acras](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@acras](https://www.ruby-forum.com/u/acras)\
**Post date:** [May 6, 2008, 2:33am UTC](https://www.ruby-forum.com/t/livetree-substitute/136749/1 "2008-05-06T02:33:56Z")

</div>

heyah!

Is there any treeView plugin other than liveTree out there?

thanks

–  
Ricardo A.  
removed\_email\_address@domain.invalid  
Acras Sistemas  
+55+41-3232-6404  
[www.acras.net](http://www.acras.net)

---

<div class="post-metadata">

**Author:** ![acras](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@acras](https://www.ruby-forum.com/u/acras)\
**Post date:** [May 6, 2008, 6:19pm UTC](https://www.ruby-forum.com/t/livetree-substitute/136749/2 "2008-05-06T18:19:05Z")

</div>

ExtJs has a tree (in fact a whole js-based UI suite) that’s pretty  
nice. What I like most is that you can declare the tree with a url  
and let it render quickly, then query the db for the nodes and leaves.

---

<div class="post-metadata">

**Author:** ![acras](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@acras](https://www.ruby-forum.com/u/acras)\
**Post date:** [May 7, 2008, 12:21am UTC](https://www.ruby-forum.com/t/livetree-substitute/136749/3 "2008-05-07T00:21:37Z")

</div>

Do know that ExtJS has a GPL3 license and a commercial license. If you  
use it for non-open source projects, you need to pay.

On 06 May 2008, at 18:18, AndyV wrote:

> ExtJs has a tree (in fact a whole js-based UI suite) that’s pretty  
> nice. What I like most is that you can declare the tree with a url  
> and let it render quickly, then query the db for the nodes and leaves.
> 
> On May 5, 8:33 pm, “Ricardo A.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > heyah!
> > 
> > Is there any treeView plugin other than liveTree out there?

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![acras](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@acras](https://www.ruby-forum.com/u/acras)\
**Post date:** [May 16, 2008, 6:14pm UTC](https://www.ruby-forum.com/t/livetree-substitute/136749/4 "2008-05-16T18:14:05Z")

</div>

But is there any plugin to use it?  
I’ve seen this [1], but there is no much doc about it out there.

And finally, just a couple of questions regarding the facilities of  
ExtJs:

- Can I populate the tree nodes with non-AR models? And with Ruby code  
such as in LiveTree?
- Can I have leave nodes with different image icons? (yes, I need it ☹  
)

Lots of thanks.

[1]  
[http://inside.glnetworks.de/2008/01/08/ext-js-and-rails-how-do-they-get-along/](http://inside.glnetworks.de/2008/01/08/ext-js-and-rails-how-do-they-get-along/)

Peter De Berdt wrote:

> Do know that ExtJS has a GPL3 license and a commercial license. If you  
> use it for non-open source projects, you need to pay.
> 
> On 06 May 2008, at 18:18, AndyV wrote:
> 
> > ExtJs has a tree (in fact a whole js-based UI suite) that’s pretty  
> > nice. What I like most is that you can declare the tree with a url  
> > and let it render quickly, then query the db for the nodes and leaves.
> > 
> > On May 5, 8:33 pm, “Ricardo A.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> > 
> > > heyah!
> > > 
> > > Is there any treeView plugin other than liveTree out there?
> 
> Best regards
> 
> Peter De Berdt

---

<div class="post-metadata">

**Author:** ![acras](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@acras](https://www.ruby-forum.com/u/acras)\
**Post date:** [May 16, 2008, 9:49pm UTC](https://www.ruby-forum.com/t/livetree-substitute/136749/5 "2008-05-16T21:49:35Z")

</div>

@Peter – You’re right, I think they’ve changed their licensing three  
times in six months!

@Damaris – There are a couple of plugins out there for ExtJs. One of  
them focuses specifically on the grids. The other (I forget the name  
but google won’t!) is much broader but I don’t know if it deals with  
the. Like the link you provided, I took the approach of writing one  
for myself. It’s a pretty straight foward mapping between ruby hashes  
and the corresponding json.

ExtJs took a very nice hierarchical approach to their lib. I started  
by modeling their core Observable component (namespaced so it doesn’t  
conflict with scriptaculous) and then created the next layer of the  
ring by inheriting from that and adding the new attributes, and so  
on. I made pretty heavy use of class\_inheritable\_xxx (array, reader,  
etc) and a method\_missing trick similar to what Rails does to let  
content\_columns appear as valid accessors on ARec classes. The only  
reason I did this was so I could dynamically create the js necessary  
for each context, writing it all in Ruby but interacting with the  
client browser with js.

1. Yes, you can use whatever you like to populate the tree nodes. You  
can hand roll js or use any type of data source you like to build the  
nodes. Most of my trees use the “AsyncTreeNode” object for the root  
node which allows you to get the UI up quickly and then query the app  
for the nodes.

2. You can change the icon for every node if you like. One of the  
attributes is the path to the icon. Of course you can set a default  
and then only override where/if necessary.

On May 16, 12:14 pm, Damaris F. \<rails-mailing-l…@andreas-
