How to process server side parameter sent from jquery datatables using Flask?

前端 未结 2 738
轻奢々
轻奢々 2021-02-15 11:49

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 li

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-15 12:32

    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")
    

提交回复
热议问题