Note that there are some explanatory texts on larger screens.

plurals
  1. POdata-win-bind issues: converter only runs once and unable to bind id of element
    primarykey
    data
    text
    <p>I have the following html that is bound to an object containing id and status. I want to translate status values into a specific color (hence the converter function convertStatus). I can see the converter work on the first binding, but if I change status in the binding list I do not see any UI update nor do I see convertStatus being subsequently called. My other issue is trying to bind the id property of the first span does not seem to work as expected (perhaps it is not possible to set this value via binding...)</p> <p>HTML:</p> <pre><code>&lt;span data-win-bind="id: id"&gt;person&lt;/span&gt; &lt;span data-win-bind="textContent: status converter.convertStatus"&gt;&lt;/span&gt; </code></pre> <p>Javascript (I have tried using to modify the status value):</p> <blockquote> <p>// persons === WinJS.Binding.List<br/> // updateStatus is a function that is called as a result of status changing in the system</p> </blockquote> <pre><code>function updateStatus(data) { persons.forEach(function(value, index, array) { if(value.id === data.id) { value.status = data.status; persons.notifyMutated(index); } }, this); } </code></pre> <p>I have seen notifyMutated(index) work for values that are not using a converter.</p> <p><strong>Updating with github project</strong></p> <p><a href="https://github.com/ShelbyZ/winjs-data-binding" rel="nofollow">Public repo for sample (not-working)</a> - this is a really basic app that has a listview with a set of default data and a function that is executed when the item is clicked. The function attempts to randomize one of the bound fields of the item and call notifyMutated(...) on the list to trigger a visual updated. Even with defining the WinJS.Binding.List({ binding: true }); I do not see updates unless I force it via notifyReload(), which produces a reload-flicker on the listview element.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload