I'm not sure to get *exactly* what you are planning.
For ajax, you have to have a div with an id, it probably works also with
table rows.
<div id="myajaxnaming"></div>
in view you can fire the ajax call :
In one of my scripts I have:
link version :
<?php echo
$ajax->link('Delete','/slideshows/delete/'.$slideshow['Slideshow']['id'],
array('update'=>"myajaxnaming",
'complete'=>"standardistaTableSorting.init();")) ?>
first param is the lable,the second is the controller called.
For the third param, the array key 'update' gets the id of the div your
want to update, and 'complete' there is a javascript function to be
called.
button version :
<?php echo $ajax->submit('Save', array()); ?>
and you have to make an ajax form:
<?php echo $ajax->form('/slideshows/edit', 'post', array())?>
Does this help you ?
olivvv
Carlos Mauricio Samour wrote:
> In my view I have a form that contains ta table with the following data.
> <table id = "tabla_deposito">
> <tr>
> <td>
> <- I am using a select tag that usaes a array called $ctas I passed
> from my controller. -->
> <? echo $html->selectTag('Deposit/acct_id',
> $ctas,$html->tagValue('Deposit/acct_id')); ?>
> </td>
> <td><? echo $html->input('Deposit/quantity');?> <td>
> <td>< -- In here I want to add a link or button that creates a new row
> with the same elements as the this row. -->></td>
> </tr>
>
> </table>
> I know by using ajax it sould be easy.
> I created an acction in my controller called get_Accounts() doing this.
> function get_Accounts(){
>
> $this->set('ctas', $this->Deposit->Accounts->generateList());
>
> }
> I know how to create a new row using DOM.
> The problem is that I don't know how to implement the $html->selectTag
> inside my javascript.
>
> 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
-~----------~----~----~----~------~----~------~--~---