简体   繁体   English

如何从kendo UI中的dataSource获取某些字段值

[英]How can get certain field value from dataSource in kendo UI

I have defined dataSource like this: 我已经定义了dataSource,如下所示:

var dataSource = new kendo.data.DataSource({
  data: [
    {Id: 1, name: "Jane Doe", description: "some description", numberValue: "3000.00" },
    {Id: 2, name: "John Connor", description: "description temp", numberValue: "1800.00" },
    {Id: 3, name: "T-100", description: "descr tmp", numberValue: "2200.00"}
  ],
  schema: {
        model: {
            id: "Id",
            fields: {
                Id: { type: "number" },
                name: { type: "string" },
                description: { type: "string" },
                numberValue: { type: "number" }
            }
        }
    }
});

How can I get certain field value from dataSource? 如何从dataSource获取某些字段值? For example: I want get value for field numberValue (where Id = 1, or Id = 2 or Id = 3). 例如:我想要获取字段numberValue的值(其中Id = 1,或Id = 2或Id = 3)。 If I call dataSource.data.numberValue then nothing happening. 如果我调用dataSource.data.numberValue,则什么都没有发生。 Any help really appreciated. 任何帮助真的很感激。 Thank you in advance. 先感谢您。

dataSource.data显然是一个数组。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM