angular-multi-select icon indicating copy to clipboard operation
angular-multi-select copied to clipboard

How to reset multi-select button without click on it?

Open stl-winniechan opened this issue 11 years ago • 5 comments

I'm using version 3.0. I able to integrate the angular-multi-select in my web application. However, the problem come after the request is submitted and when I reset all the settings. For angular-multi-select, I tried to reset both the input-model and output-model, however, the button text stay with the previous selections until I click on it. Is there any way to programatically reset the button?

Any help is appreciated!

stl-winniechan avatar Oct 21 '15 21:10 stl-winniechan

@stl-winniechan ,

First, please try to get the latest version from the release page.

To directly manipulate the data, you manipulate the input-model. Not the output-model. The button should automatically update itself.

isteven avatar Oct 22 '15 04:10 isteven

hi,

I am having the same issue. I have a button which resets all multiselect drodpdowns in a page. I have manipulated the input-model by recalling the API. It seems the reset only works if the data has been makeKeysAsIntegers()

k1ngsengson avatar Sep 13 '16 14:09 k1ngsengson

I've got the same problem, @k1ngsengson

Do you have a solution?

VictorDeBlas avatar Sep 21 '16 14:09 VictorDeBlas

@VictorDeBlas I rebind the input-model then added this code $('.ng-binding').trigger('click');

$scope.reset = function () { $scope.InputModel = list.InputModel; $('.ng-binding').trigger('click'); }; list.InputModel is just a variable where I stored the original list to prevent calling the database or API twice. Hope this helps

k1ngsengson avatar Sep 21 '16 18:09 k1ngsengson

Ok! Thanks!

VictorDeBlas avatar Sep 22 '16 06:09 VictorDeBlas