[英]Populate a column in Kendo Grid based on separate Datasource
I have a kendo grid like what I've posted below. 我有一个剑道网格,就像我在下面发布的一样。 I'm populating the grid based on the data in the url I provided for it.
我根据提供的网址中的数据填充网格。 However, there is one column on the grid, the
flag
column, which I would like to be a separate datasource to populate that column, based on the id. 但是,网格上只有一列,即
flag
列,我想作为一个单独的数据源根据ID填充该列。 The datasource for that column would look something like: 该列的数据源如下所示:
[{id:1234, flag: 'N'}, {id:5678, flag:'Y'}]
Is there a way where I can populate just 1 column in the grid based on a completely different datasource from the rest of the grid? 有没有一种方法可以根据与网格其余部分完全不同的数据源在网格中仅填充一列? The flag would need to be placed on the row of its corresponding id.
该标志将需要放置在其相应ID的行上。 If so, how can I implement this?
如果是这样,我该如何实施? Any help would be appreciated.
任何帮助,将不胜感激。
$("#grid").kendoGrid({
dataSource: {
type: "odata",
transport: {
read: url
},
pageSize: 30
},
height: 400,
groupable: true,
sortable: true,
pageable: {
refresh: true,
pageSizes: true,
buttonCount: 5
},
columns: [{
field: "id",
title: "ID",
width: 240
}, {
field: "FirstName",
title: "First Name"
}, {
field: "LastName",
title: "LastName"
}, {
field: "flag",
title: "Flag",
width: 150
}]
});
Consider using a foreign key column. 考虑使用外键列。
http://demos.telerik.com/kendo-ui/grid/foreignkeycolumn http://demos.telerik.com/kendo-ui/grid/foreignkeycolumn
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.