0
如果我調用flyout
show function iteminvoked
event。彈出窗口自動隱藏自己的秒數。Flyout將自己隱藏在列表視圖iteminvoked事件
這裏是我的代碼
<div id="listView"
class="win-selectionstylefilled"
data-win-control="WinJS.UI.ListView"
data-win-options="{
itemDataSource: Teoco.ListView.data.dataSource,
itemTemplate: select('.settingsTemplate'),
selectionMode: 'single',
tapBehavior: 'directSelect',
oniteminvoked : name.ListView.selectionChanged,
layout: { type: WinJS.UI.ListLayout }
}">
</div>
<div id="contactFlyout" data-win-control="WinJS.UI.Flyout">
</div>
Settings.SettingsModules = (new function(){
function selectionEventHandler(evt){
var settingsList = evt.target;
evt.detail.itemPromise.then(function (invokedItem) {
var flyout = document.getElementById("contactFlyout")
flyout.winControl.show(settingsList);
});
}
this.init = function(modules){
var selectionChangeHandler = WinJS.UI.eventHandler(selectionEventHandler);
WinJS.Namespace.define("name.ListView", {
data: new WinJS.Binding.List(modules),
selectionChanged:selectionChangeHandler
});
};
});
$(document).ready(function(){
Settings.SettingsModules.init([{title : "Application"},{title : "Agent"}]);
WinJS.UI.processAll();
});