I am testing out these new widgets and am attempting to use the popup edit mode with a grid and am not having any luck.
The grid is showing the value I need it to show the text.
The popup drop list is not selected when it pops up.
Once selected and click update it does not reflect the change in the grid.
Please let me know the way to do this I am using ASP.NET MVC 3, jquery 1.7.1 and KendoUI 2012 Q1.
The grid is showing the value I need it to show the text.
The popup drop list is not selected when it pops up.
Once selected and click update it does not reflect the change in the grid.
Please let me know the way to do this I am using ASP.NET MVC 3, jquery 1.7.1 and KendoUI 2012 Q1.
var
crudServiceBaseUrl =
"/Admin/"
,
dataSource =
new
kendo.data.DataSource({
transport: {
read: {
url: crudServiceBaseUrl +
"UserEditorRead"
,
dataType:
"json"
,
type:
"POST"
},
update: {
url: crudServiceBaseUrl +
"UserEditorUpdate"
,
dataType:
"json"
,
type:
"POST"
},
destroy: {
url: crudServiceBaseUrl +
"UserEditorDestroy"
,
dataType:
"json"
,
type:
"POST"
},
create: {
url: crudServiceBaseUrl +
"UserEditorCreate"
,
dataType:
"json"
,
type:
"POST"
},
parameterMap:
function
(options, operation) {
if
(operation !==
"read"
&& options.models) {
return
{ models: kendo.stringify(options.models) };
}
}
},
batch:
true
,
pageSize: 30,
schema: {
model: {
id:
"UserID"
,
fields: {
UserID: { editable:
false
, nullable:
true
},
UserFirstName: { editable:
true
, validation: { required:
true
} },
UserLastName: { editable:
true
, validation: { required:
true
} },
UserGroupID: { editable:
true
, validation: { required:
true
} },
UserLastActivityDate: { editable:
false
, type:
"date"
},
UserCreateDate: { editable:
false
, type:
"date"
}
}
}
}
});
$(
"#gridUserManage"
).kendoGrid({
dataSource: dataSource,
pageable:
true
,
height: 600,
toolbar: [
"create"
],
columns: [
{ title:
"ID"
, field:
"UserID"
, width: 40 },
{ title:
"First"
, field:
"UserFirstName"
, width: 100 },
{ title:
"Last"
, field:
"UserLastName"
, width: 100 },
{ title:
"Group"
, field:
"UserGroupID"
, width: 200,
editor:
function
(container, options) {
$(
'<input name="'
+ options.field +
'"/>'
).appendTo(container).kendoComboBox({
dataSource:
new
kendo.data.DataSource({
data: [
{ Id:
"1"
, title:
"Guest"
},
{ Id:
"2"
, title:
"Employee"
}
]
}),
dataValueField:
"Id"
,
dataTextField:
"title"
,
autobind:
false
});
}
},
{ command: [
"edit"
,
"destroy"
], title:
" "
, width:
"210px"
}],
editable: { mode:
"popup"
, confirmation:
false
},
remove:
function
(e) {
// also can we e.cancel=true here?
}
});