Hello my friends.
I got a little stuck in here, and I need your advice.
I use web component to retreive a list from firebase, and update a listview.
I need when a user pick an item to be deleted (even if created by other user).
Remember, once you have removed the item from firebase, to remove the same item from your "volts" list.
Relative to the ListView, if you want to show in list view only some items from the original list, you can create a second list only with those items to show. For example, if I don't want to show the last one I can create a new list without the last element of each item:
Thank you Ramon,
I read that article, very good indeed but there is no solution for my situation.
I have the firebase like this:
with my code if I put my UID (where question mark is) will delete all x_orders, but I need only to delete the UID that I selected from list including volt,amp,date and active.
I need somehow to compare the UID that clicked in list and to complete the delete action. because any user can delete any UID and all it's data
or to make a separate list of UID and compare the one selected in listpick and with a confirmation dialog to insert it in "delete function"????
In your case you want to replace myData1 with your UID value.
As @Ramon has suggested use a partial list to display your listview, and the selectionIndex of that listview to select the UID value from your original list.
but Tima, If I put my UID will not delete other UID, right?
Thank you I will still trying!
Well, If I make a list with UID's and a list with all data (volt, amp,date), when listPicker populate with volt, amp,date how can I extract the coresponding UID?
Well. We have several things here and I guess you're mixing all of them:
Show the info into the listView without the UID. For this you need to make an aux list without that item and then display it in ListView.
When an item is selected from ListView be able to get its UID. This you can do it with the examples I showed you.
Remove the UID (and its data) from firebase. With the UID get in the step 2, do what @TIMAI2 has indicated.
Remove the same item from the list you are using in ListView (and from the original list), and refresh ListView so that the listView shows the list without the recently deleted element.