How to work pagination in jquery datatable library?


I’m working with jquery datatable library on my project,I have a question about pagination in it. I want to know is jquery datatable load all of data in RAM and after that it does paging on data.for example if I have 2000 records in database is jquery datatable load all of 2000 records and after that paging it? or by default, for example it loads 10 to 10 records.

    "language": {
        "search": "جستجو",
        "paginate": {
            "previous": "قبلی",
            "next": "بعدی"
        "sLengthMenu": "نمایش  _MENU_  ردیف",
        "sInfo": "نمایش _START_ تا _END_ ردیف از _TOTAL_ ردیف",
        "sEmptyTable": "هیچ داده ای در دسترس نیست",
        "sInfoEmpty": "نمایش 0 ردیف  از 0 ردیف",





Where you need pagination, at the db end or at client?

If you have less data you can use client paging, by default it is enabled:

 "paging": false, // can make false to disable paging
 "pagingType": "full_members" // to display all buttons i.e. first, previous, next, last

For serverside paging you need to add following attribute:


that will add optional parameters for your index like ‘start’ and ‘length’. You can use start and length parameters to fetch the records.