Unplanned
Last Updated: 02 Sep 2021 11:08 by ADMIN
Luc
Created on: 20 Apr 2012 20:54
Category: Data Source
Type: Feature Request
12
Provide a syntax to "navigate" MVVM models
In the context of MVVM bindings, it would be great to have a way to evaluate certain conditions/expressions, especially within template bindings, by "navigating" to other properties of the ViewModel, or to other properties of the currently iterated object.

For example:

<ul data-role="listview" data-bind="source: anObservableObject" data-template="some-template"></ul>
<script id="some-template" type="text/x-kendo-template">
    <li data-bind="text: whatever, visible: $source.someProperty == $data.otherProperty"></li>
</script>

In this example, $data refers to the current iteration data, and $source refers to the source. So the visible binding would be true/false according to the expression which would evaluate an arbitrary property on the source and an arbitrary property on the iterated object.

This is similar to Knockout's mechanism and it allows for greater flexibility within templates.

0 comments