Dynamically set the settings options for the ng-dropdown-multiselect











up vote
0
down vote

favorite












How can I dynamically set the settings options for the ng-dropdown-multiselect, like setting the data, is this posible?



Check it out here:
http://plnkr.co/edit/ntVBcGRsD0HXgQoshBlp?p=preview



view



  <div ng-dropdown-multiselect="" 
options="example65data"
selected-model="example65model"
extra-settings="example65settings"></div>


controller



  $scope.example65model = [{id: 1}]; 
$scope.example65data = [{id: 1, label: "David"}, {id: 2, label: "Jhon"}];
$scope.example65settings = {selectionLimit: 3};

$scope.updateMultiSelectLimit = function (){
$scope.example65settings = {selectionLimit: 2};
}
$scope.updateData = function(){
$scope.example65data = [{id: 1, label: "Peter"}, {id: 2, label: "Yiss"}, {id: 3, label: "Max"}];
}









share|improve this question


























    up vote
    0
    down vote

    favorite












    How can I dynamically set the settings options for the ng-dropdown-multiselect, like setting the data, is this posible?



    Check it out here:
    http://plnkr.co/edit/ntVBcGRsD0HXgQoshBlp?p=preview



    view



      <div ng-dropdown-multiselect="" 
    options="example65data"
    selected-model="example65model"
    extra-settings="example65settings"></div>


    controller



      $scope.example65model = [{id: 1}]; 
    $scope.example65data = [{id: 1, label: "David"}, {id: 2, label: "Jhon"}];
    $scope.example65settings = {selectionLimit: 3};

    $scope.updateMultiSelectLimit = function (){
    $scope.example65settings = {selectionLimit: 2};
    }
    $scope.updateData = function(){
    $scope.example65data = [{id: 1, label: "Peter"}, {id: 2, label: "Yiss"}, {id: 3, label: "Max"}];
    }









    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      How can I dynamically set the settings options for the ng-dropdown-multiselect, like setting the data, is this posible?



      Check it out here:
      http://plnkr.co/edit/ntVBcGRsD0HXgQoshBlp?p=preview



      view



        <div ng-dropdown-multiselect="" 
      options="example65data"
      selected-model="example65model"
      extra-settings="example65settings"></div>


      controller



        $scope.example65model = [{id: 1}]; 
      $scope.example65data = [{id: 1, label: "David"}, {id: 2, label: "Jhon"}];
      $scope.example65settings = {selectionLimit: 3};

      $scope.updateMultiSelectLimit = function (){
      $scope.example65settings = {selectionLimit: 2};
      }
      $scope.updateData = function(){
      $scope.example65data = [{id: 1, label: "Peter"}, {id: 2, label: "Yiss"}, {id: 3, label: "Max"}];
      }









      share|improve this question













      How can I dynamically set the settings options for the ng-dropdown-multiselect, like setting the data, is this posible?



      Check it out here:
      http://plnkr.co/edit/ntVBcGRsD0HXgQoshBlp?p=preview



      view



        <div ng-dropdown-multiselect="" 
      options="example65data"
      selected-model="example65model"
      extra-settings="example65settings"></div>


      controller



        $scope.example65model = [{id: 1}]; 
      $scope.example65data = [{id: 1, label: "David"}, {id: 2, label: "Jhon"}];
      $scope.example65settings = {selectionLimit: 3};

      $scope.updateMultiSelectLimit = function (){
      $scope.example65settings = {selectionLimit: 2};
      }
      $scope.updateData = function(){
      $scope.example65data = [{id: 1, label: "Peter"}, {id: 2, label: "Yiss"}, {id: 3, label: "Max"}];
      }






      angularjs angularjs-directive ng-dropdown-multiselect






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 24 '17 at 1:55









      user021205

      494




      494
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          //HTML
          <div ng-dropdown-multiselect="example65data" id="xyz"//Can Be Anything options="example65data" selected-model="example65model"></div>

          //JS
          $scope.example65model= ;
          function abc//Can Be Anything() {
          var allData = hrmsService.getdata//Service Function Call();
          allData.then(function (//Take any variable//pqr) {
          DataObj = ;
          for (var i in pqr.data) {
          item = {}
          item["id"] = pqr.data[i].Id//Primary Key;
          item["label"] = apiSkills.data[i].Description//Any Description Field;
          DataObj.push(item);
          }
          $scope.example65data= DataObj;
          }, function () {
          alert("Data Not Found");
          });
          }





          share|improve this answer






























            up vote
            0
            down vote













            Try this



              //HTML
            <div
            ng-dropdown-multiselect=""
            options="tabListdata"
            selected-model="tabListmodel"
            extra-settings="tabListsettings"
            events="{ onSelectionChanged: getAllPolicies }"
            >
            </div>

            //JS
            $scope.tabListmodel = ;
            $scope.tabListdata = [{
            id: 1,
            label: "Option 1"
            }, {
            id: 2,
            label: "Option 2"
            }, {
            id: 3,
            label: "Option 3"
            }, {
            id: 4,
            label: "Option 4"
            }, {
            id: 5,
            label: "Option 5"
            }, {
            id: 6,
            label: "Option 6"
            }];

            $scope.tabListsettings = {
            smartButtonMaxItems: 6,
            smartButtonTextConverter: function (itemText, originalItem) {
            return itemText;
            }
            };

            $scope.getAllPolicies = function () {
            console.log("$scope.tabListmodel", $scope.tabListmodel);
            }





            share|improve this answer





















              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














               

              draft saved


              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f42990100%2fdynamically-set-the-settings-options-for-the-ng-dropdown-multiselect%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              0
              down vote













              //HTML
              <div ng-dropdown-multiselect="example65data" id="xyz"//Can Be Anything options="example65data" selected-model="example65model"></div>

              //JS
              $scope.example65model= ;
              function abc//Can Be Anything() {
              var allData = hrmsService.getdata//Service Function Call();
              allData.then(function (//Take any variable//pqr) {
              DataObj = ;
              for (var i in pqr.data) {
              item = {}
              item["id"] = pqr.data[i].Id//Primary Key;
              item["label"] = apiSkills.data[i].Description//Any Description Field;
              DataObj.push(item);
              }
              $scope.example65data= DataObj;
              }, function () {
              alert("Data Not Found");
              });
              }





              share|improve this answer



























                up vote
                0
                down vote













                //HTML
                <div ng-dropdown-multiselect="example65data" id="xyz"//Can Be Anything options="example65data" selected-model="example65model"></div>

                //JS
                $scope.example65model= ;
                function abc//Can Be Anything() {
                var allData = hrmsService.getdata//Service Function Call();
                allData.then(function (//Take any variable//pqr) {
                DataObj = ;
                for (var i in pqr.data) {
                item = {}
                item["id"] = pqr.data[i].Id//Primary Key;
                item["label"] = apiSkills.data[i].Description//Any Description Field;
                DataObj.push(item);
                }
                $scope.example65data= DataObj;
                }, function () {
                alert("Data Not Found");
                });
                }





                share|improve this answer

























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  //HTML
                  <div ng-dropdown-multiselect="example65data" id="xyz"//Can Be Anything options="example65data" selected-model="example65model"></div>

                  //JS
                  $scope.example65model= ;
                  function abc//Can Be Anything() {
                  var allData = hrmsService.getdata//Service Function Call();
                  allData.then(function (//Take any variable//pqr) {
                  DataObj = ;
                  for (var i in pqr.data) {
                  item = {}
                  item["id"] = pqr.data[i].Id//Primary Key;
                  item["label"] = apiSkills.data[i].Description//Any Description Field;
                  DataObj.push(item);
                  }
                  $scope.example65data= DataObj;
                  }, function () {
                  alert("Data Not Found");
                  });
                  }





                  share|improve this answer














                  //HTML
                  <div ng-dropdown-multiselect="example65data" id="xyz"//Can Be Anything options="example65data" selected-model="example65model"></div>

                  //JS
                  $scope.example65model= ;
                  function abc//Can Be Anything() {
                  var allData = hrmsService.getdata//Service Function Call();
                  allData.then(function (//Take any variable//pqr) {
                  DataObj = ;
                  for (var i in pqr.data) {
                  item = {}
                  item["id"] = pqr.data[i].Id//Primary Key;
                  item["label"] = apiSkills.data[i].Description//Any Description Field;
                  DataObj.push(item);
                  }
                  $scope.example65data= DataObj;
                  }, function () {
                  alert("Data Not Found");
                  });
                  }






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Apr 11 '17 at 11:52









                  Lasse Sviland

                  1,081718




                  1,081718










                  answered Apr 11 '17 at 8:42









                  Aditya Shah

                  35




                  35
























                      up vote
                      0
                      down vote













                      Try this



                        //HTML
                      <div
                      ng-dropdown-multiselect=""
                      options="tabListdata"
                      selected-model="tabListmodel"
                      extra-settings="tabListsettings"
                      events="{ onSelectionChanged: getAllPolicies }"
                      >
                      </div>

                      //JS
                      $scope.tabListmodel = ;
                      $scope.tabListdata = [{
                      id: 1,
                      label: "Option 1"
                      }, {
                      id: 2,
                      label: "Option 2"
                      }, {
                      id: 3,
                      label: "Option 3"
                      }, {
                      id: 4,
                      label: "Option 4"
                      }, {
                      id: 5,
                      label: "Option 5"
                      }, {
                      id: 6,
                      label: "Option 6"
                      }];

                      $scope.tabListsettings = {
                      smartButtonMaxItems: 6,
                      smartButtonTextConverter: function (itemText, originalItem) {
                      return itemText;
                      }
                      };

                      $scope.getAllPolicies = function () {
                      console.log("$scope.tabListmodel", $scope.tabListmodel);
                      }





                      share|improve this answer

























                        up vote
                        0
                        down vote













                        Try this



                          //HTML
                        <div
                        ng-dropdown-multiselect=""
                        options="tabListdata"
                        selected-model="tabListmodel"
                        extra-settings="tabListsettings"
                        events="{ onSelectionChanged: getAllPolicies }"
                        >
                        </div>

                        //JS
                        $scope.tabListmodel = ;
                        $scope.tabListdata = [{
                        id: 1,
                        label: "Option 1"
                        }, {
                        id: 2,
                        label: "Option 2"
                        }, {
                        id: 3,
                        label: "Option 3"
                        }, {
                        id: 4,
                        label: "Option 4"
                        }, {
                        id: 5,
                        label: "Option 5"
                        }, {
                        id: 6,
                        label: "Option 6"
                        }];

                        $scope.tabListsettings = {
                        smartButtonMaxItems: 6,
                        smartButtonTextConverter: function (itemText, originalItem) {
                        return itemText;
                        }
                        };

                        $scope.getAllPolicies = function () {
                        console.log("$scope.tabListmodel", $scope.tabListmodel);
                        }





                        share|improve this answer























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          Try this



                            //HTML
                          <div
                          ng-dropdown-multiselect=""
                          options="tabListdata"
                          selected-model="tabListmodel"
                          extra-settings="tabListsettings"
                          events="{ onSelectionChanged: getAllPolicies }"
                          >
                          </div>

                          //JS
                          $scope.tabListmodel = ;
                          $scope.tabListdata = [{
                          id: 1,
                          label: "Option 1"
                          }, {
                          id: 2,
                          label: "Option 2"
                          }, {
                          id: 3,
                          label: "Option 3"
                          }, {
                          id: 4,
                          label: "Option 4"
                          }, {
                          id: 5,
                          label: "Option 5"
                          }, {
                          id: 6,
                          label: "Option 6"
                          }];

                          $scope.tabListsettings = {
                          smartButtonMaxItems: 6,
                          smartButtonTextConverter: function (itemText, originalItem) {
                          return itemText;
                          }
                          };

                          $scope.getAllPolicies = function () {
                          console.log("$scope.tabListmodel", $scope.tabListmodel);
                          }





                          share|improve this answer












                          Try this



                            //HTML
                          <div
                          ng-dropdown-multiselect=""
                          options="tabListdata"
                          selected-model="tabListmodel"
                          extra-settings="tabListsettings"
                          events="{ onSelectionChanged: getAllPolicies }"
                          >
                          </div>

                          //JS
                          $scope.tabListmodel = ;
                          $scope.tabListdata = [{
                          id: 1,
                          label: "Option 1"
                          }, {
                          id: 2,
                          label: "Option 2"
                          }, {
                          id: 3,
                          label: "Option 3"
                          }, {
                          id: 4,
                          label: "Option 4"
                          }, {
                          id: 5,
                          label: "Option 5"
                          }, {
                          id: 6,
                          label: "Option 6"
                          }];

                          $scope.tabListsettings = {
                          smartButtonMaxItems: 6,
                          smartButtonTextConverter: function (itemText, originalItem) {
                          return itemText;
                          }
                          };

                          $scope.getAllPolicies = function () {
                          console.log("$scope.tabListmodel", $scope.tabListmodel);
                          }






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered yesterday









                          Atul Baldaniya

                          146




                          146






























                               

                              draft saved


                              draft discarded



















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f42990100%2fdynamically-set-the-settings-options-for-the-ng-dropdown-multiselect%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              'app-layout' is not a known element: how to share Component with different Modules

                              android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

                              WPF add header to Image with URL pettitions [duplicate]