我将数据绑定到Kendo网格并具有以下Schema。
$("#divShowReports").kendoGrid({
dataSource: {
data: data,
schema: {
model: {
fields: {
ReportID: { type: "string" },
ReportName: { type: "string" },
ReportQuery: { type: "string" },
IsAccessToAll: { type: "string" },
CustomerID: { type: "string" },
CustUserID: { type: "string" }
}
}
},
pageSize: 10,
},
sortable: true,
filterable: true,
columnMenu: true,
pageable: true,
columns: [{
field: "ReportName", title: "Report Name",
template: "<a value='#=ReportQuery#' href='javascript:void(0)' onclick=ShowAdhocGrid(this)>#=ReportName#</a>"
},
{ field: "ReportID", title: "ReportID", hidden: true },
{ field: "ReportQuery", title: "Report Query" },
{ field: "IsAccessToAll", title: "Is Access to All" },
{ field: "CustUserID", title: "CustUserID" },
{ field: "CustomerID", title: "CustomerID" },
]
});
}
}
现在我得到&#34; ReportQuery&#34;来自不同API调用的字段值。请帮助我,在不打扰其他事情的情况下如何将新数据合并到旧架构中。
谢谢
答案 0 :(得分:0)
您自己在数据属性的网格上设置数据,对吗?
假设您有多个api呼叫,请添加一些承诺,并在所有呼叫完成后跟踪,以便准备好所有响应。
然后,执行您需要做的任何事情,合并数据集,更新您设置为数据集的对象上的某些字段,并且不需要打扰任何内容。您可以控制字段的名称以及进入它们的数据。
基本上所有工作都在数据源对象上完成。