datatable single line(ajax)

datatable single line(ajax)

chirochiro Posts: 16Questions: 8Answers: 0

I want to make a single line table into a datatable. Is it possible?

I am using ajax. My json is this.

{
name: "Tiger Nixon",
position: "System Architect",
salary": "$320,800",
}

I did it like below, a message saying 'No data available in table'
And type error.

data : data,
columns : [
{"data" : "name"},
{"data" : "position"},
{"data" : "salary"},
]

Please answer.Thanks

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    That should work - look at this example here, it's doing just that. Ensure the data is the correct format, you can see what's being sent on the Ajax tab, or the browser's network tab in the developer tools.

    Colin

This discussion has been closed.