**How to read and Retrive Json from Datatable geting _aData**

**How to read and Retrive Json from Datatable geting _aData**

eusebiogermaneusebiogerman Posts: 1Questions: 0Answers: 0

Example:

function **readjson() {
data = table_det.rows('.selected').columns().cells().context[0].aoData;
**for
(let i=0; i<data.length;i++)
{
id = table_det.rows('.selected').columns().cells().context[0].aoData[i]._aData[1]);
console.log(id)
}

Replies

  • kthorngrenkthorngren Posts: 16,808Questions: 25Answers: 3,984

    Please provide details of what you are trying to do so we can offer suggestions.

    If you want to read the JSON us ajax.json().

    If you want the row data use rows().data(). See this example of using the select extension to get the select rows.

    Kevin

  • allanallan Posts: 56,851Questions: 1Answers: 9,035 Site admin

    Just to add to what Kevin said, _aData is an internal property. If you are reading from it, then you are doing it wrong ;). Use the API such as the two methods Kevin suggested or cell().data() for a specific cell.

    Allan

Sign In or Register to comment.