Here is a simplified version of my code (there is nothing in the <table>):
And everything works fine, except that when I use the dropdown to change the value, it never changes in the datasource. My change even never fired (I cut it out of here) and if I try to update, the field edited by the dropdown is not changed. THe other fields (there are text fields, number fields, etc. in the none abbreviated code) all fire the change event and show up in the datasource. Any idea why this isn't changing anything?
var
_manu = [{
"text"
:
"Acme"
,
"value"
:1},{
"text"
:
"Other"
,
"value"
:2}];
function
getManufacturerName(id) {
for
(
var
i = 0; i < _manu.length; i++) {
if
(_manu[i].value == id) {
return
_manu[i].text; }
}
return
''
;
}
gridDataSource =
new
kendo.data.DataSource({
batch:
true
,
transport: {
read: { url:
'myUrl'
},
},
schema: {
model: {
id:
"ItemId"
,
fields: {
ManuId: { type:
"number"
}
}
}
}
});
var
kendoGrid = gridObj.kendoGrid({
dataSource: gridDataSource,
selectable:
"row"
,
editable:
true
,
columns: [
{
field:
"ManuId"
,
title:
"Manufacturer"
,
editor: manufacturerDropDownEditor,
template:
"#= getManufacturerName(ManufacturerId) #"
}
]
}).data(
'kendoGrid'
);
function
manufacturerDropDownEditor(container, options) {
$(
'<input data-bind="value:'
+ options.field +
'"/>'
)
.appendTo(container)
.kendoDropDownList({
dataTextField:
"text"
,
dataValueField:
"value"
,
dataSource: _manu
});
}
And everything works fine, except that when I use the dropdown to change the value, it never changes in the datasource. My change even never fired (I cut it out of here) and if I try to update, the field edited by the dropdown is not changed. THe other fields (there are text fields, number fields, etc. in the none abbreviated code) all fire the change event and show up in the datasource. Any idea why this isn't changing anything?