This is a migrated thread and some comments may be shown as answers.
Grid Issue
4 Answers 238 Views
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 20 Apr 2012, 01:36 AM
When you have an editable grid, something in the most recent version is requiring the parameterMap function to be present, even if it does nothing. My code is copied below, and if I comment out parameterMap and try to submit batch changes, I get the following error:

Uncaught TypeError: Cannot read property 'field' of undefined

var contactData = new kendo.data.DataSource({
        transport: {
            read: {
                url: baseUrl + "/contact",
                dataType: 'json'
            },
            update: {
                url: baseUrl + "/contact/update",
                type: "POST"
            },
            destroy: {
                url: baseUrl + "/contact/delete",
                type: "POST"
            },
            create: {
                url: baseUrl + "/contact/create",
                type: "POST"
            },
            parameterMap: function(options, operation) {}
        },
        batch: true,
        schema: {
            model: contactModel
        },
        requestStart: function(e) {
            //console.log(e);
        },
        error: function(e) {
            alert("Error: " + e.errorThrown);
        }
    });

4 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 24 Apr 2012, 04:02 PM
Hello Tim,

We are not aware of such issue and the information that you provided is not sufficient enough to determine what is causing this behaviour.
Is it possible to send us a sample but runnable project that reproduces the problem or maybe a jsFiddle example? Please provide such demo and we will check it right away.

Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Chris Foster
Top achievements
Rank 1
answered on 01 May 2012, 12:55 PM
I'm getting the same error too..  Sorry but I don't have time to create an isolated test at the moment - will post here if I get around to it.
0
Chris Foster
Top achievements
Rank 1
answered on 03 May 2012, 06:52 AM
My issue turned out to be related to the datasource schema not being complete.
0
Timothy
Top achievements
Rank 1
answered on 26 Jun 2012, 01:45 PM
Chris.. can you post your fail / pass code for people who come across this?


Here is my failing code that works for add / edit, but not delete.

this.model = {
id: 'familyAssignment_id',
fields: {
familyAssignment_id: {editable: false, nullable: true },
assignment_main: { editable: true},
instructions: {editable:true},
status: {editable:false},
members: {editable:true},
litImg: {editable: false},
due_date: {editable:true},
litThumb: {editable:false},
litName: {editable:false},
start_date: {editable:true},
subject: {editable:false}
}
};
if (this.renderItems == 'none') {
this.pagingSize= 10000;
} else {
this.pagingSize= 10;
}
this.datasource = new kendo.data.DataSource({
pageSize:this.pagingSize,
batch: false,
schema:{
data: 'data',
total: 'recordCount',
model: this.model
},
serverFiltering : true,
transport:{
read:{
url:this.loadURL
dataType: 'json'
},
create:{
url:this.saveURL,
dataType: 'json'
},
update:{
url:this.saveURL,
dataType: 'json'
},
destroy:{
url:this.removeURL,
dataType: 'json'
}
}


})


Thanks,

Timothy
Tags
Grid
Asked by
Tim
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Chris Foster
Top achievements
Rank 1
Timothy
Top achievements
Rank 1
Share this question
or