javascript - Flyout hide himself on list view iteminvoked event -
if invoke flyout
show function on iteminvoked
event. flyout automatically hide himself in fraction of second.
here code
<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(); });
thanks bringing up. looked you. seems listview programmatically stealing focus on pointer (or other event), causes light dismissal of flyout. bug, , i've re-opened similar issue on our github tracking.
in meantime, here's simple workaround:
listview.wincontrol.addeventlistener('iteminvoked', function (e) { settimeout(function () { flyout.wincontrol.show(e.target) }, 0); });
let me know if solves problem!
Comments
Post a Comment