json data - aaData example does not work?

json data - aaData example does not work?

riixriix Posts: 13Questions: 7Answers: 0
edited September 2012 in DataTables 1.8
help. been at it for 3 days. no hair left to rip out. Issue is:
a. have a datatable
b. would like to load it from json data
c. would like to dynamically reload it when the json data source gets changed.

d. nothing works, finally devolved to the point of trying just the very simple example for "aaData" (putting this in the document ready function):

$('#ResGrid').dataTable({
"aaData": [{ "facNam": "aaa" }, { "facNam": "bbb"}]
,
"aoColumns": [
{ "sTitle": "Facility", "mData": "facNam" }
]
});
where further down below on the page is:
facNam

e. this results in dreaded "requested unknown parameter '0' from the data source for row 0"

f. can anyone explain what I am doing wrong?
g. if we ever get this running, any suggestions on how to clear and rebind to a json object?

thx in advance.

Replies

  • BLSullyBLSully Posts: 24Questions: 1Answers: 0
    If you're using DataTables 1.8, you need to use "mDataProp", not "mData"
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    edited September 2012
    Anything less than 1.9.3 actually :-).

    @riix - Please link us to a test page showing the error if BLSully's suggestion doesn't help.

    Allan
This discussion has been closed.