I would love to have this in core as well with nice animations. List Handling is on of the main uses in mobile apps.
Code above almost did it. I use this to handle UI and data:
<ons-page>
<ons-toolbar>
<div class="center">Lists</div>
</ons-toolbar>
<ons-list id="mylist">
</ons-list>
</ons-page>
ons.ready(function() {
for (var i = 0; i < 11; i++) {
var item = $(
"<ons-list-item data-id='" +
i +
"' tappable>Test " +
i +
"</ons-list-item>"
);
item[0].addEventListener("swipeleft", function(e) {
var data = $(this).data("id");
alert(data);
$(this).remove();
});
$("#mylist").append(item);
}
});
Sure if you prefere VanillaJS. Replace the jQuery with the corresponding alternatives… Cheers.