Loading data from an object while processing
Loading data from an object while processing
islamelshobokshy
Posts: 99Questions: 20Answers: 1
I want datatables to show 'loading..' when it is loading an object into it's rows like so
processing: true,
data: jsonB.data,
but that doesn't work, I don't call any ajax in Datatables (I call it outside and use the resulted object inside datatables), is that why I don't have any loading text ? How can I have it anyway with 'data' and not 'ajax' ?
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Hi again,
With
processing
set, you should see the processing message on ordering. You won't see it on the load, as the browser will be grouping the redraws. If you add the optiondeferRender
it'll significantly speed up the load, so you probably wouldn't see the processing message there either. And likewise the search, it's probably so fast you won't see it there either.This example here might be worth playing with, as it's a large dataset and takes a while to do things.
Cheers,
Colin
So I can't have the processing show up when I use data and not ajax? Is there a way to do it anyway? As no the problem is not that the page loads too fast (my datatables loads 400k+ results and I don't have pagination (no, I'm not crazy, I didn't just have a choice :P))
So in your link, is there a way to have a loading text/icon anyway? It might not appear in your url but it'll show me how to do it. As simply adding processing true doesn't work...
As I said, not with the load. But, as I said, have you tried loading with
deferRender
, that might make the performance that much quicker that it's not requiredI tried, and it's still taking me 3-5 seconds to load. And in any case I've been asked to do it anyway by my project manager. So do I have to pass by JS to do so?
You can create your own loading message fairly simply. For example, before you initialise the table, you can display a message, and then in the
initComplete
function you can remove/hide it. That would give you what you're after.C
Yeah I'll do something like that, thanks colin !