【发布时间】:2020-07-15 21:47:02
【问题描述】:
如何使用子表中的行数据并将其显示为父表上的列数据(一行是标题,下一行是相应数据),同时显示父表中的一些附加数据。
【问题讨论】:
标签: oracle-jet
如何使用子表中的行数据并将其显示为父表上的列数据(一行是标题,下一行是相应数据),同时显示父表中的一些附加数据。
【问题讨论】:
标签: oracle-jet
在您的模型和 html 中,您需要遵循相同的:
即:
...
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>
瞧,这将允许您动态处理列。
希望对您有所帮助,问候。
【讨论】: