slow loading incase of large number of records

slow loading incase of large number of records

NewinthezoneNewinthezone Posts: 22Questions: 0Answers: 0
edited April 2012 in General
Hi
I am using datatables in which there are more than 20,000 records. It takes way to long to load and usually the browser hangs.
I am using a gridview to display data.
Is there any way through which it could just load the data for the current page being viewed rather than all the 20,000 records

Replies

  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    http://datatables.net/extras/scroller/
  • allanallan Posts: 63,810Questions: 1Answers: 10,516 Site admin
    > Is there any way through which it could just load the data for the current page being viewed rather than all the 20,000 records

    http://datatables.net/usage/server-side :-)

    However, you might want to consider using Scroller + deferred rendering as koosvdkolk suggests. That will allow you to load all records in a single Ajax call, but it optimised for large data sets. Server-side processing however can be used for millions of rows, if you want to think about that, since all the "hard work" is done by the SQL engine.

    Allan
  • NewinthezoneNewinthezone Posts: 22Questions: 0Answers: 0
    hi Allan

    I was trying to use server side processing and even the scroller.
    But I am getting this error:
    "DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error"
    Originally my data is coming from a sql datasource. WebForm4.aspx is the page where all the data is being displayed. What may be going wrong. What is needed in the "sAjaxSource"?

    $(document).ready(function () {
    var oTable = $('#GridView1')..dataTable({


    "sPaginationType": "full_numbers",
    "bServerSide": true,


    "sAjaxSource": "WebForm4.aspx",

    "oLanguage": {
    "sSearch": "Search all columns:"
    }
    });
  • allanallan Posts: 63,810Questions: 1Answers: 10,516 Site admin
    The error is more or less what it says on the tin :-). The JSON returned from the server isn't valid JSON. Use Firebug to look at the return and pass it through http://jsonlint.com to validate it.

    Allan
  • NewinthezoneNewinthezone Posts: 22Questions: 0Answers: 0
    Hi Allan

    I have been trying to get the return value for json. Under the Net section of firebug where the post back link appears , there is no JSON tab for all the postback links.
    What could this mean?
  • allanallan Posts: 63,810Questions: 1Answers: 10,516 Site admin
    Probably that Firefox hasn't picked it up as JSON either. What does the 'Content' tab say?

    Allan
  • NewinthezoneNewinthezone Posts: 22Questions: 0Answers: 0
    Hi allan

    Under the response headers , it says :
    Content-Length 13286
    Content-Type text/html; charset=utf-8

    under request header
    Content-Type application/x-www-form-urlencoded

    I hope this is what you meant.

    This is the post back :[quote] http://localhost:47284/WebForm4.aspx?_=1335274950100&sEcho=1&iColumns=3&sColumns=&iDisplayStart=0&iDisplayLength=10&mDataProp_0=0&mDataProp_1=1&mDataProp_2=2&sSearch=&bRegex=false&sSearch_0=&bRegex_0=false&bSearchable_0=true&sSearch_1=&bRegex_1=false&bSearchable_1=true&sSearch_2=&bRegex_2=false&bSearchable_2=true&iSortingCols=1&iSortCol_0=0&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true.
    [/quote]
  • NewinthezoneNewinthezone Posts: 22Questions: 0Answers: 0
    I used fiddler as well..
    there is nothing under the JSON tab.
This discussion has been closed.