Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81923

Alert elements form returned JSON

$
0
0

I am using the following to set the json returned to a global variable

 $('#dtInvoiceDetails')
    .on('xhr.dt', function ( e, settings, json, xhr ) {
           selectedPrintData = JSON.stringify(json);

    } );

the console shows

selectedPrintData = {"data":[{"DT_RowId":"row_10108","inv_list":{"lineID":"10108","InvID":"3113","quantity":"23","barCode":"5555","stockCode":"8686856","size":"77","colour":"","description":"more jjjjjjj","costPrice":"0.00","sellPrice":"5.00","lineTotalNett":"115.00","lineTotal":"0.00","vatRate":"0.00"}}],"options":[],"files":[]}

I have tried

console.log(selectedPrintData[0]['data']['inv_list']['quantity']);
console.log(selectedPrintData[0][data][inv_list][quantity]);

What is the correct way to get thhe returned data into an array then be able to alert the 'quantity' value.

Cheers

Steve Warby


Viewing all articles
Browse latest Browse all 81923

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>