ListView data-selectable examples

Get help with using Metro 4 components
Post Reply
Fabrizio
Posts: 8
Joined: Mon Apr 15, 2019 10:54 am
Status: Offline

ListView data-selectable examples

Post by Fabrizio » Thu May 02, 2019 4:12 pm

Hi,
Could someone show me how to manage items using selectable options? How can i retrieve all the items selected using javascript?

For example: how can i DELETE ALL the selected items?
This routine delete only last selected item:

<button class="button" onclick="
var lv = $('#lv_1');
lv.data('listview').del(lv.find('.current'))
">Delete item</button>

But, if i want to delete multiple items?

User avatar
olton
Site Admin
Posts: 238
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Thu May 02, 2019 4:20 pm

Code: Select all

getSetected() - return all selected nodes

Fabrizio
Posts: 8
Joined: Mon Apr 15, 2019 10:54 am
Status: Offline

Post by Fabrizio » Thu May 02, 2019 4:30 pm

How can i use getSelected() on the following <button> tag?

<button class="button" onclick="
var lv = $('#lv_1');
lv.data('listview').del(????))
">Delete item</button>

User avatar
olton
Site Admin
Posts: 238
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Thu May 02, 2019 5:31 pm


Fabrizio
Posts: 8
Joined: Mon Apr 15, 2019 10:54 am
Status: Offline

Post by Fabrizio » Thu May 02, 2019 5:44 pm

It works! Thank you! You are very kind

Post Reply