Hello, I've got a listview whose template includes a button that causes removal of the clicked item from the listview. I also followed another forum post explaining how to suppress the mouseclick event so that my button click event doesn't select the clicked item.
However, when the remove happens in my click handler via the listview.remove(item) method, it looks like the listview syncs to the datasource. The problem is that when this occurs the listview appears to lose it's selection. I'm guessing this is by design, but is there a way in which I can store the selected index before the remove and then reselect the item afterwards? The main task is getting the selected index in my click handler. I see a way to get the selected item using listView().select() but not the index. After the rebind, if I try to pass this selected item into the select function it no longer finds it, so I guess it goes out of scope after the rebind.
Do you have any guidance for me?
Thanks,
Eric
However, when the remove happens in my click handler via the listview.remove(item) method, it looks like the listview syncs to the datasource. The problem is that when this occurs the listview appears to lose it's selection. I'm guessing this is by design, but is there a way in which I can store the selected index before the remove and then reselect the item afterwards? The main task is getting the selected index in my click handler. I see a way to get the selected item using listView().select() but not the index. After the rebind, if I try to pass this selected item into the select function it no longer finds it, so I guess it goes out of scope after the rebind.
Do you have any guidance for me?
Thanks,
Eric