CakePhp 2.x Generate tree for Tree Behavior?

2016-01-10 Thread Sam Clauw
A very simple question: is there a way to get an associative array with tree nodes build with CakePHP's Tree Behavior? I can only find a method that output an array to use in a dropdown field <http://api.cakephp.org/2.4/class-TreeBehavior.html#_generateTreeList>... -- Like Us

Re: cakephp tree behavior + ext js (drag and drop)

2014-12-03 Thread Lorne Dudley
directory app/webroot/ which was produced from the zip file. Can you help me get past this point ? Regards Lorne Dudley On Monday, February 11, 2008 8:04:19 PM UTC-5, Adam Royle wrote: > > Hi all, > > I have just finished writing a tutorial that explains how to use the > Tre

Re: cakephp tree behavior + ext js (drag and drop) (can you provide some new version to work with cakephp 2.x)

2014-12-02 Thread imran guher
hi, This one is really nice , I tried to use but could not , mau be becouse of cakephp version 2.5, so can you provide some new version to use with cakephp 2.x On Friday, February 15, 2008 5:04:55 AM UTC+5, Adam Royle wrote: > > Sounds like you've got problems with your install. I have just test

Re: 3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread José Lorenzo
I cannot reproduce this issue. What PHP version do you have? Can you paste the the contents of the line where it is throwing the fatal error? On Friday, July 11, 2014 2:28:11 PM UTC+2, Michael Houghton wrote: > > Hey Jose > > Here it is: > https://gist.github.com/cakecoded/59511a440dfb9c5c7628 >

Re: 3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread Michael Houghton
Hey Jose Here it is: https://gist.github.com/cakecoded/59511a440dfb9c5c7628 On Friday, July 11, 2014 12:44:56 PM UTC+1, José Lorenzo wrote: > > Can you gist your full code, I have no idea what that error is. > > On Friday, July 11, 2014 11:49:40 AM UTC+2, Michael Houghton wrote: >> >> Thanks Jose

Re: 3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread José Lorenzo
Can you gist your full code, I have no idea what that error is. On Friday, July 11, 2014 11:49:40 AM UTC+2, Michael Houghton wrote: > > Thanks Jose - that seems to be it! It might be worth updating the Tree > docs to show this. > > Unfortunately, that is still giving me the error: > > *Error: * F

Re: 3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread Michael Houghton
Thanks Jose - that seems to be it! It might be worth updating the Tree docs to show this. Unfortunately, that is still giving me the error: *Error: * Function name must be a string *File* /home/michael/public_html/bettornet/vendor/cakephp/cakephp/src/Collection/Iterator/TreePrinter.php Any

Re: 3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread José Lorenzo
wrote: > > Hey Jose > > Sure thing. This seems like a similar issue that I had with: > > $this->Models->findByField($name)->first(); > > If you recall, I missed the -> first() and was trying: > > $this->Models->findByField($name); > > Which just

Re: 3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread Michael Houghton
Hey Jose Sure thing. This seems like a similar issue that I had with: $this->Models->findByField($name)->first(); If you recall, I missed the -> first() and was trying: $this->Models->findByField($name); Which just gives a whole lot of data on the schema. With the t

Re: 3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread José Lorenzo
Not sure what you mean with " It isn't returning a list at all." Can you explain? On Friday, July 11, 2014 9:47:27 AM UTC+2, Michael Houghton wrote: > > I am using the 3.0 Tree Behavior. > > I have the following from the docs: > > $pages = $this-&

3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread Michael Houghton
I am using the 3.0 Tree Behavior. I have the following from the docs: $pages = $this->Pages->find('treeList'); http://book.cakephp.org/3.0/en/core-libraries/behaviors/tree.html This just doesn't feel right. It isn't returning a list at all. Should I be doing som

Re: Posting to the top of the tree using the Tree Behavior

2013-12-03 Thread Justin Thomas
asily done. Thanks. On Tuesday, December 3, 2013 5:38:20 AM UTC-6, AD7six wrote: > > > > On Monday, 2 December 2013 19:22:14 UTC+1, Justin Thomas wrote: >> >> I'm using the Tree Behavior in one of my models. When a new record is >> added by default it post the

