Ajax reload with filters

Ajax reload with filters

DanielBlaisDanielBlais Posts: 2Questions: 1Answers: 0

I'm using AJAX to reload my grid content. With AJAX, I'm passing parameters to the server, so it can filter out some rows.

But I want the grid to display : Showing 1 to ## of ### entries (filtered from #### total entries).

Is it possible or I have to convert my grid to be serverside?



  • kthorngrenkthorngren Posts: 17,759Questions: 25Answers: 4,216

    Not sure if you are using the ajax option or jQuery ajax but in any case you can use the infoCallback to customize the output. If you are using ajax.data, or equivalent with jQuery ajax, to send filtering parameter to the server then Datatables won't know about additional row information. It only knows about the data at the client (assuming client side processing).

    One option is to add additional information to the JSON response from the server. You can add the row totals and extract them using the ajax.json() API, if using ajax, inside the infoCallback. But if you use the default Datatables search input it might be confusing to the users.

    Hope this makes sense.


  • DanielBlaisDanielBlais Posts: 2Questions: 1Answers: 0

    I was mixing client side and server side features. I switch to true serverside and this fixed my issue.

Sign In or Register to comment.