fncallback is screwing me like Hell ? help please

fncallback is screwing me like Hell ? help please

sunildonsunildon Posts: 40Questions: 7Answers: 0
edited May 2014 in DataTables

Hi

I am doing some delete work on datatable without any plugin support via ajax call and i am using an fncallback in my sucess function of ajax call .

The controller is returning the data by deleting the row i selected in JSON format . But finally i am unable to get rid of my Record which is already deleted in datatable but it appears On datatable even after fncallback ? any suggestions .

My code :

                $.ajax({
                    "type": "GET",
                    "dataType": 'json',
                    "contentType": "application/json; charset=utf-8",
                    "url": "/company/DeleteData/?id=" + sel + "&ss=" + delreason,   //start has rowid and delreason is some additional param to controller
                    "data": aoData,
                    "success": function (data)
                    {
                       fncallback(data) //in data in am getting records without deleted one But my datatable not getting updated 
                    }

                });

My controller return's like :
return Json(new
{
sEcho = ps.sEcho, // i am getting null here
iTotalRecords = result.Count(),
iTotalDisplayRecords = result.Count(),
aaData = result
},

                JsonRequestBehavior.AllowGet); }

Regards
Please help me with some way so i can resolve this .
Tried fndrawcallback , fndraw left themi between i'm afraid there is no proper sever side working example deal close to my issue .

Answers

  • allanallan Posts: 63,489Questions: 1Answers: 10,469 Site admin

    Since you are using server-side processing, DataTables is just showing the data that is returned for each Ajax request. So your row being still be in the database and hasn't been deleted. Does that sound possible?

    Allan

  • sunildonsunildon Posts: 40Questions: 7Answers: 0
    edited May 2014

    No in db its deleted . But still my row is present on Datatable i want to get rid of it any cost in IE ? any ideas allan . i written ajax call under button click .

    Note: In actual sense the deleted row still appears to me when i click to delete which is actually not there but showing on datatable causing me lot of erros ..

    Only thing i am doing now is refresh the browser to get rid of the row ..

    Please show some light at this issue .

    Cheers
    Have a great day

This discussion has been closed.