Re: Posting to the top of the tree using the Tree Behavior

2013-12-03 Thread AD7six
On Monday, 2 December 2013 19:22:14 UTC+1, Justin Thomas wrote: > > I'm using the Tree Behavior in one of my models. When a new record is > added by default it post the new record at the bottom of the tree. What I > need it to do is post the new record at the top of the tre

Posting to the top of the tree using the Tree Behavior

2013-12-03 Thread Justin Thomas
I'm using the Tree Behavior in one of my models. When a new record is added by default it post the new record at the bottom of the tree. What I need it to do is post the new record at the top of the tree. I've looked at the documentation and I don't see anything to chan

Using Tree behavior with Postgres database

2013-05-10 Thread Alex Bovey
Hi all, I am using Postgres for the first time and I am running into problems when using the Tree behavior on my Page model. I am familiar with the Tree behavior and have used it many times with MySQL so I know my pages table is set up correctly. I can insert new records and the lft, rght and

Translate- and Tree-behavior working together

2013-04-22 Thread Lucky1968
Hi, Can anyone tell me how to make the Translate- and Tree-behavior work together with a minimum of code? Especially when the $displayField is translated too. As I found out the Translate behavior doesn't fetch translated field values from 'related' tables. And with the Tr

tree behavior in cakephp

2013-03-28 Thread vinu
Hi All, i need to display a tree structure in cake php , where a user should be able to cope one child and add that child to any of the other nodes. for better understanding please see the attached file. Can any bady help me with this please its very urgent for me..!! Thanks in advance..!!

Re: Tree Behavior - only enable leaves in select dropdown

2012-05-27 Thread lowpass
with some of > the options disabled (all but leaves) - but I'm not really sure how to go > about doing that. I went through the options of generateTreeList(), > find('threaded') and any other available methods of the Tree Behavior. Nor > do I see options for disabling eleme

Re: Tree Behavior - only enable leaves in select dropdown

2012-05-27 Thread r4zv4n
tructure, as some category names can be ambigous > (e.g. repeated for men / women). > > The way I imagined this was to generate a select dropdown, but with some > of the options disabled (all but leaves) - but I'm not really sure how to > go about doing that. I went through the option

Tree Behavior - only enable leaves in select dropdown

2012-05-27 Thread r4zv4n
y sure how to go about doing that. I went through the options of generateTreeList(), find('threaded') and any other available methods of the Tree Behavior. Nor do I see options for disabling elements of a select in the Form Helper. Which way would you suggest I go? Thanks! -- Our

Re: Tree Behavior Issue

2012-04-27 Thread Michael Gaiser
Yep... that would cause an issue. Thanks. On Fri, Apr 27, 2012 at 9:12 PM, lowpass wrote: > public $actsAs = array('Tree'); > > Notice the lowercase s you left out. > > On Fri, Apr 27, 2012 at 7:39 PM, Michael Gaiser wrote: >> I want to use the Tree Behavior on

Re: Tree Behavior Issue

2012-04-27 Thread lowpass
public $actsAs = array('Tree'); Notice the lowercase s you left out. On Fri, Apr 27, 2012 at 7:39 PM, Michael Gaiser wrote: > I want to use the Tree Behavior on one of my models in 2.1, but it has > multiple belongsTo relationships which I think is messing it up. > > In

Tree Behavior Issue

2012-04-27 Thread Michael Gaiser
I want to use the Tree Behavior on one of my models in 2.1, but it has multiple belongsTo relationships which I think is messing it up. In my domain model I have added: public $actAs = array('Tree'); In my controller I have: public function index() { $data = $this->Domain->

problim in getting array from a category that made by tree behavior

2012-03-19 Thread reza
This post was updated on Mar 19, 2012; 8:17pm. Hi all :) first of all sry for my awful English ... :P i made 3 tables ( categories_products , categories , products ) category model works by tree behavior and i want to add a product and save categories that i select in add.ctp but i cant

Re: how to use tree behavior to build multilevel menu category

2011-12-03 Thread Tilen Majerle
f has any children and display it :) -- Lep pozdrav, Tilen Majerle http://majerle.eu 2011/12/3 ahmed fakher > i want to build nav menu from main and subcategory,,i tried more > things and choose tree behavior,,the problem is how to use The > extracted data to build dropdown menu lik

