Is there a way to hide the empty table message only when processing is true.
Is there a way to hide the empty table message only when processing is true.
ikhvjs
Posts: 9Questions: 3Answers: 0
I try to use processing plugin
to show the processing bar in the table, but I don't want to show theLanguage.emptyTable message
(e.g. No data in the Table) if the processing
is true.
Also, I want to show the emptyTable message
when there is no record and the processing
is false.
What I am trying to do in Javascript:
async function render() {
dataTable.processing(true);
await asyncFetchData();
dataTable.processing(false);
}
May you give me some advice?
This question has an accepted answers - jump to answer
Answers
I'm not seeing that - please see here. Could you look at that, please, and see if it helps. If it's still not working for you, please can you update my example, or link to your page, so that we can see the problem.
Cheers,
Colin
Hi Colin,
Thanks for your reply. You can see that
No data available in the table
is shown in your example when the processing is true. What I want is when processing is true, theNo data available in the table
should not be shown. When processing is false, theNo data available in the table
should be shown instead.Oh I see! You could blank out that message, something like this,
Colin
Thanks. I see. It looks like there is no api but manual js to handle it.
Do you think there is a way to change the
processing registration function
below to add the toggling display of the emptyTable word?So, whiIe I write
table.processing(true)
, it should hide the emptyTable text and when I writetable.processing(false)
, it should show the emptyTable text if there is no record.I don't want to write
$('.dataTables_empty').text(' ')
and$('.dataTables_empty').text('No data available in the table')
again for each operation in the code.We'd be happy to accept a pull request for that change, it may be useful for others too,
Colin