I use datatables 1.10 for a while now, and I have come to a point in my development where I have a table in my db that stores a json object. Furthermore that table also contains an attribute called groupName. As the name suggests, the entries of that table are "grouped" by that attribute, and in that group, the json object has the same attributes.
Here an example of how my database table looks like:
+---------------------------------------------------------------------------+
|id|groupname |json |
+---------------------------------------------------------------------------+
|01|group1 |{"key1":"value1","key2":"value2"} |
|02|group1 |{"key1":"foo","key2":"bar"} |
|03|group2 |{"kex1":"foo1","keyab":"bar2","key1":"foo"}|
+---------------------------------------------------------------------------+
My page that contains the datatabase, and also has a dropdown menu populated with the group names which filters the the datatable for the particular group. The jsonObject of that filtered group is being displayed as a raw json string.
What I'm trying to do now is to parse my jsonObject, get the keys and populate them in the datatable as columns. The values of the jsonObject are displayed in the columns accordingly.
Where or how do I reinitialize the datatable, providing it with the proper column names?