The editor for the RoleIds property shows the correct selections when the row enters the "edit" mode. However, if I change the selected value in this control and press the update button, no call to my update url is made, as if nothing changed.
What am I missing?
Here's the code (see attached image for behavior):
<div id="myGrid"></div>
<script type="text/javascript">
$(function () {
var dataSource = new kendo.data.DataSource({
transport: {
read: { url: "/Test/TestRead"},
update: {
url: "/Test/TestUpdate",
type: "POST"
}
},
schema: {
model: {
id: "Id"
}
}
});
$('#myGrid').kendoGrid({
columns:
[
{command:
[{
name:"edit",
buttonType:"ImageAndText",
text:"Edit"
}]
},
{
field: "Name"
},
{
title:"Roles",
template:"#: RoleCSV #",
field: "RoleIds",
editor: "<select id='RoleIds' name='RoleIds' data-val='true' data-bind='value: RoleIds' multiple style='width:100%'><option value='1'>Admin</option><option value='2'>Guest</option></select>"
}
],
dataSource: dataSource,
model:{
},
editable: { mode: "inline", update: true}
});
});
</script>
Returned data from the read url looks like this:
[{"Id":1,"Name":"Mathieu","RoleCSV":"Admin","RoleIds":[1]},{"Id":2,"Name":"Martin","RoleCSV":"Admin, Guest","RoleIds":[1,2]},{"Id":3,"Name":"Patrick","RoleCSV":"Guest","RoleIds":[2]}]
What am I missing?
Here's the code (see attached image for behavior):
<div id="myGrid"></div>
<script type="text/javascript">
$(function () {
var dataSource = new kendo.data.DataSource({
transport: {
read: { url: "/Test/TestRead"},
update: {
url: "/Test/TestUpdate",
type: "POST"
}
},
schema: {
model: {
id: "Id"
}
}
});
$('#myGrid').kendoGrid({
columns:
[
{command:
[{
name:"edit",
buttonType:"ImageAndText",
text:"Edit"
}]
},
{
field: "Name"
},
{
title:"Roles",
template:"#: RoleCSV #",
field: "RoleIds",
editor: "<select id='RoleIds' name='RoleIds' data-val='true' data-bind='value: RoleIds' multiple style='width:100%'><option value='1'>Admin</option><option value='2'>Guest</option></select>"
}
],
dataSource: dataSource,
model:{
},
editable: { mode: "inline", update: true}
});
});
</script>
Returned data from the read url looks like this:
[{"Id":1,"Name":"Mathieu","RoleCSV":"Admin","RoleIds":[1]},{"Id":2,"Name":"Martin","RoleCSV":"Admin, Guest","RoleIds":[1,2]},{"Id":3,"Name":"Patrick","RoleCSV":"Guest","RoleIds":[2]}]