Could not add rows with json array

Could not add rows with json array

vyongjayvyongjay Posts: 2Questions: 1Answers: 0

I couldn't add rows with the json array format

Even I tried with the example it's still no luck.
This is from example (https://datatables.net/reference/api/rows.add())

**//Initialize new table
var table = $('#example').DataTable();

table.rows.add( [ {
"name": "Tiger Nixon",
"position": "System Architect",
"salary": "$3,120",
"start_date": "2011/04/25",
"office": "Edinburgh",
"extn": "5421"
}, {
"name": "Garrett Winters",
"position": "Director",
"salary": "$5,300",
"start_date": "2011/07/25",
"office": "Edinburgh",
"extn": "8422"
} ] )
.draw();**

When I run the example, there is an error message :
"DataTables warning: table id=reportTable - Requested unknown parameter '0' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4"

The error message is also attached
Anyone please helpp

Answers

This discussion has been closed.