Hello,
we recently upgraded from Kendoui 2022 to the latest version and our MVVM forms stoped working.
So either there are changes to the datasource or MVVM or both.
Any ideas how to fix it?
The input elements look like this:<input data-bind="value: emailTextSource.data()[0].siteGroup" name="siteGroup" id="siteGroup" value="" class=" form-control" />
Here is the datasource and the binding:
<script>
var crudServiceBaseUrl = 'emailTexts';
var myData = new kendo.data.DataSource({
transport: {
read: {
url: crudServiceBaseUrl + "/getdetails?id=1",
dataType: "json"
},
update: {
url: crudServiceBaseUrl + "/updatedetails",
dataType: "json",
type: 'get'
},
destroy: {
url: crudServiceBaseUrl + "/destroydetails",
dataType: "json"
},
},
schema: {
model: {
id: "id",
fields: {
}
}
}
});
var viewModel = kendo.observable({
emailTextSource: myData,
language: [{"language":1,"text":"Deutsch","logger":"","wirebox":"","languageId":1,"id":1,"validationResult":""},{"language":1,"text":"Englisch","logger":"","wirebox":"","languageId":2,"id":3,"validationResult":""}], delete: function(e) {
if (confirm('Sind Sie sicher?')) {
this.emailTextSource.remove(this.emailTextSource.data()[0]);
this.emailTextSource.sync();
} else {
// Do nothing!
}
}
, save: function(e) {
if (confirm('Speichern?')) {
myData.sync();
} else {
// Do nothing!
}
}
});
kendo.bind($("#emailTextDiv"), viewModel);
myData.read();
</script>