Getting JS error for fetching more than 2000+ data
Getting JS error for fetching more than 2000+ data
saurav85m
Posts: 4Questions: 0Answers: 0
Hi all,
I am using DataTables-1.9.4 in web Project (JSP).
During data fetching, if my data count goes to more than 2000+ then this datatable gives a JS error.
To solve the issue I started to use "Server side processing" approach.
In “Server side processing” approach I have found that to populate each page (pagination page) code hit the DB and get the result.
I don’t want to do this approach as because it will increase my DB hit.
Can anyone suggest what the best solution is?
Thanks
Saurav
I am using DataTables-1.9.4 in web Project (JSP).
During data fetching, if my data count goes to more than 2000+ then this datatable gives a JS error.
To solve the issue I started to use "Server side processing" approach.
In “Server side processing” approach I have found that to populate each page (pagination page) code hit the DB and get the result.
I don’t want to do this approach as because it will increase my DB hit.
Can anyone suggest what the best solution is?
Thanks
Saurav
This discussion has been closed.
Replies
http://www.datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read
And yes, in future, please link to a test case.
Allan
First of all I am very sorry I can’t give you the test case as because I am using client network and no one can access this network from outside the network.
And Yes I am using the AJAX to fetch the data.
My error is:
“Stop running this script?
A Script on this page is causing your web browser to run slowly. If it continues to run, your computer might become unresponsive.”
The code is working fine for the less than 1200 to 1500 data but if the data count is more that 2000 then it gives an error.
Please go through my Coding logic.
I have two jsp (Home.jsp and handler.jsp) and one JS (common.js)
In the Home.js I have two div (div1, activeSection)
In the div1, I write
When user click on the image it goes to the activeLoadQuickSearch() JS function.
This function is in “common.JS” file.
In this JS function, I have used AJAX and I send the data to another JSP file using (xmlhttp.open("POST", url, true);).
The in the handler.jsp , my code is-
1. DB connection
2. Table creation
3. Fetching the data
4. Putting the data in the table
Then, I get this handler.jsp in the AJAX function using
document.getElementById(‘activeSection’).innerHTML=xmlhttp.responseText;
and I customized the datatable using
$('#QuickSearchResultTable').dataTable( {
"sPaginationType": "full_numbers"
} );
please provide me the solution.
Allan
In “Server side processing” approach I have found that to populate each page (pagination page) code hit the DB and get the result.
I don’t want to do this approach as because it will increase my DB hit.
Now datatable cannot handle more than 2000+ data in the client side and if I go to the server side approach then I have to increases DB hit which is not a good approach.
Now what should I do?
I already spend my 1 week to understand this Datatable and then I started to develop the code. I have to deliver the code at end of this week. Its impossible to incorporate another datatable in my code.
Is there any other way, that I can solved this problem.
anything on my coding level change or concept wise change.
Allan
I need help.. please
Allan