I am using JsViews to render a list, but first passing the list through a helper function like so:
<ul>
{^{for ~filter(list, 'xyz')}}
<li>...</li>
{{/for}}
</ul>
Where filter
creates a new list based on list
with only some of the original elements based on the filtering criteria. The trouble is, when I update list
:
$.observable(data.list).insert(list.length, { ... });
the {^{for ...}}
does not get re-evaluated. However, if I remove the filter, changing the {^{for ...}
to this:
{^{for list}}
...
{{/for}}
Then everything works as expected. Is there a way to achieve what I'm after? It seems JsViews should be able to do what I want, because this answer is similar enough: JsViews: Converter before helper function in data-link.