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

Disable/Enable drops filter option #283

Closed
MonizDave opened this issue Apr 8, 2016 · 6 comments
Closed

Disable/Enable drops filter option #283

MonizDave opened this issue Apr 8, 2016 · 6 comments

Comments

@MonizDave
Copy link

When I initialize with filter: true it's there. But I have a toggle for disable/enable and when that's used the filter is gone.

I tried manually forcing it to come back with no luck

@wenzhixin
Copy link
Owner

Can you provide a jsfiddle? #255

@MonizDave
Copy link
Author

I was using it with angular and the select>options were generated with ng-repeat and it was misbehaving, but I added a custom directive to fire when the repeat was done and now it works great!

You can close this.

@wenzhixin
Copy link
Owner

Great!

@lvandeuren
Copy link

Could you share the directive you added? The bug is still there

@MonizDave
Copy link
Author

MonizDave commented Feb 9, 2018

You need to include this with the data-ng-repeat:

<div data-ng-repeat="Thing in Things" on-finish-render="ngRepeatFinished"

The directive is as follows (obviously replace Module with your Module Object):

Module.directive('onFinishRender', function ($timeout) {
	return {
		restrict: 'A',
		link: function (scope, element, attr) {
			if (scope.$last === true) {
				$timeout(function () {
					scope.$emit('ngRepeatFinished');
				});
			}
		}
	}
});

@lvandeuren
Copy link

Awesome! Actually my problem was caused by running "refresh" before initializing the multipleSelect, which supplied default options... by default

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

3 participants