how can I use row data from a child table and present it as column data (one row is the header and the next is corresponding data) on the parent table while displaying some additional data from the parent table.
how can I use row data from a child table and present it as column data (one row is the header and the next is corresponding data) on the parent table while displaying some additional data from the parent table.
In your model and html you need follow the same:
i.e:
...
function Model() {
var self = this;
self.headersTableCol = ko.observableArray();
...
//In your method to retrieve data parse to JSON
//Iterate over that and for the first row apply
//transformation to the follow format in new object:
var headerJSON = {headerText: json["label"], field: json["field"]}
headerJSONArray.push(headerJSON);
...
//After loop over columns proceed with this:
self.headersTableCol(headerJSONArray);
...
<oj-table columns='[[headersTableCol]]'></oj-table>
And voilĂ that will allow you handle your columns dynamically.
I hope helps, regards.