DataTables Server-side Processing with web2py: how to access the parameters sent to the server

StackOverflow https://stackoverflow.com/questions/23620833

  •  21-07-2023
  •  | 
  •  

문제

When using server-side Ajax processing for DataTables, DataTables sends parameters from the view to the server so that the server can access the data source and return the correct data. I cannot figure out how, when doing server-side processing with web2py, to access those parameters that comes from the view.

These parameters are, for example, iDisplayStart, IDisplayLength, iColumns, etc.and are documented here: http://legacy.datatables.net/usage/server-side

I have no doubt this is simple and will result in a loud "doh!" from me, but I have been digging around for a couple days and haven't figured it out.

도움이 되었습니까?

해결책

In web2py, variables from a POST request are in request.post_vars, variables from the query string are in request.get_vars, and both sets of variables are in request.vars. So, in your controller, you can access those variables via request.vars.iDisplayStart, request.vars.iDisplayLength, etc.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top