zurb-foundation6-multiselect icon indicating copy to clipboard operation
zurb-foundation6-multiselect copied to clipboard

need to connect event listeners

Open rteinze opened this issue 5 years ago • 2 comments

At the moment you can't use event listeners and values. It would be nice to have one of the following:

1.) every check/uncheck changes the original SELECT-element value and triggers 'change' and 'input' events at this one

OR

2.) provide your own event functions, e. g. 'onafterwritinglive' or similar, with checked values as arguments

it's a nice work, thanks a lot

rteinze avatar Jan 20 '20 22:01 rteinze

Using testing branch, you can try to initialize multiselect in this way:

    $("#menu").zmultiselect({

        filter: true,
        filterResult: true,
        selectAll: true,
        get: "zmultiselect",
        placeholder: "I'm a MultiSelect",
        live: '#menu_live',

        onLoad: function(id){
            console.log("id " + id);
        },

        onChange: function(id, live){
            console.log('change trigger', id, live);
        },

    });

I need to test it out a little more.

icyz avatar Mar 08 '20 10:03 icyz

@rteinze Between version 5 and 6, I found I needed to use the updateNativeSelect: true option. Documentation doesn't make reference to it, so I did some source diving to find it.

Also, the change event seems to get triggered on the element with the .zselect class and not on the original select element as it did in version 5.

akaspick avatar Dec 16 '20 13:12 akaspick