angular-bootstrap-multiselect icon indicating copy to clipboard operation
angular-bootstrap-multiselect copied to clipboard

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

Open vinodagouda opened this issue 8 years ago • 6 comments

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

vinodagouda avatar Jul 17 '17 11:07 vinodagouda

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'}"

aboudard avatar Aug 10 '17 09:08 aboudard

If there is a better solution to this please share.

Talhah avatar Sep 11 '17 13:09 Talhah

@Talhah what do you mean by "better" ?

aboudard avatar Sep 11 '17 16:09 aboudard

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

Talhah avatar Sep 11 '17 16:09 Talhah

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

Talhah avatar Sep 12 '17 08:09 Talhah

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

PallaviKharade avatar Jan 10 '18 12:01 PallaviKharade