You could use TreeHelper to build the select list:
http://bakery.cakephp.org/articles/AD7six/2008/01/24/tree-helper-1
Read through it a few times; it's a bit confusing at first what you need to do.
Also, this code is pretty old, so you may need to update some of it for 2.x.
On Sun, May 27, 2012 at 5:15 AM, r4zv4n <razvanbrates@gmail.com> wrote:
> I have a categories tree structure (ragged) and products. With the default
> behavior (i.e. using generateTreeList() ), when adding / editing a product,
> I can assign it to categories on any level.
>
> However, I'd like to only give the user the possibility of assigning
> products to leaf level categories. I would, however, like to present the
> user with the entire tree structure, 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 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 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 unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php
--
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 unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Sunday, May 27, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment