2013-03-20 51 views

回答

0

ListView支持您拥有的每个列的标题,除非按列指您在ListView中的每个组中的每列。这里是你如何定义页眉模板:

<div class="headertemplate" data-win-control="WinJS.Binding.Template"> 
    <button class="group-header win-type-x-large win-type-interactive" data-win-bind="groupKey: key" 
     onclick="Application.navigator.pageControl.navigateToGroup(event.srcElement.groupKey)" role="link" tabindex="-1" type="button"> 
     <span class="group-title win-type-ellipsis" data-win-bind="textContent: title"></span> 
     <span class="group-chevron"></span> 
    </button> 
</div> 

以下是如何填充它页上的准备:

listView.groupHeaderTemplate = element.querySelector(".headertemplate");