Hi there. I have a problem here... Suppose the following scenario:
I have this model:
var vm = kendo.observable({
values: ["orange", "apple", "etc"],
remove: function(e) { console.log("this is working"); }
});
and then something like this in my markup:
<div data-template="diosTeAyude" data-bind="source: values"></div>
<script id="diosTeAyude" type="text/x-kendo-template">
<div class="input-group">
<input data-bind="value: this">
<span class="input-group-addon" data-bind="click: remove">-</span>
</div>
</script>
"remove" method is not accessible, cause I'm using primitive types in my array, nothing outside the actual primitive value is there. If I change my model to:
var vm = kendo.observable({
values: [{theValue: "orange"}, {theValue: "apple"}, {theValue: "etc"}],
remove: function(e) { console.log("this is working"); }
});
and my template to:
<script id="diosTeAyude" type="text/x-kendo-template">
<div class="input-group">
<input data-bind="value: theValue">
<span class="input-group-addon" data-bind="click: remove">-</span>
</div>
</script>
then the viewModel prototypes fine and remove function is there, even when convert my array of strings to objects is unnecessary from the model point of view.
Is there any other way to accomplish what I need without having to do that?
Thanks in advance!