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

DataSource set to another variable

1 Answer 748 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 16 Apr 2015, 01:43 PM

I have a MVVM page where upon loading, it make an ajax request to retrieve a model and set the viewmodel to the retrieved model.  This model has a few strings and includes a LIST<rates> type.  The form is bound to the model and includes input boxes for the strings plus an EDITABLE grid for the List<rates>.  My issue is binding the grid to the List<rates> AND allowing it to be editable with a schema.  How do I setup the Datasource to point to the List<rates> for the grid, and include a schema to allow for inline editing?  I was trying to avoid having a separate remote datasource call since I already have the data from the initial setup.

My model is like this:

var existingtimeKeeperRatesModel = kendo.data.Model.define({
    id: "TimeKeeperName",
    fields: {
        "TimeKeeperName": {
            type: "string",
            editable: false
        },
        "StandardRate": {
            type: "number",
            editable: false
        },
        "FromRate": {
            type: "number",
            editable: false
        },
        "ToRate": {
            type: "number",
            editable: true
        },
        "RateTerminateDate": {
            type: "date",
            editable: true,
            parse: function (value) {
                return kendo.parseDate(value, "MM-dd-yyyy");
            }
        }
    },
})

 

 

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 20 Apr 2015, 10:36 AM
Hi Josh,

In case you want the dataSource to automatically parse the data list you should pass it through custom transport function. That said you should configure dataSource with local CRUD operations as explained in this help topic:
Please test the suggested approach and let me know if you have any further questions.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Data Source
Asked by
Josh
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or