this.api() access Options from JSON response

this.api() access Options from JSON response

Restful Web ServicesRestful Web Services Posts: 202Questions: 49Answers: 2

Is it possible to access the options key from the JSON response when using the ajax server side method having set some options in the php file?

I.e. in my JSON response below can I access the options using a this.api function in an initCompletefunction?

{
"data":[],
"options":
    {
        "t_owneraccount.iChaletId":[{"label":"Test 1","value":"128"}],
        "t_owneraccount.iChaletId":[{"label":"Test 2","value":"100"}],
    },
}

Answers

  • Restful Web ServicesRestful Web Services Posts: 202Questions: 49Answers: 2

    Should have checked the documentation further! For anyone interested the answer is:

        var json = table.ajax.json();
        console.log( json.options['t_owneraccount.iChaletId'] );
    

    Thanks

This discussion has been closed.