I have an editable Grid.
When using just editable: true, the edit function behaves as expected.
However, when using editable: {update: true} the grid is not editable.
Is this a bug? If not, I'm posting my code below:
When using just editable: true, the edit function behaves as expected.
However, when using editable: {update: true} the grid is not editable.
Is this a bug? If not, I'm posting my code below:
var
dataSourceStatistics =
new
kendo.data.DataSource({
batch:
true
,
transport: {
read: {
data: {
f:
'getOrderSuggestion'
}
}
},
schema: {
data:
function
(data) {
return
data.result.custStats.Record;
},
total:
function
(data) {
return
data.result.custStats.Record.length;
},
model:{
// TODO: id should be EmployeeId
id:
"Employee"
,
fields: {
Employee: {
},
EmployeeId: {
},
ValueCultureAndExercise: {
type:
"number"
,
defaultValue:
"0"
,
validation: {
}
},
ValueExercise: {
type:
"number"
,
defaultValue:
"0"
},
Company: {
editable:
false
,
defaultValue:
function
() {
return
"apa"
;
}
},
CompanyNo: {
editable:
false
},
Department: {
},
Total:
function
() {
return
this
.ValueExercise * 10;
}
}
}
}
});
$(
"#orderGrid"
).kendoGrid({
dataSource: dataSourceStatistics,
editable: {
update:
true
,
destroy:
true
},
sortable:
true
,
selectable:
true
,
toolbar: [{name:
"create"
, text:
"Lägg till rad"
}],
columns: [
{
field:
"Employee"
,
title:
"Namn"
},
{
field:
"EmployeeId"
,
title:
"Anställningsnummer"
},
{
field:
"ValueExercise"
,
title:
"Värde träning"
},
{
field:
"ValueCultureAndExercise"
,
title:
"Värde träning och kultur"
},
{
field:
"null"
,
title:
"Totalt"
,
template:
"#= ValueCultureAndExercise + ValueExercise#"
},
{
command:
"destroy"
,
title:
"Ta bort"
}
]
});