Is there a way to load server-side JSON into a table using SetTimeOut?
Is there a way to load server-side JSON into a table using SetTimeOut?
I'm trying to load 30k rows into my data table using server side processing. Is there a way to intercept the data from the server and load it into the table manually using SetTimeOut? IE times out and give the 'long running script' error and doesn't load my data.
I'm using ASP.Net for the server code with Nhibernate for the ORM for our database.
If I could get the Scroller plugin to work and send paginated data back, it might be an alternative solution.
However, we incur a lot of overhead each time we call the server to fetch a new set of data (~18sec on the server). At this time it is not feasible to paginate the data we give to the client using a query in NHibernate, so each time we have to get the entire dataset before it gets filtered and delivered to the client via an ajax call.
Answers
I've tried using
For some reason it calls the server function over and over and over. I'm getting very frustrated.
Without the ability to control how the table is loaded once the data comes back from the server I get script time out errors in IE. I'm having issues when returning 30k items from the server.
That's not really a lot of data, unless each record is exceptionally large. DataTables' server-side should be perfectly happy with it. I would be looking at ASP and Nhibernate - neither of which I know anything about :-) - or my database design.
Wow! That sounds like a DB problem. I can fetch nearly 100K records in well under a second. I think I'd be looking elsewhere than DT.
NHibernate seems to be the problem. To troubleshoot I moved the repository code out of the Json controller action that Datatables calls. The timing changed from ~18sec to ~700ms. I am going to have to make our repository performant .
isn't NHibernate an ORM? Loading all 100K records into an object model might be fairly slow. You could look at using server-side processing or just dump the data straight out without using an ORM.
Allan
I currently am using serverside processing. I'm working on getting Scroller working. For some reason it doesn't want to get the next 'page' when I scroll to the end of the first result set.
EDIT:
Looks like I wasn't returning the correct value for iTotalDisplayRecords.