DataTables Editor Number Input POSTS String instead of Number in JSON Payload.

DataTables Editor Number Input POSTS String instead of Number in JSON Payload.

washuit-iammwashuit-iamm Posts: 89Questions: 34Answers: 1

Take the following field definition as an example:

{
    "name": "TotalDisk",
    "label": "Total Disk (Gb)",
    "className": "block",
    "attr": {
        "type": "number",
        "step": "0.01",
        "autocomplete": "off"
    }
},

When the Editor POSTS this as JSON to the endpoint, the data is in the form of a string: { "TotalDisk": "123" }

The data should be a number. IE: instead of { "TotalDisk": 123 }

Is there a way to achieve this without messing with the ajax settings when constructing an Editor?

Answers

This discussion has been closed.