[EXTENSION] EJNestedTreeActions



Version. 0.1

Author: tydeas_dr

What EJNestedTreeActions IS and what IS NOT

EJNestedTreeActions IS NOT:

  • a nested set behavior for your model

  • a jstree extension

EJNestedTreeActions IS only a set of actions and a behavior and you as well need:

  • ENestedSetBehavior extension

  • CJstree extension Attention I have contribute some code to the CJstree extension to be functional for our need but has

not been updated it yet.So, Download from here

[size="5"]Extension site[/size] done.


When it be released?

Going to use it very soon for taxonomy trees management. Are you going to maintain it?

sorry for being late. I will maintain it until it gets a good level. Don’t know exact dates to say but i am using it to my project so i need to implement this soon :)

an issue is that i have to take a look to the jstree 1.0 version that has been released lately so i will have to do some work as contribution on CJstree too.

Do you accept contributions?

Off course i accept contribution, i would be glad too. Are you interested? What are you thinking?

Yes, I am. I’ve already tested with 1.0rc and latest CJstree seems to work without any changes.

I need to build taxonomy manager for my current project so if I’ll find any difficulties, I’ll report/fix them.

Version 0.2 Released.

@dreammaker: Give it a shot and let my know.

I have created a repository to github, read-only access:

git clone git://github.com/dmtrs/EJNestedTreeActions.git

I hope you are familiar with git.

Samdark contact me to git you write access to project, if you willing to contribute.

I am currently working on what i call inherit feature.

User when initialize the behavior will be able to select the values to be inherite from parent to son and if this inherit will work for create/copy or move.

I have mostly finished this feature but need testing. It’s in the repo under the branch ‘inherited’. I will also try to clean up the code and sorry for the fb()s ( firephp calls ) that i forgot to remove in the previous releases.

This will end up with v0.2.5 in the middle of this week.

@tydeas_dr, thx for v.02, today i’ll try to see it.

In readme:


should be changed to


Extension itself seems to be hard to use because of lack of step by step guide on how to configure the whole stack. Still trying to figure out how to configure it.

— Shows "Select a node first" even if tree is empty and I want to create a node. No way to create first node?

— Throws an exception if there is no data in tree table.

Can be fixed in EBehavior::formatNode():

public function formatNode($model) {


    return array();


— Filed to rename root node. Got an exception.

— What is fb()? Some kind of debug extension? I don’t have it so it does not work where it’s mentioned.

— Code style: it’s better to remove trailing ?>.

Not a long time, wiki in github repo is up, yiiextension site is up-to-date with and here is the 0.3beta version.

Special thanks to samdark.



Version. 0.3beta

Author: tydeas_dr

  • bugs occured fixed

  • Createroot action added, works only for hasmanyroot trees

  • Inherit feature added, check documentation

  • Multiroot trees supported

Some actions are not ready to be supported like move/copy node from root to another root and this is a ENestedSetehavior issue

  • Createorcopy action deleted ( if ever existed ).

  • Fb calls has been removed ( sorry for all that trouble ).

Or assuming you :wub:git & have installed to your workstation, do…

git clone git://github.com/dmtrs/EJNestedTreeActions.git

Known issues are here. Thanks all for the testing.

Note: you can not create a root node for single root trees,even though there a Createroot action in this release.So to use this extension you must insert a root node to database with this values as is:






All the above except the text must have this values.

And lastly, sorry for the forgotten fb calls in previous versions

How I can prepair data for sending in CJsTree from model?

Sorry had time to check this topic :)

What do you mean prepair data?

action/Render.php does take the root/s and renders them.

In version <=0.3beta you had to call render a view like example.php no sam dark wrote a widget to make our lifes easier check the repo in git cause there are some updates not in extension site yet.

I undestand my mistakes now and I see how it must work but I can get statisf… tree :)

Is there a little example of application that work? I can’t undestand what’s wrong with my code. wanna see example.

A little bit of problem I have with CJsTree, themes css isn’t registered and so on.

(EJNestedTreeActions I used from git repo).

update: Hm, a little bit of street magic helped me. I don’t know what I did. But it works now as expected :) Tomorrow I will continue testing.

hey, guys!

thanks for this so useful extension

I’ve followed all the steps you described in documentation and above but can’t see the tree itself rendered…the example.php view only renders the action buttons for me, even after I added the first node manually and setted my model property ‘hasManyRoots’ => true

No errors displayed, only Rename, Delete, Simple Create, Cut, Copy, Paste and Create Root buttons visible

Could you please give me a hint?

I’m using Yii 1.1.3r2247, Windows XP SP3, WAMP Server 2.0

Thanks in advance!

#Edit - not to forget, I’m using the sql schema provided by Samdark

Sorry for being late. I hope you have solved your issue at the moment…but will give some advices.

  1. Download latest version from github.com.

  2. Manual insertion of root does not go with hasmanyroots=>true. When you have hasmanyroots==false then you do it manually…when you have true you do it with createroot.

Please pastebin db table,related model, controller, view and share the links (please don’t paste it here) will try to do my best to help.

I am quite busy lately so i don’t check this thread soon. You can join #yii at freenode and try to reach me i am most of the time there.

hey, guys!

I’m trying to move a root node inside another root node and I’m getting the folowing error:

Fatal error: Call to a member function getAttribute() on a non-object in /home/ofertagora/public_html/protected/extensions/EJNestedTreeActions/actions/Movenode.php

moving leaves is working

I’m not sure but the problem seems to call parent() for a root node which results in non object…so the subsequent call fails…i’m saying this because i ran into problems when calling ->parent() for a root node in another form

ps. yes, i can create another node inside the root with the same name, but in this case, i have 25 subnodes inside the node that is supposed to be moved