Is it possible to use any sort of parameters in the HTML bindings with the MVVM framework? For instance ...
Assume I have a ViewModel that has two properties; Id and Points, and a function that accepts Id as a paramter.
var viewModel = kendo.observable({
Id: "users/1",
Points: 10,
ReducePoints: function(id) {
console.log(id);
}
});
kendo.bind(document.body, viewModel);
and I want to use one of these variables in a click data-binding.
<div data-bind="text: Id"></div >
<div data-bind="text: Points"></div >
<div data-bind="click: ReducePoints(this.Id)">Click Here</div>
Is there any possible way to do that? To use the view model's properties - or to pass parameters through the bindings?
Assume I have a ViewModel that has two properties; Id and Points, and a function that accepts Id as a paramter.
var viewModel = kendo.observable({
Id: "users/1",
Points: 10,
ReducePoints: function(id) {
console.log(id);
}
});
kendo.bind(document.body, viewModel);
and I want to use one of these variables in a click data-binding.
<div data-bind="text: Id"></div >
<div data-bind="text: Points"></div >
<div data-bind="click: ReducePoints(this.Id)">Click Here</div>
Is there any possible way to do that? To use the view model's properties - or to pass parameters through the bindings?