How popular a datatable to json
How popular a datatable to json
![bkfsec](https://secure.gravatar.com/avatar/8bf8fabd0cd3b197b72696d1f3a9484e/?default=https%3A%2F%2Fvanillicon.com%2F8bf8fabd0cd3b197b72696d1f3a9484e_200.png&rating=g&size=120)
Hi, I have the following format Json:
[{"idComponent":1,"idComponentLabel":"C1","componentName":"COMPONENT","description":"COMPONENT","isAssignedComponent":true},
{"idComponent":2,"idComponentLabel":"C2","componentName":"COMPONENT2","description":"COMPONENT2","isAssignedComponent":true}]
as popular a datatable
This discussion has been closed.
Answers
Use
ajax.dataSrc
and set it to be an empty string. Then usecolumns.data
to tell each column what property to use for that column.See the data section of the manual for more information.
Allan
Sorry I try to be clearer. I have a String with this format
And I'm trying to populate the table as follows
First thing to note is that fnRender was removed in 1.10 so that isn't going to work. Use
columns.data
andcolumns.render
instead.Beyond that, what you have looks like it should work okay.
Allan