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

How to change Select drop down name to some custom text? #48

Open
vinodagouda opened this issue Jul 17, 2017 · 6 comments
Open

How to change Select drop down name to some custom text? #48

vinodagouda opened this issue Jul 17, 2017 · 6 comments

Comments

@vinodagouda
Copy link

vinodagouda commented Jul 17, 2017

I would like to change the Select drop down name to some other custom name. For example, I would like to change it to Campaign Select. How to do it?
Thanks in advance. I am adding a screen shot below for your reference.

screenshot from 2017-07-17 11 34 01

@aboudard
Copy link
Contributor

For those who didn't find this at first look, just watch the binding options in the directive, you have :
labels: '=?',

and in the html :
{{getButtonText()}}

which leads to the method and the following option :
$scope.getButtonText = function () { ... $scope.labels && $scope.labels.select ? $scope.labels.select : ($scope.placeholder || 'Select'); ...

so just add the labels option, in the html or in the js :
labels="{selectAll:'Tous',unselectAll:'Aucun',select:'Thème'}"

@Talhah
Copy link

Talhah commented Sep 11, 2017

If there is a better solution to this please share.

@aboudard
Copy link
Contributor

@Talhah what do you mean by "better" ?

@Talhah
Copy link

Talhah commented Sep 11, 2017

@aboudard Sorry, this method is the best. I did not understand the solution.

@Talhah
Copy link

Talhah commented Sep 12, 2017

For those who are confused as to where the labels object should be placed please see below example:

<multiselect ng-model="$ctrl.yourModel" options="yourOptions" labels="{select:'Custom Label'}" display-prop="yourProperty"></multiselect>

Nice and simple fix via @aboudard

@PallaviKharade
Copy link

In bootstrap-multiselect.js file dropdown name is set using nonSelectedText: 'None selected' .You can change none selected to name which you want to set

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

4 participants