Hi there,
I am at the moment implementing a dirty check using kendo MVVM calculated field, here is the code snippet
function viewModelSource(data) {
if (this instanceof viewModelSource) {
this.Title = data.title;
// dirty flag
this.IsDirty = false;
this.resetDirty = function () {
this.set("IsDirty", false);
}
this.CheckDirty = function () {
this.get("Title");
this.set("IsDirty", true);
}
}
}
var viewModel = kendo.observable(new viewModelSource(data));
kendo.bind($container, viewModel);
<div>
<input type="text" data-bind="value: Title" />
</div>
The problem is when the input value changes, I expect the dirty flag to be set to true, but it never was.
any help would be appreciated.
Thanks
James
I am at the moment implementing a dirty check using kendo MVVM calculated field, here is the code snippet
function viewModelSource(data) {
if (this instanceof viewModelSource) {
this.Title = data.title;
// dirty flag
this.IsDirty = false;
this.resetDirty = function () {
this.set("IsDirty", false);
}
this.CheckDirty = function () {
this.get("Title");
this.set("IsDirty", true);
}
}
}
var viewModel = kendo.observable(new viewModelSource(data));
kendo.bind($container, viewModel);
<div>
<input type="text" data-bind="value: Title" />
</div>
The problem is when the input value changes, I expect the dirty flag to be set to true, but it never was.
any help would be appreciated.
Thanks
James