how to use tree behavior to build multilevel menu category

2011-12-03 Thread ahmed fakher
i want to build nav menu from main and subcategory,,i tried more things and choose tree behavior,,the problem is how to use The extracted data to build dropdown menu like this categories/index.ctp link("Add Category",array('action'=>'add')); echo "&q

Re: Saving ARO taking around 10 seconds, processing tree behavior.

2011-05-31 Thread Tufla
nt, has became really > > > > > slow. It is taking around 10 seconds exactly in the point where the > > > > > save is made: > > > > > > $aro->save(array( > > > > >          'model'=>$model, > > > > >          'foreign_key&#

Re: Saving ARO taking around 10 seconds, processing tree behavior.

2011-05-30 Thread Shaz
gt; > slow. It is taking around 10 seconds exactly in the point where the > > > > save is made: > > > > > $aro->save(array( > > > >          'model'=>$model, > > > >          'foreign_key'=>$id, > > > >  

Re: Saving ARO taking around 10 seconds, processing tree behavior.

2011-05-30 Thread Tufla
a user creates an account, has became really > > > slow. It is taking around 10 seconds exactly in the point where the > > > save is made: > > > > $aro->save(array( > > >          'model'=>$model, > > >          'foreign_key'

Re: Saving ARO taking around 10 seconds, processing tree behavior.

2011-05-27 Thread Tufla
as became really > > slow. It is taking around 10 seconds exactly in the point where the > > save is made: > > > $aro->save(array( > >          'model'=>$model, > >          'foreign_key'=>$id, > >          'parent_id'=>

Re: Saving ARO taking around 10 seconds, processing tree behavior.

2011-05-26 Thread Jeremy Burns | Class Outfit
id'=>$parent_id, > 'alias'=>$alias) > ); > > More in deeply, the most time is spent processing the tree behavior in > the _setParent(...) method. > > What can I do to improve the process performance ? Could it be an > issue in

Saving ARO taking around 10 seconds, processing tree behavior.

2011-05-26 Thread Tufla
gt;save(array( 'model'=>$model, 'foreign_key'=>$id, 'parent_id'=>$parent_id, 'alias'=>$alias) ); More in deeply, the most time is spent processing the tree behavior in the _setParent(...) method. What can

Re: Please help me! almost got crazy...with Tree behavior..

2011-01-31 Thread Jeremy Burns | Class Outfit
He was getting errors when calling a Tree helper method. As the array of helpers was set up incorrectly ($actAs instead of $actsAs) the helper wasn't loaded, so the method failed. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 31 Jan 2011, at 13:19, rahul j

Re: Please help me! almost got crazy...with Tree behavior..

2011-01-31 Thread rahul jeevan
hi wat is the actual problem On Mon, Jan 31, 2011 at 11:15 AM, Jeremy Burns | Class Outfit < jeremybu...@classoutfit.com> wrote: > He had $actAs instead of $actsAs, so the behaviour wasn't loading. It's a > common mistake. > > > Jeremy Burns > *Class Outfit* > * > * > jeremybu...@classoutfit.com

Re: Please help me! almost got crazy...with Tree behavior..

2011-01-30 Thread Jeremy Burns | Class Outfit
He had $actAs instead of $actsAs, so the behaviour wasn't loading. It's a common mistake. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 29 Jan 2011, at 11:59, satya prakash wrote: > YOU ARE CHECH IN MODEL QUERYES AND CHECK SYNTAX ; OR ' OR " . THESE SOULD

Re: Please help me! almost got crazy...with Tree behavior..

2011-01-30 Thread satya prakash
YOU ARE CHECH IN MODEL QUERYES AND CHECK SYNTAX ; OR ' OR " . THESE SOULD BE CHECK -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsu

Re: Video : Tree Behavior & Jquery

2011-01-29 Thread Meroe Meroe
Thanks for taking the time to do this! On Thu, Jan 27, 2011 at 4:46 AM, Azril Nazli wrote: > URL : > http://azrilnazli.blogspot.com/2011/01/video-cakephp-tree-behavior.html > > In this video ( no audio narration ), I wrote a simple CMS that using > Tree Behavior . > - add

Re: Please help me! almost got crazy...with Tree behavior..

2011-01-29 Thread raymond
Thanks for your reply. I got this answer already when I posted this kind of article again to this group. You see, I posted this article about 3 days ago, and just now I read this. Too slow to be posted...:( -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Chec

Re: Please help me! almost got crazy...with Tree behavior..

2011-01-29 Thread Jeremy Burns | Class Outfit
and dunno why, so I m > writing the post again. > > I just used Tree behavior for category, according to what cakePHP > manual said. > But when I used generatetreelist(), it all times says following: > > Warning (512): SQL Error: 1064: You have an error in your SQL syntax;

Re: Tree behavior does not work!!!

2011-01-29 Thread raymond
oh... stupid mistake.. thanks a lot. On Jan 28, 5:04 pm, Jeremy Burns | Class Outfit wrote: > It's $actsAs, not $actAs. > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with t

Please help me! almost got crazy...with Tree behavior..

2011-01-29 Thread raymond
Hi, everyone. This is second time to post with this kind of content to this group. My first time post was gone, never appears, and dunno why, so I m writing the post again. I just used Tree behavior for category, according to what cakePHP manual said. But when I used generatetreelist(), it all

Re: Tree behavior does not work!!!

2011-01-28 Thread Jeremy Burns | Class Outfit
r appears, and dunno why, so I m > writing the post again. > > I just used Tree behavior for category, according to what cakePHP > manual said. > But when I used generatetreelist(), it all times says following: > > Warning (512): SQL Error: 1064: You have an error in your

Tree behavior does not work!!!

2011-01-28 Thread Raymond Chester
Hi, everyone. This is second time to post with this kind of content to this group. My first time post was gone, never appears, and dunno why, so I m writing the post again. I just used Tree behavior for category, according to what cakePHP manual said. But when I used generatetreelist(), it all

Video : Tree Behavior & Jquery

2011-01-27 Thread Azril Nazli
URL : http://azrilnazli.blogspot.com/2011/01/video-cakephp-tree-behavior.html In this video ( no audio narration ), I wrote a simple CMS that using Tree Behavior . - add data - list data - edit data - delete data - tree view And to add some spice, I use jquery form validation. Maybe later I&#x

Re: Tree Behavior

2011-01-21 Thread cricket
On Fri, Jan 21, 2011 at 3:38 PM, Tilen Majerle wrote: > Tree bahavior has nothing with tree helper if i'm right... The helper is designed to make it easier to deal with the data from the behavior. @Meroe: You should be calling generate() in the view, not the controller. -- Our newest site for

Re: Tree Behavior

2011-01-21 Thread Meroe Meroe
t; > > 2011/1/21 Meroe Meroe > >> Hello folks, >> >> I'm having a bit of an issue understanding the tree behavior. I have a >> tasks table with fields such as name,status,date_due etc... >> >> The output I'm getting right now is great except I

Re: Tree Behavior

2011-01-21 Thread Tilen Majerle
Tree bahavior has nothing with tree helper if i'm right... -- Lep pozdrav, Tilen Majerle http://majerle.eu 2011/1/21 Meroe Meroe > Hello folks, > > I'm having a bit of an issue understanding the tree behavior. I have a > tasks table with fields such as name,status,d

Tree Behavior

2011-01-21 Thread Meroe Meroe
Hello folks, I'm having a bit of an issue understanding the tree behavior. I have a tasks table with fields such as name,status,date_due etc... The output I'm getting right now is great except I want to display additional data columns. Current Output: - Task 1 - Task

Re: Tree Behavior

2010-11-05 Thread cricket
On Thu, Nov 4, 2010 at 11:37 PM, Meroe wrote: > Hello folks, > > I'm working with the tree behavior and having issues getting the > results to display more than the 'name' field in my table.  I have > many additional fields that I've added and would li

Tree Behavior

2010-11-04 Thread Meroe
Hello folks, I'm working with the tree behavior and having issues getting the results to display more than the 'name' field in my table. I have many additional fields that I've added and would like to display in the view such as 'start_date','details'.

Tree Behavior for Duplicate Entries?

2010-06-29 Thread DragonFlyEye
trail or hierarchical list of these elements when there's no beginning or end? It makes sense to me that switching to a tree structure would be the preferred method to organize the data. But looking at the documentation, it seems almost as though the Tree Behavior is not setup to handle

Re: postgres & tree behavior

2010-04-23 Thread cricket
ur, and > currently the 'moveup()'/'movedown()' features are not working > > (although it appears that setting the parent directly is) > > I'm using the cake docs themselves along with this tutorial: > > http://bvirtual.nl/2009/11/easy-trees-with-tree-behavior

postgres & tree behavior

2010-04-21 Thread Chris Turner
rking (although it appears that setting the parent directly is) I'm using the cake docs themselves along with this tutorial: http://bvirtual.nl/2009/11/easy-trees-with-tree-behavior-in.html (of course I adapted the schema to match the pg standard mapping) I don't mind debugging

Re: how to retrieve using tree behavior

2010-04-12 Thread dreamingmind
Habibliah, I've been poking around the Tree behavior too as a new comer. Looking at the API for the Tree, specifically the generatetreelist() (which I assume you're asking about), it appears there is a parameter 'recursive' and you might assume this would do what you want.

[ask] how to retrieve using tree behavior

2010-04-12 Thread habibillah
Hi, i new comer in cakePHP and I try to explore Tree behavior. but I don't know how to retrieve data just for 5 level nested only. can anyone suggest me some how to or tutorial for it? -- Thanks habibillah Blog: habibillah.wordpress.com Ym!: sweetnuxer Check out the new CakePHP Questions

Tree Behavior problem

2010-02-18 Thread Bill Wilson
I've got a problem with the Tree behavior in an application I'm maintaining. The version of cakephp is 1.2.1.8004. The user wants to move a node that was already created to a node created after the node being moved. After the save is performed the old node has the same lft, rght values

Re: Tree Behavior does not work with multiple parents?

2010-02-03 Thread Jon Bennett
hi ShereWeb, > I am somewhet a newbie to CakePHP. I am trying to migrate my website > from own framework to CakePHP. Everything is wonderful until i got to > tree behavior issue for categories. I will explain a little bit what i > am trying to achieve: > > I have many catego

Tree Behavior does not work with multiple parents?

2010-02-03 Thread sphereweb
Hello, I am somewhet a newbie to CakePHP. I am trying to migrate my website from own framework to CakePHP. Everything is wonderful until i got to tree behavior issue for categories. I will explain a little bit what i am trying to achieve: I have many categories that can have multiple parent

Re: How set other fieldname for "parent_id" in Tree Behavior

2009-11-13 Thread Aldo
Thanks! That's what I was looking for. On 13 Nov., 16:19, AD7six wrote: > On 13 nov, 16:12, Aldo wrote: > > > I already did, but was not able to find an answer to my question. > > In the Tree behavior documentation there is only mentioned tu use the > > filed nam

Re: How set other fieldname for "parent_id" in Tree Behavior

2009-11-13 Thread Jeremy Burns
ut was not able to find an answer to my question. > In the Tree behavior documentation there is only mentioned tu use the > filed name "parent_id", but not how to change this setting. > > > On 13 Nov., 15:56, AD7six wrote: >> On 13 nov, 13:46, Aldo wrote: >> >

Re: How set other fieldname for "parent_id" in Tree Behavior

2009-11-13 Thread AD7six
On 13 nov, 16:12, Aldo wrote: > I already did, but was not able to find an answer to my question. > In the Tree behavior documentation there is only mentioned tu use the > filed name "parent_id", but not how to change this setting. Too fast.. Maybe I'm misunderstan

Re: How set other fieldname for "parent_id" in Tree Behavior

2009-11-13 Thread AD7six
On 13 nov, 16:12, Aldo wrote: > I already did, but was not able to find an answer to my question. > In the Tree behavior documentation there is only mentioned tu use the > filed name "parent_id", but not how to change this setting. > http://book.cakephp.org/view/227

Re: How set other fieldname for "parent_id" in Tree Behavior

2009-11-13 Thread Aldo
I already did, but was not able to find an answer to my question. In the Tree behavior documentation there is only mentioned tu use the filed name "parent_id", but not how to change this setting. On 13 Nov., 15:56, AD7six wrote: > On 13 nov, 13:46, Aldo wrote: > > > Hello

Re: How set other fieldname for "parent_id" in Tree Behavior

2009-11-13 Thread AD7six
On 13 nov, 13:46, Aldo wrote: > Hello, > > I have already a table structure for a tree, where the field > "parent_id" has another name. As other functions depend on this name I > need to tell Cakes's Tree Behavior in which field it has to look for > the parend

How set other fieldname for "parent_id" in Tree Behavior

2009-11-13 Thread Aldo
Hello, I have already a table structure for a tree, where the field "parent_id" has another name. As other functions depend on this name I need to tell Cakes's Tree Behavior in which field it has to look for the parend ID. Any idea how I can achive this? Thanks! Aldo -- Yo

Re: Tree behavior scope bug?

2009-09-16 Thread Jamie
Seriously? Nobody has experience with TreeBehavior's scope option? On Sep 15, 1:45 pm, Jamie wrote: > I'm having an issue with Cake'sTreebehavior, specifically setting ascope. > I've created a dynamic navigation system so that clients can > manage navigation lists and items via a CMS. The asso

Tree behavior scope bug?

2009-09-15 Thread Jamie
I'm having an issue with Cake's Tree behavior, specifically setting a scope. I've created a dynamic navigation system so that clients can manage navigation lists and items via a CMS. The associations look like this: NavList hasMany NavItem NavItem belongsTo NavList Simple enoug

Re: Create Dynamic Navigation Based On Tree Behavior

2009-07-29 Thread Tony Thomas
Thanks for this tip. It was exactly what I needed! On Jul 26, 7:51 pm, brian wrote: > I used this: > > http://bakery.cakephp.org/articles/view/tree-helper-1 > > My nav is an element with: > > > echo $tree->generate( >         $section_nodes, >         array( >                 'element' => 'sec

Re: Create Dynamic Navigation Based On Tree Behavior

2009-07-26 Thread brian
I used this: http://bakery.cakephp.org/articles/view/tree-helper-1 My nav is an element with: generate( $section_nodes, array( 'element' => 'sections/nav_node', 'model' => 'Section' ) ); ?> And nav_node.ctp looks like: $tree->addItemA

Create Dynamic Navigation Based On Tree Behavior

2009-07-26 Thread Tony Thomas
I have a Pages table in my app with the following fields: id parent_id lft rght title body created modified My model uses $actsAs = array('Tree') All the data associations are correct and generatetreelist() returns the appropriate values. What I'm looking for is a way to turn the tree informati

Post Model with Tree Behavior and multiple types of child post

2009-07-14 Thread matt
Hi there, Could someone help me figure out what I'm doing wrong here? I have a Post model that acts as a tree. In my model I have var $belongsTo = array( 'Parent' => array( 'className' => 'Post', 'foreignKey' => 'parent_id' ) ); var $hasMany = array( 'Child'

Tree behavior error

2009-06-25 Thread Manu
Hello, I have an error i do not understand with treebehavior. When generating the tree from the Categories controller : $this->Category->generatetreelist(null, null, null, '__'); I get a normal result : Array ( [1] => PREM [8] => __PREMprem [7] => __PREMdeux [3] => DEUX [

Re: List leafs in Tree Behavior

2009-05-31 Thread Jorge Horacio Cué Cantú
Thanks It works great!. 2009/5/31 delocalizer > > or: > TreeModel->query('SELECT * FROM model_things WHERE model_things + 1 = > model_things.rght'). > 'TreeModel' is obviously the name of your model that behaves as Tree > and 'model_things' is its db table. > > On May 31, 8:42 am, Jorge Horac

Re: List leafs in Tree Behavior

2009-05-31 Thread delocalizer
or: TreeModel->query('SELECT * FROM model_things WHERE model_things + 1 = model_things.rght'). 'TreeModel' is obviously the name of your model that behaves as Tree and 'model_things' is its db table. On May 31, 8:42 am, Jorge Horacio Cué Cantú wrote: > Hello, > > I have a system with a Model be

Re: List leafs in Tree Behavior

2009-05-31 Thread delocalizer
Hi Jorge; Easiest way is to do a find with condition that TreeModel.lft+1 = TreeModel.rght On May 31, 8:42 am, Jorge Horacio Cué Cantú wrote: > Hello, > > I have a system with a Model behaving as Tree, the question is. > I need to get a list of rows with out children meaning records that are >

List leafs in Tree Behavior

2009-05-30 Thread Jorge Horacio Cué Cantú
Hello, I have a system with a Model behaving as Tree, the question is. I need to get a list of rows with out children meaning records that are leafs in the tree. Is there a way to accomplish that? Of course It is the "brute force method", but since the tree might be very large, I rather have a mo

Re: tree behavior

2009-05-25 Thread brian
There are only moveUp() & moveDown() methods provided, which take a number of node positions to move by. On Sun, May 24, 2009 at 10:49 AM, Meisam Ganjeali wrote: > > Hello, > How I can move one tree node after one node or before one node in tree > behavior? &g

tree behavior

2009-05-24 Thread Meisam Ganjeali
Hello, How I can move one tree node after one node or before one node in tree behavior? Regards meisam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email t

Re: Nested Routing for Models with Tree Behavior

2009-02-05 Thread brian
On Thu, Feb 5, 2009 at 4:43 PM, Dwayne wrote: > > This idea seemed to work out. Basically what I needed to happen was to > allow access to multiple controllers for data objects associated with > a given page in the CMS. The data objects themselves are included in > the page through a modified req

Re: Nested Routing for Models with Tree Behavior

2009-02-05 Thread Dwayne
ular should prove > > extremely helpful. > > Keep in mind that I did that quite a while ago. It definitely needs > refactoring. > > > While I'd rather not push the find logic into one > > of my models (since that would require a route that gobbles up > > everything

Re: Nested Routing for Models with Tree Behavior

2009-02-05 Thread brian
e a route that gobbles up > everything) I'll probably end up trying something similar in the > routes file. What I'm hoping is that I'll have access to my Model at > that point (or at least be able to build the necessary access). If I > do, I'll be able to use the

Re: Nested Routing for Models with Tree Behavior

2009-02-05 Thread Dwayne
up everything) I'll probably end up trying something similar in the routes file. What I'm hoping is that I'll have access to my Model at that point (or at least be able to build the necessary access). If I do, I'll be able to use the Tree behavior to build a list of all the cu

Re: Nested Routing for Models with Tree Behavior

2009-02-04 Thread brian
catches everything and then split it up myself. I'd rather not do > that, but if I have to I can live with it. The problem I have is I'm > not sure what the best way would be to efficiently determine what page > I'm actually looking at. The pages are set up using the Tr

Nested Routing for Models with Tree Behavior

2009-02-04 Thread Dwayne
'll have to put in a route that catches everything and then split it up myself. I'd rather not do that, but if I have to I can live with it. The problem I have is I'm not sure what the best way would be to efficiently determine what page I'm actually looking at. The pages are set

Re: Batch adding records using Tree Behavior

2009-02-01 Thread mscdex
t children at the same time. If I have a multidimensional array > ('TodoChild' in the example below), is there a way to get the Tree > Behavior to use it to create the children and automatically assign > them to the proper parent? > > The only way I thought to do it was by

Batch adding children with Tree Behavior

2009-02-01 Thread mscdex
Is there a quick and easy way to generate children and have them auto- associated with the respective parent, using a multidimensional array? I have a data array structured like this (generated from a flat file): [User] => array ( [name] => John ) [Todo] => array ( [0] => array

Batch adding records using Tree Behavior

2009-02-01 Thread mscdex
ld' in the example below), is there a way to get the Tree Behavior to use it to create the children and automatically assign them to the proper parent? The only way I thought to do it was by somehow using a recursive method and doing a save on the parent first, then set the parent_id for each

Re: use tree behavior and link another model

2008-11-26 Thread austin
for those who need it, here is correct code to have in the controller: $machineParts = $this->Machine->MachinePart->generatetreelist(array ('machine_id' => $id), '{n}.Part.id', '{n}.Part.name', '-', true); $this->set('machineParts', $machineParts); --~--~-~--~~~---~-

Re: use tree behavior and link another model

2008-11-26 Thread AD7six
> models: > --- > Machine >   - hasMany MachinePart joined by machine_id > MachinePart >  - belongsTo Machine joined by machine_id >  - belongsTo Part joined by part_id > Part >  - hasMany MachinePart joined by par

use tree behavior and link another model

2008-11-26 Thread austin
dels: --- Machine - hasMany MachinePart joined by machine_id MachinePart - belongsTo Machine joined by machine_id - belongsTo Part joined by part_id Part - hasMany MachinePart joined by part_id i'm trying to use the tree beh

Re: Tree behavior problem

2008-11-15 Thread havanna
Hello, I come a little bit forward: If I activate admin routing in core.php, I got this double entries as described. If I deactivate it, everything works fine. It seams like an error in cake. Any idea? Regards Thomas On 12 Nov., 13:52, havanna <[EMAIL PROTECTED]> wrote: > Hello together, > I h

Tree behavior problem

2008-11-12 Thread havanna
Hello together, I have a problem with tree behavior. To build a menu I tried the tree behavior. For a first test I use the example from cakephp documentation. But if I do the example, I got allway more than one entry into the database. My code for the test: function insert() { // pseudo

Re: tree behavior sorting

2008-11-04 Thread Adam Royle
Here is a tutorial I wrote a while ago that does what you describe. I've only used it with <= RC2 so not sure if it will work with RC3, but I'm guessing (hoping!) it does. http://blogs.bigfish.tv/adam/2008/02/12/drag-and-drop-using-ext-js-with-the-cakephp-tree-behavior/ I did r

tree behavior sorting

2008-11-03 Thread adriaanb
Hey guys, I am using the tree behavior (first time) and got a question about sorting. I am using it for a multilevel menu system with drag&drop sortables. Everything works very nicely, but can't figure one thing out. When I sort items on the same level the parent_id doesn't chang

Re: Using the Tree behavior

2008-10-27 Thread David C. Zentgraf
t; I'm having trouble using the Tree behavior. Exactly from where do I > get the 'lft' right 'rght' values? I can't figure out what these > values could be. > > For example: > > (Parent 1) Category 1 > (Child of Parent 1) Category 1.1 > (Child o

Re: Using the Tree behavior

2008-10-27 Thread Adam Royle
The lft and rght values are populated by the tree behavior. I've written a tutorial on how to use the tree behavior with drag and drop. It also shows an example of how to populate the tree. http://blogs.bigfish.tv/adam/2008/02/12/drag-and-drop-using-ext-js-with-the-cakephp-tree-behavior/

Using the Tree behavior

2008-10-27 Thread [EMAIL PROTECTED]
I'm having trouble using the Tree behavior. Exactly from where do I get the 'lft' right 'rght' values? I can't figure out what these values could be. For example: (Parent 1) Category 1 (Child of Parent 1) Category 1.1 (Child of Parent 1) Category 1.2 (Parent 2)

Re: Set root entry in Tree Behavior and fetch children?

2008-07-02 Thread Dan Soendergaard
On Jul 2, 11:49 am, Dan Soendergaard <[EMAIL PROTECTED]> wrote: > > > > I'm doing a simple forum which should support nested replies. So, I > > > decided to use the Tree Behavior. > > > > models/forum_entry.php > > >

Re: Set root entry in Tree Behavior and fetch children?

2008-07-02 Thread Dan Soendergaard
with. Any good ideas? On Jul 2, 3:54 pm, AD7six <[EMAIL PROTECTED]> wrote: > On Jul 2, 11:49 am, Dan Soendergaard <[EMAIL PROTECTED]> wrote: > > > > > I'm doing a simple forum which should support nested replies. So, I > > decide

Re: Set root entry in Tree Behavior and fetch children?

2008-07-02 Thread AD7six
On Jul 2, 11:49 am, Dan Soendergaard <[EMAIL PROTECTED]> wrote: > I'm doing a simple forum which should support nested replies. So, I > decided to use the Tree Behavior. > > models/forum_entry.php > - &

  1   2   >