Adding a loading indicator when copying large amounts of data?
Adding a loading indicator when copying large amounts of data?
Does anyone know a way to add a loading indicator for the time between when you click the copy button (included in the copy extension) and when it actually copies the data to the user's clipboard? I ask because we are displaying a lot of data and then copying it... it can take around 10 seconds. I would like the user to know that there is an action actively being handled. I tried doing a .live('click', function) jquery call for a class I added with buttons.className but it seems like DataTables gets in there first. It doesn't display until after the copying has already happened.
Answers
I have not tried this but it might work.
when the customized callback is set it, it has all of the data so what if you try assigning a busy indicator via an on click event, then use the customize callback to turn it off?
I may have misunderstood, but I tried to do an on click event for the button but that's when it returns after the data has already been copied.
Yes, I don't think that one through. You don't have control over which one fires first.
So I came up with this simple but clumsy solution.
The latest release of Buttons should actually have this ability built in.
Its possible that the browser isn't updating the UI while its still computing the copy though since its the same "thread".
Can you link to a test page showing the issue please.
Allan