I am unable to capture page change event of my datatable

I am unable to capture page change event of my datatable

Nehpreet KaurNehpreet Kaur Posts: 2Questions: 1Answers: 0

I have thousands of records to be shown and it is slowing down my page to bring those all at once. I have written up a SQL procedure that will help me paginate my records, but I will have to pass the page value to the procedure. How can I capture the page change event so that I can put up an Ajax call to my controller in MVC website and fetch records according to the page.
I am unable to capture page change event of my datatable...Plesae help.

Answers

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947

    You can use page. There is an example in the doc that shows capturing the page info. If you are using this and its not working then you will need to provide a link to a page showing the issue for debugging.

    This FAQ explains options to help with slow Datatable initialization.
    https://datatables.net/faqs/index#General-initialisation

    Maybe you can use deferRender or server side processing instead of creating your own code.

    Kevin

  • Nehpreet KaurNehpreet Kaur Posts: 2Questions: 1Answers: 0

    No, But i have 32000 records which i dont want to fetch all at once . Even when i use paging it gets all records All the page events that you have mentioned are not dec load time.

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947

    If you enable server side processing but all the records are returned then I suspect your server side script doesn't support Datatables server side processing as described in this doc:
    https://datatables.net/manual/server-side

    Kevin

This discussion has been closed.