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

options label #437

Closed
ragsnas opened this issue Nov 26, 2014 · 1 comment
Closed

options label #437

ragsnas opened this issue Nov 26, 2014 · 1 comment
Labels

Comments

@ragsnas
Copy link

ragsnas commented Nov 26, 2014

Hi,

i always get the following error for my multiselects.

Uncaught TypeError: string is not a function
Multiselect.createOptionValue

On line 576/577 it says:

// Support the label attribute on options.
var label = this.options.label(element);

but this.options.label is a string (the label of the multiselect form element).

Shouldn't it be

var label = element.label;

Here's one of my multi select elements. Is there something wrong with them?

<select id="feature_CATEGORY_4_MULTISELECT_4_0" 
    name="feature[CATEGORY_4][MULTISELECT_4_0][]" 
    data-visibility="ALL" 
    data-feature-id="HERD" 
    class="multi-select form-control valid" 
    data-select-all="true" 
    data-label="Herd" 
    multiple="multiple" 
    aria-invalid="false">
        <option value="HERD">Herd</option>
        <option value="2HERD">2-Platten-Herd</option>
        <option value="GASHERD">Gasherd</option>
        [...]
</select>
Tyf0x added a commit to Tyf0x/bootstrap-multiselect that referenced this issue Nov 27, 2014
-> Fixed a bug when the data-label attribute is used on the original select. It was conflicting with the custom function called "label(element)" and overriding it.
Renamed label() to getLabel()
@davidstutz
Copy link
Owner

Well, originally, the label option is intended to be a function. So the line should be correct. I will, however, have a look at the solution given by @Tyf0x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants