I just hit this same error. I've set up something like twenty grids by now, but this is the first one to present me with this error.
Here is my dataSource declaration followed by my kendoGrid declaration:
var
dataFacts =
new
kendo.data.DataSource({
transport: {
read: {
url:
"/ProjectInfo/GetProjectFacts"
,
data: { projectId: projectId },
type:
"POST"
,
dataType:
"json"
},
update: {
url:
"/ProjectInfo/UpdateProjectFacts"
,
type:
"POST"
,
dataType:
"json"
}
},
schema: {
type:
"json"
,
id:
"header"
,
model: {
fields: {
"header"
: { editable:
true
, type:
"string"
},
"value"
: { editable:
true
, type:
"string"
}
}
}
}
});
var
factsGridColumnsInline = [
{
"field"
:
"header"
,
"title"
:
" "
,
"filterable"
:
true
,
"sortable"
:
true
,
"width"
:
"33%"
},
{
"field"
:
"value"
,
"title"
:
" "
,
"filterable"
:
true
,
"sortable"
:
true
}
],
factsGridObject;
factsGridObject = $(
"#gridFacts"
).kendoGrid({
dataSource: dataFacts,
columns: factsGridColumnsInline,
rowTemplate: kendo.template($(
"#factsRowTemplateInline"
).html()),
sortable: {
mode:
"multiple"
,
allowUnsort:
true
},
selectable:
"row"
,
pageable:
false
,
filterable:
false
columnMenu:
false
,
scrollable:
false
,
toolbar: factsGridToolbarInline,
editable: {
update:
true
,
destroy:
true
,
mode:
"inline"
,
confirmation:
"Are you sure?"
}
}).data(
"kendoGrid"
);
The "header" column contains the name of the field, and the "value" column contains the data in that field. We chose a grid as an alternative to creating 10+ separate individual fields with labels and input boxes (and custom code for each to make them editable).
I'm not able to find a reason behind this error. All our other grids function in essentially the same fashion, and this is the first one to present us with this particular error. Worse still, this error doesn't seem to have much information available about it on the forums.
Please help me understand what is causing this error, and why.
I select a row, click the Edit button, make a change, and click the Save button. Then I receive that error, and the highlighted section of code in kendo.all.min.js (on line 8) is:
specifically:
Thank you.
EDIT:
Relevant information:
Initially, I opted not to have an id defined in the schema for the dataSource, as there are no IDs associated with these records (they don't come from a single table), which led to me being unable to Edit records due to the grid calling the (nonexistent) Create() method function, rather than the Update() method. Once I provided it with an id by choosing the "header" column as such, it began calling the correct method, but failing to transport the data fully. Fiddler successfully intercepted the data transmission and received the relevant data in a properly-formed request, but the data never seems to be actually received by the server, and the JavaScript error still occurs. In Firefox, the error is "--
[16:53:11.279] TypeError: g is undefined @ http://localhost:9090/Scripts/kendo/kendo.all.min.js:8".