You can speficy the field to use as the value, but i think only one
field havn't tried though...
$tasks = $this->Category->generateTreeList(null, null,
'{n}.Category.status', "-");
you could make a combinded field in the model.
What i have done in the past is order by lft to get the records in
order but with the whole row available.
$categories = $this->Category->find('all',
array('order'=>array('Category.lft asc'))) ;
hth
On Oct 24, 5:32 am, MetZ <[email protected]> wrote:
> Hi...
>
> Sooo.. no suggestions?
>
> $categories = $this->Category->generatetreelist(null, null, null, '|--
> ', $recursive = -1 );
>
> Looking to retrieve the extra field "Category.published" and display
> it in my html table.
>
> Should I use another find and merge them or something?
>
> Using this in view:
> <table class="data display">
> <thead>
> <tr>
> <th
> style="text-align:center;"><?php __('Id');?></th>
> <th><?php
> __('Name');?></th>
> <th style="text-align:center;"><?php
> __('Status');?></th>
> <th
> style="text-align:center;"><?php __('Actions');?></th>
> </tr>
> </thead>
> <tbody>
> <?php $i = 0;
> foreach ($categories as $key=>$value):
> $class = null;
> if ($i++ % 2 == 0) {
> $class = 'odd';
> }
> $edit = $html->link($html->image("icons/16_icon_edit.png"),
> array('action' => 'edit', $key), array('title'=>'Endre','escape' =>
> false));
> $delete = $html->link($html->image("icons/
> 16_icon_delete.png"), array('action' => 'delete', $key),
> array('valign'=>'center','class'=>'delete_trigger','rel'=>'#error','title'=
> >'Slett','escape'
> => false));
> ?>
>
> <tr class="<?php echo $class;?> gradeA">
> <td class="center"><?php echo $key; ?></td>
> <td><?php echo $value; ?></td>
> <td class="center">N/A</td>
> <td class="center"><?php echo $edit; ?> <?php echo $delete; ?></td>
>
> </tr>
> <?php endforeach; ?>
> </tbody>
> </table>
>
> On 19 Okt, 18:48, MetZ <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hi all.
> > I am wondering how I can retrieve an extra field from my rows using
> > generatetreelist?
> > $this->data = $this->Category->generatetreelist(null, null, null,
> > ' ');
>
> > The field I am looking for is "status", to display if the category is
> > active or not.
>
> > And,, btw.. I am using generatetreelist to list all nested categories
> > in a html table with children.
> > If u know of a better way to get all categories, and to put everything
> > in an array to output in a html table, please let me know ;)
>
> > Thanks for all and any help!
> > Regards!
> > -Tom
--
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
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php