Topic: Update Datatable with new rows, paginated
yourpatrol asked 5 years ago
I have used the jQuery Datatable with pagination and it works and renders fine. I then want to be able to update the data/rows with refreshing the entire page.
Note the code has run already and created my intial table just fine. I now want to add some rows () and then update the mdb table.
My code:
$("#mytable").DataTable({ "destroy": true, "lengthChange": false //disables the display 'x' per page control });
$("#mytable").mdbEditor({
modalEditor: true
});
The code i has doesn't error but it doesn't show the new rows.
How do i best achieve what i am after here? anybody have a sample?
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Open
- User: Free
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.12.0
- Device: PC
- Browser: Chrome
- OS: Windows 10
- Provided sample code: No
- Provided link: No
Grzegorz Bujański staff commented 5 years ago
Hi,
Create snippet with your code here: mdbootstrap.com/snippets. I'll look at this.
Best, Grzegorz
NANA DARKO commented 4 years ago
Destroy the table and recreate it:
$('#mytable').DataTable().clear(); $('#mytable').DataTable().destroy();
Marcin Luczak staff commented 4 years ago
@NANA DARKO thank you for this response :)
Keep coding, Marcin from MDB