I have a list with a swipeContent which contains a button with id="actionButton". What I want is to permanently remove the swipeContent of the SPECIFIC ListItem whose actionButton is clicked(and NOT from all the items). How can I achieve this?
Code:
new sap.m.List("list", {
backgroundDesign : "Transparent",
mode : sap.ui.Device.system.phone ? sap.m.ListMode.None
: sap.m.ListMode.SingleSelectMaster,
itemPress : [ oController.handleListSelect, oController ],
swipeContent : new sap.m.Button({
id: "actionButton",
text : "Actions",
type : "Accept",
press : [ oController.onPress, oController ]
})
})
onPress: function(e){
var list = this.getView().byId("list");
var swipedItem = list.getSwipedItem();
//Below code destroys swipeContent from ALL THE ITEMS in the list which I don't want
list.destroySwipeContent();
//And this doesnot work
swipedItem.destroySwipeContent();
}