Server side searching & Paging -- Reload Datatable data

Server side searching & Paging -- Reload Datatable data

athirwaqasathirwaqas Posts: 1Questions: 1Answers: 0

Hi All,

I am using Datatables 1.10.12 with Angular 5. I have configured datatable to paginate and search from server, but I am facing issue to reload the data. Here is the details of the errors I am facing:

  1. While searching, datatable correctly sends the search request to the server, processing icon comes on the screen on datatable, server correctly responds with filtered data. But Datatable do not refresh to show the results, and processing icon never disappears.

  2. Similarly for paging, for the first time, datatable correctly loads data and paging buttons. But once you click on page 2 or next buttons, request is correctly sent to the server, server correctly responds, but datatable do not show the second page on the screen.

Is it an issue in Datatables or am I doing something wrong here. Here is my datatable configuration. I will be thankful if you can highlight what I am doing wrong, or what can I can do to correct this behavior.

this.dtOptions = {
      ajax: {
          url: '/ajaxcall',
          dataSrc: 'data'
          },
      ordering: false,
      lengthChange: false,
      paging: true,
      processing: true,
      serverSide: true,
      pagingType: 'full_numbers',
      searchDelay:2000,
      search: true,
    searching:true,
    paging:true,
    pageLength:4,
      columns: [
          {
              data: "isSelected",
              defaultContent: '<input id="chkSelected" name="chkSelected" type="checkbox"/>',
              title: "Select"
          },
          {data: "icon", title: "icon"},
          {data: "name", title: "name"},
          {
              title: "status",
              data: "status"
          }
      ]
  }

}

Answers

  • jayantsr83jayantsr83 Posts: 1Questions: 0Answers: 0

    I am facing same issue actually when you it is hitting api it is not sending the parameters with it like page,search keyword etc

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    Hi @jayantsr83 (and @athirwaqas ),

    I've not seen these issues, and it's behaving on example pages like this one here.

    We're happy to take a look, but it would help, as per the forum rules, if you could link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.