Home > Software engineering >  How can i auto open a ng-dropdown-multiselect in Angularjs?
How can i auto open a ng-dropdown-multiselect in Angularjs?

Time:07-05

I have the following definition for a ng-dropdown-multiselect:

               <div id="selectedColumns"
                         ng-dropdown-multiselect="false"
                         extra-settings="ddextraSettings"
                         translation-texts="ddCustomTexts"
                         options="ddOptions"
                         selected-model="ddSelectedModel"
                         checkboxes="true"></div>
                </div>

Currently after binding to the drop down via a serie call, I want to drop dow the selection. I have tried

             $scope.selectedColumns.open();

but it gives an error that open is not a function

How can i do this ?

CodePudding user response:

If without changing the library, and provided without use of JQuery, then this should do it (using Javascript)

setTimeout(function(){document.querySelectorAll("#selectedColumns button")[0].click();});
  • Related