javascript - Need to access mData nested value in jquery datatable -


below api response,

{ "aadata":{"req":[{"requests":"132"}]}} 

need show requests value in jquery datatable below code,

"aocolumndefs": [         {             "atargets": [0],             "mdata":"req[0].requests",         }, 

but above code not working,but if change api reponse below,

{ "aadata":{"req":"132"}} "aocolumndefs": [             {                 "atargets": [0],                 "mdata":"req",             }, 

above code working.....how can access requests value kind of response { "aadata":{"req":[{"requests":"132"}]}} , anyhelp appreciated..

you can try follows

"aocolumndefs": [     {         "atargets": [0],         "mdata":"req[0]["requests"],     } 

instead of

   "aocolumndefs": [     {         "atargets": [0],         "mdata":"req[0].requests",     }, 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -