Data Bind failing for custom HtmlControl inside ItemTemplate ListView

I have an ItemTemplate that is installed in a ListView:

<div class="commentTileTemplate" data-win-control="WinJS.Binding.Template">
    <div class="commentTileControl" data-win-control="WinJS.UI.HtmlControl" data-win-options="{uri: '/htmlControls/commentTile/commentTile.html'}"></div>
</div>

Binding data that is inside the HtmlControl fails to bind when the ListView is displayed for the first time, it works great with subsequent launches.

If I remove the template from the ListView, then the source data will appear as expected, only after adding the HtmlControl it will not be the first.

Any idea what could be wrong?

+1
source share
1 answer

, XHR (WinJS.xhr) . , WinJS.Binding.process() WinJS.Binding.Template.render, . (, data-win-bind.

, , , , DOM , WinJS.Binding.Template.render WinJS.Binding.processAll data-win-bind.

:

  • WinJS.UI.Fragments.cache(), , ,
  • HtmlControl, , HtmlControl WinJS.Binding.process[All]() [1]
  • , , . , , , . : Load Fragment, querySelector , data-win-control on, WinJS.UI.process(), itemTemplate

[1] HtmlControl , , .

+2

All Articles