Both sap.m.List and sap.m.Table offer the same events, inheriting them from sap.m.ListBase
The events are:
All are handled in the same way, in that an event is fired, and the event object that is passed contains listItem data that tells you which items were affected. As with the list, the table has SwipeContent aggregation, and you can set the swipe direction:
<Table swipeDirection="RightToLeft"> <swipeContent> <Button text="press me for action" press="handleAction"/> </swipeContent> <columns> ... handleAction: function(e) { oTable = this.getView().byId("myTable"); jQuery.sap.log.info("Swiped item:", oTable.getSwipedItem()); oTable.swipeOut(); }
The SwipeContent is a control that appears on the right hand side of a list item when a swipe gesture is made on the item. We can define handlers for different events that can be triggered:
<Table delete="deleteHandler" swipe="swipeHandler" selectionChange="selectionChangeHandler" ...
To test swipe gestures on the desktop, open the Chrome developer tools, and within Settings → Overrides, check the "Emulate touch events" checkbox and reload the page.