Hi. It would be nice if lft was set as the default order by the tree behaviour, and if the documentation on it was a little bit more complete.
On May 17, 10:28 pm, brian <[email protected]> wrote: > Me again. I added 'order' => array('Section.lft' => 'ASC') to my > $filters, which did the trick. Shouldn't this be the default? > > On Sun, May 17, 2009 at 4:13 PM, brian <[email protected]> wrote: > > On Sun, May 17, 2009 at 3:37 PM, brian <[email protected]> wrote: > > >> However, it's not displaying as if it's at the bottom. Does anyone > >> know the cake shell command to display a tree structure? I'd like to > >> verify it against what my controller/view are giving me. > > > Something looks wrong here. Doing a find('threaded') is putting some > > things in the wrong place. > > > This is the code I'm using. I've simplified it somewhat but there's > > been no change. Caching is also disabled/deleted. > > > public function threaded() > > { > > $filters = array( > > 'conditions' => array('Section.parent_id IS NOT NULL'), > > 'fields' => array('*'), > > 'recursive' => -1 > > ); > > > return $this->find('threaded', $filters); > > } > > > This is the 1st of several sections. The IDs, etc. for each is printed > > below the name. If you look at "Accessories - International" (near the > > top) you'll see it's not at all where it should be. Note the lft & > > rght aren't the figures I want--this is just the result of trying to > > move it around. It looks like the 'threaded' call isn't working > > properly. > > > section 1 > > id: 2 parent_id: 1 lft: 2 rght: 51 > > > * Sales Sheets > > id: 3 parent_id: 2 lft: 3 rght: 4 > > * Sales Sheets - International > > id: 5 parent_id: 2 lft: 5 rght: 6 > > * Instruction Sheets > > id: 6 parent_id: 2 lft: 9 rght: 10 > > * Accessories - International > > id: 149 parent_id: 2 lft: 43 rght: 44 > > * Instruction Sheets - International > > id: 8 parent_id: 2 lft: 7 rght: 8 > > * Product Photography > > id: 9 parent_id: 2 lft: 11 rght: 38 > > o Kits > > id: 10 parent_id: 9 lft: 12 rght: 13 > > o Kits - Prime Vendor > > id: 11 parent_id: 9 lft: 14 rght: 15 > > o Kits - Military Retail > > id: 12 parent_id: 9 lft: 16 rght: 17 > > o Kits - International > > id: 13 parent_id: 9 lft: 18 rght: 19 > > o Lensesid: 14 parent_id: 9 lft: 20 rght: 21 > > o Lenses - Prime Vendor > > id: 15 parent_id: 9 lft: 22 rght: 23 > > o Lenses - Military Retail > > id: 16 parent_id: 9 lft: 24 rght: 25 > > o Lenses - International > > id: 17 parent_id: 9 lft: 26 rght: 27 > > o Beauty Shots > > id: 18 parent_id: 9 lft: 28 rght: 29 > > o Shotgun Lenses > > id: 19 parent_id: 9 lft: 30 rght: 31 > > o Shotgun Lenses - International > > id: 20 parent_id: 9 lft: 32 rght: 33 > > o In-Useid: 21 parent_id: 9 lft: 34 rght: 35 > > o In-Use - International > > id: 22 parent_id: 9 lft: 36 rght: 37 > > * Accessories > > id: 23 parent_id: 2 lft: 39 rght: 40 > > * Catalog Copy > > id: 24 parent_id: 2 lft: 41 rght: 42 > > * Ballistic Demonstration Video > > id: 25 parent_id: 2 lft: 45 rght: 46 > > * Online Banner Advertisements > > id: 26 parent_id: 2 lft: 47 rght: 48 > > * Catalog Copy - International > > id: 150 parent_id: 2 lft: 49 rght: 50 > > > Any ideas? > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
