How To Process Server Side Parameter Sent From Jquery Datatables Using Flask?
I am having some issues in processing the parameters sent by jquery datatables 1.10 when server side processing is enabled. I initialized the datatable in the javascript side like
Solution 1:
Get DataTable to send json
ajax: {
url: "/api/data_table",
type: "POST",
data: function ( args ) {
return { "args": JSON.stringify( args ) };
}
},
In flask, parse the json
args = json.loads(request.values.get("args"))
columns = args.get("columns")
Solution 2:
You can use this little nifty package that I found https://github.com/bernii/querystring-parser
from querystring_parser import parser
args = parser.parse(request.query_string)
print args['columns']
Post a Comment for "How To Process Server Side Parameter Sent From Jquery Datatables Using Flask?"