i have a kendo multiselect which is using a tagTemplate so that when you select options it displays x of y selected
. My problem is, when an item is added to the datasource i need to update parameter y
but i don't know how to refresh the template. Here's my html template and my js code:
HTML Template:
<script id="SelectedViewsTagTemplate" type="text/x-kendo-template">
#:values.length# #='@Html.Raw(rm.GetString("STR_OF"))# #:total-1#
</script>
Javascript for tagtemplate:
tagTemplate: function (dataItem) {
dataItem.total = _getTotal.call(this);
dataItem.total += dataItem.AddMode ? 1 : 0;
return kendo.template($("#SelectedViewsTagTemplate").html())(dataItem);
}
I've tried triggering the "change" event to get it to update but it doesn't seem to work, aside from recreating the multiselect i don't know how to refresh the template