hi,
i downloaded and tested the ajax example from http://demo.grahambird.co.uk/tasks
everything works fine. now im trying to do the same with a table.
after clicking on 'Add task' a new row should be added to the table.
could anyone help me out? it works fine with divs but not with a table
thanks
pete
CONTROLLER
var $helpers = array('Html','Javascript','Ajax','Form');
function add()
{
$this->Project->saveProject();
$this->set('data', $this->Project->findAll());
$this->render('todo', 'ajax');
}
VIEW
<div id="add_task">
<form onSubmit="return false;">
<?php
print $html->input('Task/title', array('id' => 'add_input'));
print $ajax->submit('Add task', array('url' => 'add',
'update'=>'tasks_todo'));
?>
</form>
</div>
<table border="1" width="100%">
<?
foreach ($data as $row)
{
$item = $row['Project'];
?>
<tr>
<td><? echo $item['ProjectTitle']; ?></td>
</tr>
<?
}
?>
</table>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---