Give both the html and the js array to DataTables ?
Give both the html and the js array to DataTables ?
SimonR
Posts: 10Questions: 0Answers: 0
Hi all,
I'm in a bit of a pickle here, I made an application using DataTables 1.9.4 and ASP .NET MVC, on one of the pages the users can inpute some numbers for the customers (~400 rows on 9 columns) in a table managed by DT.
Problem for the main user the DT initialization is terribly slow under IE8 (corporate environment, don't have a choice here), after a bit of debugging I realized that the problem was the parsing of the s into its internal JS array.
Trying an alternative way, I tried making the JS array myself and load it via aaData, it showed improvement on my machine, but it made things worse on other's, problem being the generation by DT taking a long time as well.
I'm not using the deferred rendering option here, because I need to post back the data (a regular post not an ajax one) and trying that gave me too much trouble, mostly because of the data binding on ASP .NET side and formatting the data client side for a proper post.
Now what I'm trying to do here is give DT both the JS array and the s so it doesn't need to so much work (give the load to the server if you prefer), is that possible ? Or can I only use one loading option ?
PS: Sorry I can't give you a live example, test data are confidential customer's data
I'm in a bit of a pickle here, I made an application using DataTables 1.9.4 and ASP .NET MVC, on one of the pages the users can inpute some numbers for the customers (~400 rows on 9 columns) in a table managed by DT.
Problem for the main user the DT initialization is terribly slow under IE8 (corporate environment, don't have a choice here), after a bit of debugging I realized that the problem was the parsing of the s into its internal JS array.
Trying an alternative way, I tried making the JS array myself and load it via aaData, it showed improvement on my machine, but it made things worse on other's, problem being the generation by DT taking a long time as well.
I'm not using the deferred rendering option here, because I need to post back the data (a regular post not an ajax one) and trying that gave me too much trouble, mostly because of the data binding on ASP .NET side and formatting the data client side for a proper post.
Now what I'm trying to do here is give DT both the JS array and the s so it doesn't need to so much work (give the load to the server if you prefer), is that possible ? Or can I only use one loading option ?
PS: Sorry I can't give you a live example, test data are confidential customer's data
This discussion has been closed.
Replies
Currently, no, what you are looking for is not possible, and I'm not even sure how to hack it into DataTables and afraid.
You might also want to give DataTables 1.10 pre-beta a try, as that includes a number of performance optimisations: https://github.com/DataTables/DataTables/tree/1_10_wip/media/js
Allan
I'm generating the JS array server side with .NET and 'printing' it on the page with the Razor engine, it's ugly as hell but I needed a rapid way to serialize the model objects into a array (that include the html inputs I need as well) and a way to put the load on the server rather than the client.
Can't use the pre-beta unfortunately (too close to the deployment), I could try to do some merging however if you can point me on where in the code the are generated, or where the DT's JS array is generated.
Data gathering (reading): https://github.com/DataTables/DataTables/blob/RELEASE_1_9_4/media/js/jquery.dataTables.js#L527
The problem you'll have is that these two functions are orthogonal. DataTables 1.9- only uses one at a time for a row. 1.10 simplifies the code a fair bit...
Allan
Cheers Allan !