Page Loding Issues

Page Loding Issues

rasikowrasikow Posts: 20Questions: 0Answers: 0
edited June 2009 in General
HI,

I have 1000 records/rows in my table. I am using datatables pagination. I am displaying 10 records/rows at a time. But what my problem is, when page loads first time, that 1000 records displaying for a second and again it is regaining to 10 records.

I dont want to display that 1000 records when page starts. It should display the 10 records only.

is this bug? please clarify

How to resolve it?

Replies

  • allanallan Posts: 61,451Questions: 1Answers: 10,055 Site admin
    Hi rasikow,

    The data is being loaded from the DOM, therefore the information must be present there in the DOM before DataTables can read it. Therefore your records must all be loaded, and this is what you are seeing - so no it is not a bug - it's simply how this kind of thing works.

    So you have a number of options:

    1. Just output 10 rows to your HTML (already sorted etc) and then initialise DataTables using a JSON source (sAjaxSource) which will replace those ten lines with the full information.

    2. Use an ajax source with an empty table.

    3. Use server-side processing.

    Which one is best is really up to you :-)

    Allan
This discussion has been closed.