Cannot add new row

Cannot add new row

lulrichlulrich Posts: 2Questions: 0Answers: 0
edited June 2013 in General
http://www.culvervdi.org/Annualmeetingagendas/agendalist/2

(I develop using cakePHP)
Below is the agendalist code (it is a .ctp file b/c of cake but it is really just a segment of html)
The "/Annualmeetingagendas/add" link in sAddURL works fine in that the data gets added into the database and the id of the new record gets returned, but the problem is that a new row never is added. If the returned id is 91 then a "9" goes in column 1 and a "1" goes in column 2. I have spent a number of hours trying to figure this out.
The error I usually get is: DataTables warning (table id = 'agenda'): Requested unknown parameter '2' from the data source for row 34
this error is routinely commented upon via Google, but it seems I have the right number of column headings.
(I can edit and delete with no difficulty)

Any thoughts would be most tremendously appreciated.

SECTION 1: (just to show what code is being pulled in)
<?php
$this->Html->css('http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css', null, array('inline' => false));
$this->Html->css('http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css', null, array('inline' => false));
$this->Html->script('http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js', array('inline' => false));
$this->Html->script('http://code.jquery.com/ui/1.10.3/jquery-ui.js',array('inline'=>false));
$this->Html->script('jquery/jquery.jeditable', array('inline' => false));
$this->Html->script('jquery/jquery.validate.min', array('inline' => false));
$this->Html->script('jquery/jquery.dataTables.editable', array('inline' => false));
?>

SECTION 2: (here is the trouble...and the link at the top of the page has this code to build it)
AddDelete



<?php echo __('Date');?>
<?php echo __('Time');?>
<?php echo __('Agenda title');?>
<?php echo __('Speaker');?>
<?php echo __('Comment');?>
<?php echo __('Display?');?>




<?php
foreach ($meetingagendas as $key=>$meetingagenda)
{
echo "";
echo "".$meetingagenda['Annualmeetingagenda']['date']."";
echo "".$meetingagenda['Annualmeetingagenda']['time']."";
echo "".$meetingagenda['Annualmeetingagenda']['event_title']."";
echo "".$meetingagenda['Annualmeetingagenda']['speaker']."";
echo "".$meetingagenda['Annualmeetingagenda']['comment1']."";
echo "".(($meetingagenda['Annualmeetingagenda']['display'])?"Yes":"No")."";
echo "";
}
?>




<?php echo __('Date');?>
<?php echo __('Time');?>
<?php echo __('Agenda title');?>
<?php echo __('Speaker');?>
<?php echo __('Comment');?>
<?php echo __('Display?');?>










<!--name on the input box is what writes to the database. id is what connects to the column name, but I thought the rel tag was for that-->


Date
Time
Title
Speaker
Comment
Display
Yes
No





var oTable;
$(document).ready(function() {
oTable = $('#agenda').dataTable({
iDisplayLength: 10,
"aoColumns":
[
{"sName":"date"},
{"sName":"time"},
{"sName":"event_title"},
{"sName":"speaker"},
{"sName":"comment1"},
{"sName":"display"}
]
}).makeEditable({
sUpdateURL: "/Annualmeetingagendas/updatefield_ajax",
sAddURL: "/Annualmeetingagendas/add",
sDeleteURL: "/Annualmeetingagendas/deleterow_ajax",
"aoColumns":
[
{tooltip: "Double click to edit"},
{tooltip: "Double click to edit "},
{tooltip: " Double click to edit"},
{tooltip: "Double click to edit "},
{tooltip: "Double click to edit"},
{
tooltip: 'Double click to edit ',
type: 'select',
data: "{'1':'Yes','0':'No'}",
onblur: 'submit'
}
]
});
})
This discussion has been closed.