Languages

Menu
Sites
Language
SnapListView: Remove/Rearange?

Hi,

What is the recommended way to remove, select or rearange (move up or down) an element inside a SnapListView? Are there maybe even some animations available?

Thx!

Responses

1 Replies
Heeju Joo

Hello,

 

There's no API for remove, select or rearange inside SnapListView component.

But you can remove list item dynamically by javascript with following example. Thank you :)

<div class="ui-content">
    <ul class="ui-listview">
		<li><a href="#">List1</a></li>
		<li id="remove"><a href="#">List2</a></li>
		<li><a href="#">List3</a></li>		
	</ul>
</div>
/* we consider that SnapListview already create*/
var list = document.querySelector(".ui-listview"),
    remove = document.getElementById("remove"),
    snapList = tau.widget.SnapListview(list);
    
setTimeout(function() {
    list.removeChild(remove);
    snapList.refresh();
}, 3000);