Skip to content

SearchBuilder JSON Error: Cannot create property 'searchBuilder' on string #296

@Shtreel

Description

@Shtreel

I get an error when converting the data sent to the server to JSON. Based on the documentation here https://datatables.net/reference/option/ajax.data, it should be possible to convert to JSON by doing
new DataTable('#myTable', { ajax: { url: 'data.json', contentType: 'application/json', type: 'POST', data: function (d) { return JSON.stringify(d); } } });
However, this doesn't work when SearchBuilder is enabled which causes a "Cannot create property 'searchBuilder' on string" error. This issue was mentioned in https://datatables.net/forums/discussion/76987/searchbuilder-criteria#latest, but there doesn't seem to be a fix other than modifying the source code to remove the line that gets SearchBuilder details

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions