Mohaideen
Mohaideen

Reputation: 209

groupby is not working in ng-multiselect-dropdown in angularjs

Groupby is not working in ng-multiselect-dropdown module.

$scope.selectByGroupSettings = {
    selectByGroups: ['F', 'M'],
    groupByTextProvider: function(groupValue) {
        switch (groupValue) {
            case 'M':
                return 'Male';
            case 'F':
                return 'Female';
            case 'O':
                return 'Other';
        }
    },
    groupBy: 'gender',
};

DEMO : https://jsfiddle.net/MohaideenIsmail/22et6sao/1381/

Upvotes: 0

Views: 1905

Answers (2)

You need put group-by="true" in the ng-dropdown-multiselect tag.

Something Like that:

<div ng-dropdown-multiselect 
     options="selectByGroupData"
     group-by="true" 
     selected-model="selectByGroupModel"
     groupby="gender" 
     extra-settings="selectByGroupSettings">
</div>

Upvotes: 0

Babin
Babin

Reputation: 31

I updated your jsfiddle to work

<div ng-app="myApp" ng-controller="AppCtrl">

check

https://jsfiddle.net/29qpL78d/

rename groupBy to groupby [see the case here] also groupby won't work with seeting, it was read from attribute.

Upvotes: 2

Related Questions