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

Setting Type of Property

2 Answers 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
RGTech
Top achievements
Rank 1
RGTech asked on 08 May 2013, 11:05 PM
Hi,

I'm trying to set a type on a property on my nested schema.
In the column template on my KendoUI Grid, I'm binding to the datafield "Month1.EHR".
How do I set that column to be a "number" in my schema model?

I've tried the below, and many other variations, but nothing I've tried has worked.
dataSource: {
    type: "aspnetmvc-ajax",
    transport: {
        read: {
            url: "@Url.Action("_GetEHR", "Performance")", type: "POST",
            contentType: "application/json",
            data: //searchOptions()
            {
                periodDate: function () { return kendo.toString($("#periodDate").data("kendoDatePicker").value(), "MMM yyyy") }
            }
        },
        parameterMap: function (options) {
            return JSON.stringify(options);
        }
    },
    serverSorting: true,
    serverFiltering: true,
    serverPaging: true,
    pageSize: 50,
    schema: {
        model: {
            fields: {
                AccountName: { type: "string" },
                Month1: { EHR: { type: "number" } },
                Month2: { EHR: { type: "number" } },
                Month3: { EHR: { type: "number" } },
                Month4: { EHR: { type: "number" } },
                Month5: { EHR: { type: "number" } },
                Month6: { EHR: { type: "number" } },
                Month7: { EHR: { type: "number" } },
                Month8: { EHR: { type: "number" } },
                Month9: { EHR: { type: "number" } },
                Month10: { EHR: { type: "number" } },
                Month11: { EHR: { type: "number" } },
                Month12: { EHR: { type: "number" } }
            }
        },
        data: function (data) {
            return data.Data;
        },
        total: function (data) {
            return data.Total;
        }
    },
},
Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Petur Subev
Telerik team
answered on 10 May 2013, 12:08 PM
Hello Mike,

Nested objects fields could not be specified / parsed - such scenarios are not supported by the dataSource.

Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
RGTech
Top achievements
Rank 1
answered on 10 May 2013, 12:17 PM
Is there any other way to go about doing this, if what I'm asking cannot be done?
Tags
Grid
Asked by
RGTech
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
RGTech
Top achievements
Rank 1
Share this question
or