Manual server side processing

Manual server side processing

bhushanpatilbhushanpatil Posts: 17Questions: 4Answers: 0

Problem statement
i want to load only 40 records per page,so on click of next button on the basis of (x flag which is true/false) i need to call another 40 records.
How this is possible
How to send and retrieve data using server side processing
please suggest with detailed example,as the example given on the site not have enough information.

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    If you are referring to this example
    https://datatables.net/examples/data_sources/server_side.html
    what information do you think is missing?

  • bhushanpatilbhushanpatil Posts: 17Questions: 4Answers: 0

    Thanks for reply @tangerine
    On next button of pagination want to call next 40 records,which depends of some flag
    so how to do that?
    and also where do we get ajax response in success?dataFilter?
    and how to set that response to the datatable.

  • kthorngrenkthorngren Posts: 21,300Questions: 26Answers: 4,945

    On next button of pagination want to call next 40 records,which depends of some flag so how to do that?

    Are you saying that the flag is some sort of filter or it determines whether the next page should be fetched?

    Please describe in more detail what you are trying to do.

    and also where do we get ajax response in success?dataFilter?
    You can use the ajax.dataSrc. You can use a function which is shown in the doc page.

    and how to set that response to the datatable.
    That is also shown in the same doc example of using a function.

    Kevin

  • bhushanpatilbhushanpatil Posts: 17Questions: 4Answers: 0
    edited April 2018

    Thanks for reply @kthorngren
    Are you saying that the flag is some sort of filter or it determines whether the next page should be fetched? --Yes

    Most of the example given on forum having a fixed data,in my case dont know how many records are there its totally depends of flag call isMoreRecords which tells is records available,according to that we fetch next record.

    Also want to send some data in ajax request while fetching next records

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    Unfortunately DataTables doesn't not have the ability to use server-side processing in such a mode at the moment. It always requires that the number of rows in the data set be known.

    Allan

  • bhushanpatilbhushanpatil Posts: 17Questions: 4Answers: 0

    Thanks @allan for reply

    If we want to achieve manually on click of next button,then is it possible?

  • bhushanpatilbhushanpatil Posts: 17Questions: 4Answers: 0

    Thanks @allan for reply

    i mean to say in every call i get 40 records only,to get next 40 records i have to check the flag and respective of that fetch the next records

    is it really not possible??

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    Externally you could use clear() to clear the old data and then rows.add() to add your new data. But that wouldn't be possible with DataTables' built in paging control, which fundamentally requires to know how many rows are in the record set.

    Allan

This discussion has been closed.