Ankit Singh
Ankit Singh

Reputation: 21

How to send request in JSON format with JQuery Datatables Editor

In Jquery Datatables editor, is there any option by which data with request sent to the server can be wrapped into JSON? Everywhere, the data is being sent as URL Parameters. And there seems to be no option for JSON request.

Thanks.

Upvotes: 2

Views: 1876

Answers (1)

user3057885
user3057885

Reputation: 51

try this function in ajax section, works for me.

var editor = new $.fn.dataTable.Editor( {
  ajax: {
    url: '...',
    data: function ( d ) {
      return JSON.stringify( d );
    }
  },
  ...
} );

Upvotes: 4

Related Questions