Pagination not updating / working with ajax

Pagination not updating / working with ajax

sirbensonsirbenson Posts: 3Questions: 0Answers: 0
edited September 14 in Free community support

Hey,

no after one week work, i cant get it working.... I'm using databales for a large amount of datas (up to 20.000 rows).
So i using serverside and paginations with db limit and offset

Data is filling fine but one thing is not working... The pagination. It always only one page with the given records from database. RecordsToal is about 10.000 entries (only count). But why is datatable not updating the pagination? it must be 1000 pages with 10 records. not only one... The total result is correct (Showing 10 from 9417 records)

Response is like that what DataTables needs.. Expample:

Json Response:

"data":[
      {
         "Id":"1",
         "CustomerNumber":"000001",
         "Contact":"Tessenderlo",
         "Address":"Stoffeler Broich 175",
         "Place":"24817 Tetenhusen",
         "EMail":"example@example.com",
         "Phone":"0123456789012",
         "LastContact":"11.09.2020"
      },
      {
         "Id":"2",
         "CustomerNumber":"000002",
         "Contact":"LVMH",
         "Address":"Josef-Ponten-Stra\u00dfe 102",
         "Place":"31195 Lamspringe",
         "EMail":"example@example.com",
         "Phone":"0123456789012",
         "LastContact":"11.09.2020"
      },
      {
         "Id":"3",
         "CustomerNumber":"000003",
         "Contact":"Esso",
         "Address":"Essener Stra\u00dfe 60",
         "Place":"35398 Gie\u00dfen",
         "EMail":"example@example.com",
         "Phone":"0123456789012",
         "LastContact":"11.09.2020"
      },
      {
         "Id":"4",
         "CustomerNumber":"000004",
         "Contact":"Vestel",
         "Address":"Werstener Friedhofstra\u00dfe 191",
         "Place":"35576 Wetzlar",
         "EMail":"example@example.com",
         "Phone":"0123456789012",
         "LastContact":"11.09.2020"
      },
      {
         "Id":"5",
         "CustomerNumber":"000005",
         "Contact":"Opap",
         "Address":"L\u00fcdenscheider Stra\u00dfe 123",
         "Place":"86692 M\u00fcnster",
         "EMail":"example@example.com",
         "Phone":"0123456789012",
         "LastContact":"11.09.2020"
      },
      {
         "Id":"6",
         "CustomerNumber":"000006",
         "Contact":"S\u00fcdzucker",
         "Address":"Sebastian-Sch\u00e4ffer-Stra\u00dfe 167",
         "Place":"87527 Sonthofen",
         "EMail":"example@example.com",
         "Phone":"0123456789012",
         "LastContact":"11.09.2020"
      },
      {
         "Id":"7",
         "CustomerNumber":"000007",
         "Contact":"Leoni",
         "Address":"Irisweg 99",
         "Place":"25569 Kremperheide",
         "EMail":"example@example.com",
         "Phone":"0123456789012",
         "LastContact":"11.09.2020"
      },
      {
         "Id":"8",
         "CustomerNumber":"000008",
         "Contact":"BP",
         "Address":"Belsenplatz 31",
         "Place":"17089 Burow",
         "EMail":"example@example.com",
         "Phone":"0123456789012",
         "LastContact":"11.09.2020"
      },
      {
         "Id":"9",
         "CustomerNumber":"000009",
         "Contact":"Fortum",
         "Address":"Freytagstra\u00dfe 67",
         "Place":"23795 Gro\u00df R\u00f6nnau",
         "EMail":"example@example.com",
         "Phone":"0123456789012",
         "LastContact":"11.09.2020"
      },
      {
         "Id":"10",
         "CustomerNumber":"000010",
         "Contact":"X",
         "Address":"Zeppenheimer Weg 197",
         "Place":"39524 Wust-Fischbeck",
         "EMail":"example@example.com",
         "Phone":"0123456789012",
         "LastContact":"11.09.2020"
      }
   ],
   "recordsFiltered":10,
   "recordsTotal":9417,
   "error":"",
   "draw":1

Database exapmple:
http://live.datatables.net/zajisake/1/

Thanks for helping :)

Replies

  • colincolin Posts: 9,822Questions: 0Answers: 1,629

    Can you paste the JSON when you click on page 2, please? And if possible, can you link to your page too,

    Colin

  • sirbensonsirbenson Posts: 3Questions: 0Answers: 0
    edited September 15

    There is no page 2. It only shows page 1, more not

  • colincolin Posts: 9,822Questions: 0Answers: 1,629

    Yep, I asked for the JSON, to see what the server responded with. If your draw value isn't the same as the one in the request, you'll see this behaviour.

    Colin

Sign In or Register to comment.