Jquery Datatable processing message doesnt go away after deletion of row

Jquery Datatable processing message doesnt go away after deletion of row

lordoffriendslordoffriends Posts: 14Questions: 2Answers: 0
edited July 2011 in General
This is the code...

var oTable;
var aData;
var row;

$(document).ready(function() {

$('#example tbody tr').live('click', function (event) {

$(oTable.fnSettings().aoData).each(function (){
$(this.nTr).removeClass('row_selected');
});

$(event.target.parentNode).addClass('row_selected');
aData = oTable.fnGetData(this); // get datarow
row = $(this).closest("tr").get(0);
});

/* Add a click handler for the delete row */
$('#delete').click( function() {
$.ajax({
type: "GET",
url: "<?php echo base_url(); ?>Test/DeleteData",
data: "id="+aData[0],
success: function(msg){
//oTable.fnDeleteRow(aData);
var anSelected = fnGetSelected( oTable );
oTable.fnDeleteRow( anSelected[0] );
oTable.fnDeleteRow(oTable.fnGetPosition(row));
}
});
} );

/* Init the table */
oTable = $('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "<?php echo base_url(); ?>Test/Listener",
"sPaginationType": "full_numbers",
"iDisplayLength": 1,
"bSortClasses": false,
"aoColumns": [ { "bVisible": false} , null, null ]
} );


} );
/* Get the rows which are currently selected */
function fnGetSelected( oTableLocal )
{
var aReturn = new Array();
var aTrs = oTableLocal.fnGetNodes();

for ( var i=0 ; i

Replies

  • lordoffriendslordoffriends Posts: 14Questions: 2Answers: 0
    Waiting for reply.
  • lordoffriendslordoffriends Posts: 14Questions: 2Answers: 0
    after oTable.fnDeleteRow(oTable.fnGetPosition(row)); ..i add this line...
    oTable.fnDraw();

    But nothing is happening.It stays the same way.
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Have a look at the first two questions in the server-side processing section of the FAQs: http://datatables.net/faqs . JSON Lint and check your data. Failing that please post a link to your table.

    Allan
  • lordoffriendslordoffriends Posts: 14Questions: 2Answers: 0
    Done ! working perfectly ! ...Now when i delete the row on particular page like page 3,it redirects the page to page 1.How to fix this bro ?
  • lordoffriendslordoffriends Posts: 14Questions: 2Answers: 0
    fnStandingRedraw function is not working for me :(
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    http://datatables.net/forums/discussion/5871/fnstandingredraw-is-not-working#Item_2

    Allan
This discussion has been closed.