Kendo MVVM
HTML
<script src="http://cdn.kendostatic.com/2013.3.1324/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2013.3.1324/styles/kendo.mobile.all.min.css">
<div data-role="view" id="testForm">
<h3 data-bind="text: label; visible: 0">XX</h3>
<h3 data-bind="text: isLoggedInVM1()">yyy</h3>
<h3 data-bind="visible: xx">
zzz
</h3>
</div>
JavaScript
var app = new kendo.mobile.Application();
var userStateviewModel = kendo.observable({
isLoggedIn: false,
});
var viewModel1 = kendo.observable({
label: 'From ViewModel1',
xx: 0,
yy: 'ABC',
isLoggedInVM1: function() {
return userStateviewModel.get("isLoggedIn");
}
});
userStateviewModel.set('isLoggedIn', true);
//viewModel1.set('isLoggedInVM1', userStateviewModel.isLoggedIn);
alert(viewModel1.isLoggedInVM1());
kendo.bind($("#testForm"), viewModel1);