Server side processing without ajax call

Server side processing without ajax call

GunasekaranGunasekaran Posts: 2Questions: 0Answers: 0
edited January 2013 in General
Hi,

I need to load the values using datatable server side processing on load of a jsp page... How i have implemented now is, will go to controller and then forward to jsp. on load of jsp, using ajax call i will do the server side processing.. These will have 2 request to db( one in controller and in ajax call). What i want is i need to avoid ajax call( which is done on load of jsp) and get the data when i go to controller itself.. Is it possibel in server side processing?

Please let me know.

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Use fnServerData to override the Ajax call DataTables makes and replace it with your own call to whatever methods you need. You must still fully implement server-side processing's required response parameters in the returned JSON: http://datatables.net/usage/server-side

    Allan
  • GunasekaranGunasekaran Posts: 2Questions: 0Answers: 0
    Suppose if i will get the data from the controller model attribute, How i will load the data without ajax call on load of jsp. And if i make cache size as 3 pages, then if i click on 4 page, ajax call should happen to get the datat from server side.
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    If you want to work async and get data from the server - then you will of course need to make an Ajax call (or I suppose you could use web-sockets or frames, but Ajax seems the obvious way). fnServerData simply allows you to replace the Ajax call that DataTables itself makes, with your own, or some other method of getting the data from the server.

    Allan
This discussion has been closed.