Browser: Internet Explorer 10 (although it occurs in all browsers)
Kendo UI v2013.2.716
jQuery: as Included in trial download
SCRIPT5007: Unable to get property 'toLowerCase' of undefined or null reference
kendo.all.min.js, line 13 character 1431
's' is undefined.
This error happens whenever I call dataSource.read(), and after the service successfully returns a response with a result in it.
Here's how I have my DataSource setup, tied to a Grid widget:
var myDataSource = new kendo.data.DataSource({
transport: {
create:{
dataType: "json",
url: CREATE_CONTACT,//Global var equal to service uri to call for this operation
type: "POST",
async:false
},
read: {
dataType: "json",
url: RETRIEVE_CONTACTS,//Global var equal to service uri to call for this operation
type: "POST",
async:false,
success:function(response){
//This is never being called.
// Error occurs whether I include a "success" method or not.
return response;
},
error:function(jqxhr){
//This is never being called.
// Error occurs whether I include a "success" method or not.
errorMsgDlg("Read Error","Error Reading Grid", jqxhr);
}
},
update:{
dataType: "json",
url: UPDATE_CONTACT,//Global var equal to service uri to call for this operation
type: "POST",
async:false
},
destroy:{
dataType: "json",
url: DELETE_CONTACT,
type: "POST",
async:false
},
parameterMap: function(data, type) {
var contactGroupID = viewModel.get("contactGroupID"),
contactGroupID = contactGroupID.toJSON(),
parameters;
if (type == "create") {
parameters = {
contactGroupID: JSON.stringify(contactGroupID) || "",
models: kendo.stringify(data.models) || ""
};
}
else if (type == "read") {
parameters = {
contactGroupID: JSON.stringify(contactGroupID) || ""
};
}
else if (type == "update") {
parameters = {
contactGroupID: JSON.stringify(contactGroupID) || "",
models: kendo.stringify(data.models) || ""
};
}
else if (type == "destroy") {
parameters = {
contactGroupID: JSON.stringify(contactGroupID) || "",
models: kendo.stringify(data.models) || ""
};
}
return parameters || {};
}
},
schema: {
parse:function(response){
//Never see this get called
return response;
},
model: {
id: "name",
fields: {
name: { type: "string" },
email: { type: "string" },
organization: { type: "string" },
type: { type: "string" }
}
}
,data: function(response){
//Never see this get called
return response;//Should be an array of contacts
}
}
});
$("#mygrid").kendoGrid({
scrollable: true,
dataSource: myDataSource,
columns: [
{
field:"name",
title: "POC Name"
},
{
field:"email",
title: "Email"
},
{
field:"organization",
title: "Organization"
},
{
field:"type",
title: "Type"
}
],
change:function(e){
//I'm not seeing this get called.
var dataItem = this.dataItem() || this.dataItem(e.item.index()) || {},
name = dataItem.name || "",
email = dataItem.email || "",
organization = dataItem.organization || "",
type = dataItem.type || "Action";
/*Do stuff*/
}
});
/*
This function is activated when a user selects an item to load.
function MyOnLoadFunction(){
/*
snip - setting data in viewModel with kendo MVVM
*/
var MyGrid = $("#mygrid").data("kendoGrid");
MyGrid.dataSource.read();//Happens during this call, but after the service returns
MyGrid.refresh();
/*snip other loading stuff*/
}
/*snip HTML stuff*/
<div id="mygrid"></div>
/*snip more html*/
Kendo UI v2013.2.716
jQuery: as Included in trial download
SCRIPT5007: Unable to get property 'toLowerCase' of undefined or null reference
kendo.all.min.js, line 13 character 1431
's' is undefined.
This error happens whenever I call dataSource.read(), and after the service successfully returns a response with a result in it.
Here's how I have my DataSource setup, tied to a Grid widget:
var myDataSource = new kendo.data.DataSource({
transport: {
create:{
dataType: "json",
url: CREATE_CONTACT,//Global var equal to service uri to call for this operation
type: "POST",
async:false
},
read: {
dataType: "json",
url: RETRIEVE_CONTACTS,//Global var equal to service uri to call for this operation
type: "POST",
async:false,
success:function(response){
//This is never being called.
// Error occurs whether I include a "success" method or not.
return response;
},
error:function(jqxhr){
//This is never being called.
// Error occurs whether I include a "success" method or not.
errorMsgDlg("Read Error","Error Reading Grid", jqxhr);
}
},
update:{
dataType: "json",
url: UPDATE_CONTACT,//Global var equal to service uri to call for this operation
type: "POST",
async:false
},
destroy:{
dataType: "json",
url: DELETE_CONTACT,
type: "POST",
async:false
},
parameterMap: function(data, type) {
var contactGroupID = viewModel.get("contactGroupID"),
contactGroupID = contactGroupID.toJSON(),
parameters;
if (type == "create") {
parameters = {
contactGroupID: JSON.stringify(contactGroupID) || "",
models: kendo.stringify(data.models) || ""
};
}
else if (type == "read") {
parameters = {
contactGroupID: JSON.stringify(contactGroupID) || ""
};
}
else if (type == "update") {
parameters = {
contactGroupID: JSON.stringify(contactGroupID) || "",
models: kendo.stringify(data.models) || ""
};
}
else if (type == "destroy") {
parameters = {
contactGroupID: JSON.stringify(contactGroupID) || "",
models: kendo.stringify(data.models) || ""
};
}
return parameters || {};
}
},
schema: {
parse:function(response){
//Never see this get called
return response;
},
model: {
id: "name",
fields: {
name: { type: "string" },
email: { type: "string" },
organization: { type: "string" },
type: { type: "string" }
}
}
,data: function(response){
//Never see this get called
return response;//Should be an array of contacts
}
}
});
$("#mygrid").kendoGrid({
scrollable: true,
dataSource: myDataSource,
columns: [
{
field:"name",
title: "POC Name"
},
{
field:"email",
title: "Email"
},
{
field:"organization",
title: "Organization"
},
{
field:"type",
title: "Type"
}
],
change:function(e){
//I'm not seeing this get called.
var dataItem = this.dataItem() || this.dataItem(e.item.index()) || {},
name = dataItem.name || "",
email = dataItem.email || "",
organization = dataItem.organization || "",
type = dataItem.type || "Action";
/*Do stuff*/
}
});
/*
This function is activated when a user selects an item to load.
function MyOnLoadFunction(){
/*
snip - setting data in viewModel with kendo MVVM
*/
var MyGrid = $("#mygrid").data("kendoGrid");
MyGrid.dataSource.read();//Happens during this call, but after the service returns
MyGrid.refresh();
/*snip other loading stuff*/
}
/*snip HTML stuff*/
<div id="mygrid"></div>
/*snip more html*/