Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How Can I get selected value from isteven multi select Dropdown in mongoDB? #550

Open
binita12345 opened this issue Jan 30, 2018 · 1 comment

Comments

@binita12345
Copy link

I am using iSteven Multi Select DropDown and I want to get only selected value from iSteven dropdown in below Angular datatable.

screenshot from 2018-01-30 09 53 58

My Integrated code is:
In HTML,
      <div class="form-group col-md-4">
                        <label for="bCat">Release Year</label>
                            <div isteven-multi-select class="multiselect-container"
                                    input-model="bookReleases"
                                    output-model="selectedReleases"
                                    button-label="year"
                                    item-label="year"
                                    output-properties="_id"
                                    on-item-click="withYearSelected(data)"
                                    on-reset="withYearSelected(undefined)"
                                    tick-property="selected"
                                    selection-mode="single">
                            </div>
                        <input type="text" ng-model="selectedReleases" name="buks2" id="buks2" style="display:block">
                    </div>
<table id="bookstoreTable" datatable="" dt-options="bookstores.dtOptions" dt-
columns="bookstores.dtColumns" dt-instance="bookstores.dtInstance"
                         class="table table-bordered dt-responsive table-hover" style="width: 100%;"></table>

In Controller,
$scope.bookstores.dtInstance = {};
    $scope.bookstores.reloadData = function () {
      $scope.bookstores.dtInstance.reloadData();
    };

    $scope.withYearSelected = function (yearSelected) {
      console.log('condition yearSelected', yearSelected);
      // $scope.yearSelected = yearSelected;
      // booksService.getAllBooksForTable(yearSelected).then(function (result) {
      //   console.log('condition result', result);
      // });
      // $scope.yearSelected = yearSelected ? yearSelected[0]._id : undefined;
      $scope.yearSelected = yearSelected;
      console.log('condition $scope.yearSelected', $scope.yearSelected);
      $scope.bookstores.reloadData();
      
    }

$postData = {
limit: data.length,
offset: data.start,
search: data.search.value,
order: data.order[0],
filter: {
year: $scope.yearSelected,
}
};

@ahmed-fastshop
Copy link

ahmed-fastshop commented Sep 1, 2023

Hi,
i am using this line in on-item-click="GetBrandID(data)"
and i have this function in angular js

$scope.GetBrandID = function (SelectedBrandID)
   {
       debugger;
       $scope.SelectedBrandID = SelectedBrandID.icon;

       if ($scope.lstSelectedBrandID.indexOf($scope.SelectedBrandID) === -1)
       {
           $scope.lstSelectedBrandID.push($scope.SelectedBrandID);
       }

       concatenatedbrandIDs = $scope.lstSelectedBrandID.join(', ');
   }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants