Datatable refresh after insert
Datatable refresh after insert
I am using the standard buttons.
buttons: [
{ extend: "create", editor: editorQuotes },
{ extend: "edit", editor: editorQuotes },
{ extend: "remove", editor: editorQuotes }
]
editorQuotes.on( 'create', function ( e, json, data ) {
alert( 'New row added' );
} );
I am able to edit / add /remove.
But the datatable does not refresh when I insert add a new row.
Do I have to manualy call it ?
The create event above is not called.
Cheers
Steve Warby
This discussion has been closed.
Answers
Does your server-side script return JSON data with the newly added row in it. There is an example in the documentation.
Allan
Hi Allan,
On the customer table I am using this PHP
The insert works okay.
How do I get the datatable to just show the inserted row without refreshing the whole datatable.
Cheers
Steve Warby
With that code it would only refresh the whole DataTable if you are using
serverSide
. Are you? If not, I don't know why it would be refreshing the whole data set unless there is some code somewhere callingajax.reload()
?Allan