fnDeleteRow(anSelected[0]) Returning Undefined
fnDeleteRow(anSelected[0]) Returning Undefined

I've searched the forums for this and seen examples of others having similar issues but none seem to be calling the fnDeleteRow from within the fnDrawCallback function.
My setup... I've got a DataTable called oTableContacts which has a few rows of data from a MySQL database. I'm not loading the data through the DataTable but rather just spitting it out to a PHP page and then attaching the DataTable to it. Simple stuff so far. Each row has a "Delete" link in it assigned the "delete-contact" class. Clicking on a Delete link fires the click function handler within the fnDrawCallback which then does an AJAX post to the page that handles the delete. All works gravy *except* the darn oTableContacts.fnDeleteRow(anSelected[0]); line. Returns an error "TypeError: 'undefined' is not an object (evaluating 'k.nTr')" in jquery.dataTables.min.js:58. The row is never deleted from the view *but* it is deleted from the database. Any ideas? Much love for any help!
[code]
var giRedraw = false;
/* Get the rows which are currently selected */
function fnGetSelected( oTableLocal )
{
var aReturn = new Array();
var aTrs = oTableLocal.fnGetNodes();
for ( var i=0 ; i
My setup... I've got a DataTable called oTableContacts which has a few rows of data from a MySQL database. I'm not loading the data through the DataTable but rather just spitting it out to a PHP page and then attaching the DataTable to it. Simple stuff so far. Each row has a "Delete" link in it assigned the "delete-contact" class. Clicking on a Delete link fires the click function handler within the fnDrawCallback which then does an AJAX post to the page that handles the delete. All works gravy *except* the darn oTableContacts.fnDeleteRow(anSelected[0]); line. Returns an error "TypeError: 'undefined' is not an object (evaluating 'k.nTr')" in jquery.dataTables.min.js:58. The row is never deleted from the view *but* it is deleted from the database. Any ideas? Much love for any help!
[code]
var giRedraw = false;
/* Get the rows which are currently selected */
function fnGetSelected( oTableLocal )
{
var aReturn = new Array();
var aTrs = oTableLocal.fnGetNodes();
for ( var i=0 ; i
This discussion has been closed.
Replies
[code]
var giRedraw = false;
/* Get the rows which are currently selected */
function fnGetSelected( oTableLocal )
{
var aReturn = new Array();
var aTrs = oTableLocal.fnGetNodes();
for ( var i=0 ; i
[code]
Name
Property
Contact Info
<?php foreach($query_contacts as $c_record):?>
<?php echo $c_record->first_name.' '.$c_record->last_name;?>
<?php echo $c_record->property_address1;?><?php if (!is_null($c_record->property_address2) && !empty($c_record->property_address2)) { echo '
'.$c_record->property_address2; } ?>
<?php if (!is_null($c_record->phone) && !empty($c_record->phone)){ echo ''.image('icons/gray/16x16/phone.png','',array('align' => 'absmiddle')).''.$c_record->phone.''; }?>
<?php if (!is_null($c_record->mobile) && !empty($c_record->mobile)){ echo ''.image('icons/gray/16x16/fax.png','',array('align' => 'absmiddle')).''.$c_record->fax.''; }?>
<?php if (!is_null($c_record->home) && !empty($c_record->home)){ echo ''.image('icons/gray/16x16/home.png','',array('align' => 'absmiddle')).''.$c_record->home.''; }?>
<?php if (!is_null($c_record->mobile) && !empty($c_record->mobile)){ echo ''.image('icons/gray/16x16/cellphone.png','',array('align' => 'absmiddle')).''.$c_record->mobile.''; }?>
<?php echo image('icons/red/16x16/trash.png','',array('alt' => 'Delete', 'title' => 'Delete')); ?>
<?php endforeach;?>
<!-- end tab-contacts -->
[/code]