Hi Alberto,

You need to put the collection in as an array for each item with the
id and the displayed name as below:

<td>
  <div id="edit">
    <?php echo $car['Manufacturer']['name']?>
  </div>
</td>
<?php echo $ajax->editor(
  'edit',
  '/cars/ajax_update/' . $car['Car']['id'],
  array(
    'update' => 'edit',
    'type' => 'synchronous',
    'collection' => array(
      array($id, 'Ferrari'),
      array($id, 'Lamborghini')
    )
  ); ?>

Si

On Sep 19, 1:48 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm using an AJAX in-place-editor inside my project; it's the standard
> one provided by Cake and Scriptacolous; I have a problem: I have to
> use a collection of elements inside a SelectBox. Here's the code:
>
> <td><div id="edit"><?php echo $car['Manufacturer']['name']?></div></
> td>
> <?php echo $ajax->editor('edit', '/cars/ajax_update/' . $car['Car']
> ['id'], array('update' => 'edit', 'type' => 'synchronous',
> 'collection' => array('Ferrari', 'Lamborghini'))); ?>
>
> Where I have the "array('Ferrari','Lamborghini')" I need to have the
> value associated with the ID, not only the value; I looked @
> Scriptacolous Wiki and it says that the collection should be like
> this:
>
> [[1, Ferrari], [2, Lamborghini]]
>
> but how can I do this in Cake?
>
> Thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to