I am trying to put this JSON data into my html table using datatables jQuery plugin.
{
"status":{"1":"Debit","2":"Debit","3":"Debit","4":"Debit","5":"Debit","6":"Debit","7":"Debit"},
"funds code":{"1":"None","2":"None","3":"None","4":"None","5":"None","6":"None","7":"None"},
"amount":{"1":"-298.01 USD","2":"-4930 USD","3":"-8334 USD","4":"-366.18 USD","5":"-6.39
USD","6":"-5 USD","7":"-0.80 USD"},
"id":{"1":"NTRF","2":"NTRF","3":"NTRF","4":"NTRF","5":"NTRF","6":"NTRF","7":"NTRF"},
"customer reference":
{"1":434433,"2":434661,"3":434796,"4":435273,"5":435506,"6":435688,"7":435688},
"bank reference":{"1":"None","2":"None","3":"None","4":"None","5":"None","6":"None","7":"None"},
"extra details":{"1":"","2":"","3":"","4":"","5":"","6":"","7":""},
"currency":{"1":"USD","2":"USD","3":"USD","4":"USD","5":"USD","6":"USD","7":"USD"},
"date":
{"1":1625270400000,"2":1625270400000,"3":1625270400000,"4":1625270400000,"5":1625270400000,"6":1625270400000,"7":1625270400000},
"entry date":{"1":"2021-07-03","2":"2021-07-03","3":"2021-07-03","4":"2021-07-03","5":"2021-07-
03","6":"2021-07-03","7":"2021-07-03"},
"guessed entry date":{"1":"2021-07-03","2":"2021-07-03","3":"2021-07-03","4":"2021-07-
03","5":"2021-07-03","6":"2021-07-03","7":"2021-07-03"},
}
This is what I’ve written in my main.js file and I think there is an error with how I have defined my columns. Any clue to what the error might be?
$(document).ready( function () {
$('#example').DataTable({
'ajax': './desired_forms/mt_in_json_form.json'
'columns': [
{"status"},
{"funds code"},
{"amount"},
{"id"},
{"customer reference"},
{"bank reference"},
{"extra details"},
{"currency"},
{"date"},
{"entry date"},
{"guessed entry date"}
]
});
} );