Listview filtering with swipe actions (stages)


#1

Hello all,

I’m trying to combine the mobiscroll listview with filtering ( I used the demo as a starting point) with swipe actions.

Here’s the initialization code:

this.listview = $('.md-schedule-list').mobiscroll().listview({
    enhance: true,
    swipe: false,
    striped: true,
    onInit: function (ev, inst) {
        setTimeout(function () {
            that.filter();
        });
    },
    stages: [{
        percent: -25,
        color: 'red',
        text: 'Delete',
        confirm: true,
        action: function (event, inst) {
             console.log(event);
        }
    }, {
        percent: 25,
        color: 'green',
        text: 'Update',
        confirm: true,
        action: function (event, inst) {
            console.log(event);
        }
    }]
}).mobiscroll('getInst');

Thanks


#2

Hi Michael, thanks for the question!

The problem is that you have the swipe: false setting within the listview options (copied from the original demo), which disables the swipe gesture on the listview items. Remove that option, and the stage actions will work as intended.

Let me know if this helps!

Best,
Isti