change zeroRecords ? message on reload
change zeroRecords ? message on reload
i have a datatable using ajax json source, with a filter parameter
by default, on page load, i want the table to be empty, so use an empty string as the parameter
on entering text in a text field and clicking a button, the text field value is passed as a parameter, and the table is reloaded.
$("#confirm").click(function(){
emailaddress = $('#Email_Address').val();
table.ajax.url('/ajax/invoices.php?OrderEmail='+emailaddress).load();
});
At the moment, i have a message displayed in the table on zeroRecords, so when the page is loaded, the message is displayed.
language: {
"zeroRecords": "Confirm your email address above to display the ticket orders placed"
},
How can i change this message on reloading the data, so that if no rows are returned, the user is given a visual clue that there are no rows, - otherwise it looks like nothing has happened
This question has an accepted answers - jump to answer
Answers
Does that work? Does it not just make an ajax request for the host page (which is what I would have thought).
I'm afraid there is no API for that at the moment. All of the language strings can only be set during initialisation. I don't really have a suggested way to do this in DataTables at the moment other than to do it outside of DataTables. Perhaps not showing the table before data is loaded into it for example.
Allan
No worries, i just added a div to the page and updated its content on button click instead