Hello,
I created a small SPA using Kendo web and the MVVM pattern, but i'm having problems getting validation to work.
So i have a view which binds to a viewmodel using kendo.bind(view, viewmodel).
and example of a domain object (client side) would be like this:
and my viewmodel:
I'm using data-bind in my view to bind to my viewmodel.
Is it possible to apply a Kendo validator to my view using the rules from my Model ?
Thanks in advance.
I created a small SPA using Kendo web and the MVVM pattern, but i'm having problems getting validation to work.
So i have a view which binds to a viewmodel using kendo.bind(view, viewmodel).
and example of a domain object (client side) would be like this:
var
User = kendo.data.Model.define({
id:
"id"
,
fields: {
id: {
editable:
false
,
nullable:
true
},
username: {
type:
"string"
,
validation: {
required:
true
},
defaultValue:
""
},
password: {
type:
"string"
,
validation: {
required:
true
},
defaultValue:
""
}
}
});
and my viewmodel:
var vmLogin =
function
() {
var
_userName =
""
;
var
_password =
""
;
var
_user =
new
User();
var
_submitLogin =
function
() {
}
var
_init =
function
() {
}
return
{
Init: _init,
User: _user,
Submit: _submitLogin
}
}
I'm using data-bind in my view to bind to my viewmodel.
Is it possible to apply a Kendo validator to my view using the rules from my Model ?
Thanks in advance.