Dear Forum,
I have been playing around with KendoUI in the past week. I like the ease of use. I have to admit that I am one of those that first needed Javascript and then started to lern it. Or you I say starts to.
I wanted for a mokeup create a grid with a button in the toolbar that toggels edit mode on and off.
Thus I defined the validations in the model and set editable to false. As you can see the toolbar is stored in anohter object.
The idea being that I would bind a on click event to the button that will set editable to true and changes the toolbar to the edit mode on.
The binding is done with
To refresh I simply need to run grind.refresh() but I'm not able to get the edit mode to run.
I have been playing around with KendoUI in the past week. I like the ease of use. I have to admit that I am one of those that first needed Javascript and then started to lern it. Or you I say starts to.
I wanted for a mokeup create a grid with a button in the toolbar that toggels edit mode on and off.
var
grid = $(
"#grid"
).kendoGrid({
dataSource: {
data: createRandomData(50),
schema: {
model: {
fields: {
FirstName: { type:
"string"
, validation: {required:
true
} },
LastName: { type:
"string"
, validation: {required:
true
} },
City: { type:
"string"
, validation:{required:
true
} },
Title: { type:
"string"
},
BirthDate: { type:
"date"
},
Age: { type:
"number"
, validation: {min:18, required:
true
} }
}
}
},
pageSize: 15
},
height: 500,
scrollable:
true
,
sortable: {
mode:
"multiple"
},
toolbar: ansichtNichtEditierbar,
filterable:
true
,
pageable:
true
,
columns: [... ],
groupable:
true
,
editable:
false
,
}).data(
"kendoGrid"
);
Thus I defined the validations in the model and set editable to false. As you can see the toolbar is stored in anohter object.
var
ansichtNichtEditierbar = [
{
text:
"Editieren"
,
className:
"k-grid-customEditieren"
,
imageClass:
"k-add"
},
{
text:
"Ansicht Speichern"
,
className:
"k-grid-customAnsichtSpeichern"
,
imageClass:
"k-add"
}
];
The idea being that I would bind a on click event to the button that will set editable to true and changes the toolbar to the edit mode on.
The binding is done with
$(
".k-grid-customEditieren"
).on(
'click'
,
function
(){
});