Error with dataTable().fnAddData()

Error with dataTable().fnAddData()

bmahmoud5bmahmoud5 Posts: 2Questions: 1Answers: 0
edited March 2023 in Free community support
var abc = [
            { "accountCode": "01", "accountName": "avc", "parentAccount": "-", "finalAccount": "ww", "chartLevel": "1" },
            { "accountCode": "02", "accountName": "rtg", "parentAccount": "-", "finalAccount": "ee", "chartLevel": "1" }
        ]
$('#datatable1').dataTable().fnAddData(abc);

            console.log(abc);

It displays:

abc = [
            { "accountCode": 1, "accountName": "avc", "parentAccount": "-", "finalAccount": "ww", "chartLevel": "1" },
            { "accountCode": 2, "accountName": "rtg", "parentAccount": "-", "finalAccount": "ee", "chartLevel": "1" }
        ]

wht it remove the leading zero?

Thanks

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

This question has an accepted answers - jump to answer

Answers

Sign In or Register to comment.