mysociety / jquery-multi-select

Converts <select multiple> elements into dropdown menus with checkboxes
https://www.mysociety.org/
Other
24 stars 18 forks source link

There is no Select All / Deselect All functionality #13

Open sharadsoni opened 6 years ago

sharadsoni commented 6 years ago

Is there any select all /deselect all functionality? If yes please tell me how we can use it.

ar000n commented 5 years ago

Pull request is here: #14

dracos commented 5 years ago

I'll look at the PR, thanks; just to note you can simulate select/deselect all without any code changes, see e.g. https://jsfiddle.net/210ygskq/ with code something like:

$(function(){
    $('#categories').multiSelect({
        noneText: 'None',
        allText: 'All categories',
        presets: [ {
            name: 'None',
            options: []
        }, {
            name: 'All categories',
            options: ['a', 'b', 'c', 'd']
        }, {
            name: 'My categories',
            options: ['a', 'c']
        } ]
    });
});