This is a migrated thread and some comments may be shown as answers.

Why the Id field cannot display on the kendo grid?

1 Answer 91 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Weera
Top achievements
Rank 1
Weera asked on 07 Jun 2012, 11:20 PM
Hi,
This is MVC4, ASP.net, C#

I have data model such as following

ProductId
ProductName

I tried with many time but got the same result

the ProductId is "undefined"
Why?

(function (mstats, $) {

    var Product = kendo.data.Model.define({
        ProductId: "ProductId"
    })

    var dataSource = new kendo.data.DataSource({
        transport: {
            read: {
                url: "../api/Product/GetAllProduct",
                dataType: "json"
            }
        },
        schema: {
            model: Product
        }
    });

    $('#grid').kendoGrid({
        dataSource: dataSource,
        selectable: true,
        columns: [
        {
            Field: "ProductId",
            title: "Product-Id"
        },
        {
            field: "ProductName",
            title: "Product-Name"
        }]
    });
} (this.mstats = this.mstats || {}, jQuery))



1 Answer, 1 is accepted

Sort by
0
Weera
Top achievements
Rank 1
answered on 07 Jun 2012, 11:39 PM
Solved when take a look at how the team implement jQuery UI Widget.
Tags
Grid
Asked by
Weera
Top achievements
Rank 1
Answers by
Weera
Top achievements
Rank 1
Share this question
or