Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82226

SearchPanes > serverSide > POST > Cannot create property 'searchPanes' on string

$
0
0

How can we use SearchPanes with serverSide and POST?

SearchPanes doesn't consume returned data the same way that DataTables does?

We have this error when using DataTables 2.2.2 with POST and SearchPanes:

"Uncaught TypeError: Cannot create property 'searchPanes' on string '{"draw":1,"columns":[{"data":null,"name":"","searchable":false,"orderable":false,"search":{"value":"","regex":false}}, ..."

The error is also documented here (but not a specific solution): We have this error: https://stackoverflow.com/questions/77555721/datatables-error-using-searchpanes-and-serverside-with-post-ajax-request

Per https://datatables.net/reference/option/ajax.data we always use this ajax syntax:

new DataTable('#myTable', {
ajax: {
url: 'data.json',
contentType: 'application/json',
type: 'POST',
data: function (d) {
return JSON.stringify(d);
}
}
});

Apparently data with JSON.stringify is the culprit when using serverSide and POST?

If we need to switch to using "ajax": function (data, callback, settings) {} then what is the equivalent of the simple ajax setting to setting the url and type?


Viewing all articles
Browse latest Browse all 82226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>