2013-03-20 49 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");