Yii Framework Forum: [EXTENSION] EJNestedTreeActions - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] EJNestedTreeActions Take the request from the jstree and save them to database. Rate Topic: -----

#1 User is offline   tydeas_dr 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 158
  • Joined: 16-April 10
  • Location:Greece

Posted 23 May 2010 - 05:21 AM

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

Extension site done.

This post has been edited by tydeas_dr: 23 May 2010 - 05:55 AM

Follow me on twitter @dmtrsslvdr
Check my *new* blog @ tumblr
0

#2 User is offline   dreammaker 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 02-July 09

Posted 26 May 2010 - 11:41 AM

Perfect!

Quote

Copy node. Node's childs will not be copied, this will be avalaible at v 0.2.

When it be released?
0

#3 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,602
  • Joined: 17-January 09
  • Location:Russia

Posted 27 May 2010 - 09:31 AM

Going to use it very soon for taxonomy trees management. Are you going to maintain it?
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#4 User is offline   tydeas_dr 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 158
  • Joined: 16-April 10
  • Location:Greece

Posted 28 May 2010 - 05:55 AM

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.
Follow me on twitter @dmtrsslvdr
Check my *new* blog @ tumblr
0

#5 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,602
  • Joined: 17-January 09
  • Location:Russia

Posted 28 May 2010 - 07:12 AM

Do you accept contributions?
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#6 User is offline   tydeas_dr 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 158
  • Joined: 16-April 10
  • Location:Greece

Posted 28 May 2010 - 11:10 AM

Off course i accept contribution, i would be glad too. Are you interested? What are you thinking?
Follow me on twitter @dmtrsslvdr
Check my *new* blog @ tumblr
0

#7 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,602
  • Joined: 17-January 09
  • Location:Russia

Posted 29 May 2010 - 03:34 AM

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.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#8 User is offline   tydeas_dr 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 158
  • Joined: 16-April 10
  • Location:Greece

Posted 29 May 2010 - 07:32 AM

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.

This post has been edited by tydeas_dr: 29 May 2010 - 03:58 PM

Follow me on twitter @dmtrsslvdr
Check my *new* blog @ tumblr
0

#9 User is offline   tydeas_dr 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 158
  • Joined: 16-April 10
  • Location:Greece

Posted 30 May 2010 - 02:17 PM

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.
Follow me on twitter @dmtrsslvdr
Check my *new* blog @ tumblr
0

#10 User is offline   dreammaker 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 02-July 09

Posted 30 May 2010 - 07:44 PM

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

#11 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,602
  • Joined: 17-January 09
  • Location:Russia

Posted 31 May 2010 - 05:33 AM

In readme:

'id'=>'id',


should be changed to

'identity'=>'id',

Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#12 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,602
  • Joined: 17-January 09
  • Location:Russia

Posted 31 May 2010 - 05:57 AM

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.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#13 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,602
  • Joined: 17-January 09
  • Location:Russia

Posted 31 May 2010 - 07:24 AM

— 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) {
  if($model===null)
    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 ?>.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#14 User is offline   tydeas_dr 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 158
  • Joined: 16-April 10
  • Location:Greece

Posted 31 May 2010 - 09:22 AM

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.

EJNestedTreeActions
==================
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:
id=1
lft=1
rgt=2
level=1
text=what_ever_you_want


All the above except the text must have this values.

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

This post has been edited by tydeas_dr: 31 May 2010 - 05:47 PM

Follow me on twitter @dmtrsslvdr
Check my *new* blog @ tumblr
0

#15 User is offline   dreammaker 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 02-July 09

Posted 05 June 2010 - 09:23 AM

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

#16 User is offline   tydeas_dr 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 158
  • Joined: 16-April 10
  • Location:Greece

Posted 05 June 2010 - 03:56 PM

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.
Follow me on twitter @dmtrsslvdr
Check my *new* blog @ tumblr
0

#17 User is offline   dreammaker 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 02-July 09

Posted 05 June 2010 - 05:07 PM

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.
0

#18 User is offline   Junior - df9 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 416
  • Joined: 24-May 09
  • Location:Brazil

Posted 16 July 2010 - 06:35 AM

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
______________________________________
Junior
df9.com.br
Linux Registered User #364954
GNU/Linux: together we're ready!
0

#19 User is offline   tydeas_dr 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 158
  • Joined: 16-April 10
  • Location:Greece

Posted 29 July 2010 - 01:35 PM

View Postscoob.junior, on 16 July 2010 - 06:35 AM, said:

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.
Follow me on twitter @dmtrsslvdr
Check my *new* blog @ tumblr
0

#20 User is offline   Junior - df9 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 416
  • Joined: 24-May 09
  • Location:Brazil

Posted 11 October 2010 - 05:43 PM

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

:)

thanks,

regards!
______________________________________
Junior
df9.com.br
Linux Registered User #364954
GNU/Linux: together we're ready!
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users