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

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -