Seems simple enough, but after looking though the threads I can't find an answer. So, everyone knows you can bind a view model to an element and you can get the validator from an element or most any other kendo object. But, how do you get the view model bound to the element? In case the example is unclear, I'm trying to retrieve the viewModel in the getViewModel function w/o using some kind of global variable.
function setViewModel() {
var viewModel = kendo.observable({name:'John Doe'});
kendo.bind($("form"), viewModel);
}
function getViewModel() {
var viewModel = $('#form').kendo(???);
}
<div id="form">
//usual binding stuff
</div>
Thanks,
nick
function setViewModel() {
var viewModel = kendo.observable({name:'John Doe'});
kendo.bind($("form"), viewModel);
}
function getViewModel() {
var viewModel = $('#form').kendo(???);
}
<div id="form">
//usual binding stuff
</div>
Thanks,
nick