Nested Custom HTTP variables

Nested Custom HTTP variables

jasper502jasper502 Posts: 25Questions: 9Answers: 0

I am currently using custom HTTP variables to return view data back to the https://datatables.net/examples/server_side/custom_vars.html controller. In this example they have:

"data": function ( d ) {
                d.myKey = "myValue";

which would add myKey=myValue to the parameters.

Is it possible to return nested parameters such as myKey[one]=myValue&myKey[two]=myOtherValue?

Answers

  • kthorngrenkthorngren Posts: 21,143Questions: 26Answers: 4,918

    There are no special restrictions or requirements Datatables has for the object. You just need to use standard Javascript object notation. You would have something like this:

    "data": function ( d ) {
                    d.myKey.1 = "myValue";
                    d.myKey.2 = "myOtherValue";
    

    Kevin

This discussion has been closed.