I have a ListView with items. I am trying get clicked item from Listview using "iteminvoked".
<div id="listView_Id" data-win-control="WinJS.UI.ListView"
data-win-options="{
itemTemplate: select('#smallListIconTextTemplate'),
selectionMode: 'single',
tapBehavior: 'none',
layout: { type: WinJS.UI.GridLayout }
}">
</div>
Here ListArray is array of values with filenames picked using 'FilePicker'
dataList = new WinJS.Binding.List(listArray);
var listControlDiv = document.getElementById("listView_Id");
var listControl = listControlDiv.winControl;
listControl.itemDataSource = dataList.dataSource;
I set ListView dataSource from JS file rather than HTML file by fallowing this question.
I created handler like this.
document.getElementById("listView_Id").addEventListener("iteminvoked", doClickItem, false);
But unfortunately, My doClickItem
handler doesn't call at any way. While in same manner select item from Listview which is working Fine.
I guess I set Listview datasource using Javascript(The items source will be Change repeatedly). What is the wrong I did here.
Here is my complete project to try Thanks
Try this..
var listControl = document.getElementById("listView_Id").winControl;
listControl.addEventListener("iteminvoked", doClickItem, false);