Add event listeners to buttons within a ListView - WinJS

acdblekjiid

New Member
I have a list of items within a ListView which contain buttons. I can't find a way to add event listeners to the buttons...This is the code:JS:\[code\]downloadsListView = document.getElementById('downloads').winControldownloadsListView.itemDataSource = JobList.dataSourcedownloadsListView.onloadingstatechanged = function() { var _this = this; return WinJS.Utilities.query("button.play_pause_button", document.getElementById('downloads')).forEach(function(element) { console.log(element); return element.onclick = _this._play_pause_download; }); };\[/code\]I can assure that the function does loop over the buttons via the console output. But clicking on the buttons fires nothing.I hope someone can help. Thanks :)
 
Back
Top