isteven / angular-multi-select

A multi select dropdown directive for AngularJS. Allows you to use HTML tags and CSS in the data. Requires only AngularJS and nothing else.
isteven.github.io/angular-multi-select
MIT License
1.08k stars 518 forks source link

group-property does not work if input-model is generated via ajax #542

Closed kiranpvsr closed 6 years ago

kiranpvsr commented 6 years ago

Region 1 is not actually being rendered as a group but like just an other row.

image

HTML Code Snippet


<div class="location"
                     isteven-multi-select
                     input-model="locations"
                     output-model="selected_locations"
                     button-label="location"
                     item-label="locations"
                     tick-property="ticked"
                     on-open="get_locations()"
                     group-property="msGroup">
                </div>

Javascript Code Snippet

        result.$promise.then(function (data) {

            for (item in data['result']) {

                d_item = data['result'][item];
                try {

                    if(d_item['msGroup'] == 1) {
                        d_item['msGroup'] = true;
                    }
                    else {
                        d_item['msGroup'] = false;
                    }
                }
                catch (error) {
                    console.log('error', d_item)
                }

            }

            $scope.locations = data['result'];
        });
kiranpvsr commented 6 years ago

Ignore please.