Tell datatables to show processing indicator. Also perhaps use GIF.
Tell datatables to show processing indicator. Also perhaps use GIF.
Hi
I am using DataTables with large datasets but using my own code to retrieve and sort the data before rendering in a page of DataTables. The main reason for this is that the data retrieval has to use multiple SOAP calls. So once I have the data I present to DataTables. For the same reason I am using my own pager. This is all working fine but I would like to display a paging indicator while the data is being retrieved/sorted.
So the code when refreshing after a paging change looks like this:
[code]
oTable.fnClearTable();
ShowBusy();
GetDataset(sSortField, oSortColumn, bSortDescending, pageNo, pageSize);
oTable.fnAddData(aDataSet);
StopBusy();
[/code]
I've been trying to use some external code with an animated gif which I show then hide. However I note that the scroller has a built in processing indicator which could work here if I could make ti get shown. Is there a way that I can tell DataTables to show it even though DataTables does not think it is busy?
Also is there a way to use an animated gif instead. This is an add-on for a Microsoft CRM which uses an animated gif so it would be good to use this same one. This is not essential.
Thanks and sorry I cannot post a working example - just too complex.
Paul
I am using DataTables with large datasets but using my own code to retrieve and sort the data before rendering in a page of DataTables. The main reason for this is that the data retrieval has to use multiple SOAP calls. So once I have the data I present to DataTables. For the same reason I am using my own pager. This is all working fine but I would like to display a paging indicator while the data is being retrieved/sorted.
So the code when refreshing after a paging change looks like this:
[code]
oTable.fnClearTable();
ShowBusy();
GetDataset(sSortField, oSortColumn, bSortDescending, pageNo, pageSize);
oTable.fnAddData(aDataSet);
StopBusy();
[/code]
I've been trying to use some external code with an animated gif which I show then hide. However I note that the scroller has a built in processing indicator which could work here if I could make ti get shown. Is there a way that I can tell DataTables to show it even though DataTables does not think it is busy?
Also is there a way to use an animated gif instead. This is an add-on for a Microsoft CRM which uses an animated gif so it would be good to use this same one. This is not essential.
Thanks and sorry I cannot post a working example - just too complex.
Paul
This discussion has been closed.
Replies
> Is there a way that I can tell DataTables to show it even though DataTables does not think it is busy?
This plug-in might be of interest: http://datatables.net/plug-ins/api#fnProcessingIndicator . It will allow you to show and hide the DataTables processing indicator ( bProcessing ). To show it with an animated gif, you can use the language settings: http://datatables.net/usage/i18n#oLanguage.sProcessing . Simply set it to be an HTML string with an `img` tag to show the gif.
Regards,
Allan
[code]Processing...[/code]
which seems fine and the style sheet has
[code].dataTables_processing {
position: absolute;
top: 50%;
left: 50%;
width: 250px;
height: 30px;
margin-left: -125px;
margin-top: -15px;
padding: 14px 0 2px 0;
border: 1px solid #ddd;
text-align: center;
color: #999;
font-size: 14px;
background-color: white;
}
[/code]
It could be something about the Dynamics CRM web resource in which this is running but the HTML looks clear. I just wonder if it is the position parameter and the fact that it within a sort of iFrame.
Any thoughts?
Here is the relevant discussion link:
http://datatables.net/forums/discussion/comment/47841#Comment_47841
Having said that, the option of using the `processing` event in the thread linked to by psharp is a good one if you want to use your own processing indicator.
Regards,
Allan