how does aocolumns match to data?

how does aocolumns match to data?

rockcowrockcow Posts: 4Questions: 2Answers: 0

My datatable only display data for first column and rest of 7 columns are blank.
the only reason datatable display data for first column is because "mData" so don't refer me to reference.
I already went to reference.

http://debug.datatables.net/ajesoh

show that datatable got all data but does not display rest of data almost if it could not find rest of data.
I notice aocolumns is array of objects [{"mData":"name"},{"mData":"email"}] while my data is
[{"name":"john","email":"john@email.com"}]
should I rewrite aocolumns to match my data structure?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    Thanks for the debug trace. It shows:

    DataTables 1.9.0

    mData didn't exist in 1.9.0. It was called mDataProp.

    You could upgrade to 1.9.4, but really I would suggest updating to the latest release - 1.10.3.

    Allan

  • rockcowrockcow Posts: 4Questions: 2Answers: 0

    You are right. change mData to mDataProp allow datatable to display rest of data. I need to discuss with my coworker on upgrade to 1.10.
    Thank you very much.

This discussion has been closed.