please help me, i’m very newbie
i have question about datatables (jquery plug in).
at every rows data in datatables grid, I have button to delete data.
when i click delete button, data at that row deleted.
the question is, can I refresh data table without reloading the page ?
so the rows can be decrease when i click delete button without reloading the page.
this is my code: (just FYI my table id for datatble is: id=”mydatatable”)
html delete button on each rows data:
-------------------------------------
<button onclick="delete('id')">Delete</button>
javascript:
-----------
delete(id)
{
delete_ajax(id); //deleting data using ajax
window.location.reload() //reloading page, this what i want to change
//(just refresh datatable grid without reload the page)
}
many thanks 🙂
Have a look at the api. You should be able to call fnDeleteRow on your datatables object.
http://www.datatables.net/api