That gave me some ideas, I tried using $form->input on each table row.
But in the controller how will it process all or all the ones that are
checked?
I Googled some more and found some snippets, should I be using some
thing like this on each row:
echo $form->checkbox('Records.['.$record['Record']['id'].']',array
('deleted' => $record['Record']['deleted']));
so in my controller I can use a foreach
foreach($this->data['Records'] as $key => $value) {
if($value != 0) {
if ($this->Record->save($this->data)) {
$this->Session->setFlash(__('The Record has
been saved', true));
}
}
}
I didnt have much luck with this but I think its more the right track.
when I debug($this->data) I get
Array
(
[Records] => Array
(
[3] => 1
[17] => 1
)
)
but I think it should be some thing like this
Array
(
[Records] => Array
(
[Record] => Array
(
[id] => 6
[deleted] => 1
)
[Record] => Array
(
[id] => 17
[deleted] => 1
)
)
)
Or maybe there is a way to group them with $form->input, for
processing in the controller?
On Sep 8, 6:49 pm, WebbedIT <[email protected]> wrote:
> In your edit view you will be using the form helper which knows to
> convert tinyint(1) or bool field to a checkbox.
>
> If you are looking to add multiple checkboxes to your index view (so
> you can check multiple records) you need to edit your index view to
> include a form which would use the form helper to echo out your delete
> fields checkboxes.
>
> Don't expect baked views to do this for you as this sort of feature is
> not included in a basic baked index.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---