Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend option "selectedList" to use as much as fitting in one row #501

Closed
SimonSimCity opened this issue Sep 24, 2013 · 1 comment
Closed

Comments

@SimonSimCity
Copy link

Please extend the option "selectedList" to use exact as many, as fitting in that place without line-breaks.

Here's a first try to have something working ...

$("select[multiple=multiple]:visible").multiselect({
    selectedText: function(numChecked, numTotal, checkedEl) {
        var value = $(checkedEl).map(function(){ return $(this).next().html(); }).get().join(', ');
        var labelHeight = this.buttonlabel.height();
        var valueWidth = this.buttonlabel.html(value);

        if(labelHeight == this.buttonlabel.height()) {
            return $(checkedEl).map(function(){ return $(this).next().html(); }).get().join(', ');
        } else {
            return this.__proto__.options.selectedText.replace('#', numChecked).replace('#', numTotal);
        }
    },
    minWidth: 0
}).multiselectfilter();
@mlh758
Copy link
Collaborator

mlh758 commented Jan 30, 2018

You can already pass a function in for this option to have this behavior if you want it. I'm not going to include it as part of the widget though by default.

@mlh758 mlh758 closed this as completed Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants