I want user to select an item from listview and then from the appbar click on the delete button to remove the selected item....
I have done this kind of thing many times before but on a simple listview that is which doesnt have any groups, but that method of deleting an item from listView is not applicable here as it is a group listview because it sorts the objects in some order and hence mixing all the indices (index).
This is the method I have used to delete an element from simple (un-grouped) listview:
var deleteIndex=0;
var listView=document.getElementById('listview').winControl;
listView.addEventListener('selectionchanged', function () {
deleteIndex=listView.selection.getIndices();
});
function deleteButtonOnClick(){
data.splice(deleteIndex,1);
}
This is not working on group listview, it deletes some other item in listView... I am really stuck at this point, i have to complete my app by tomorrow.
I can't give you a code sample since I'm lacking your data model, but the general concept is