ionic-filter-bar
ionic-filter-bar copied to clipboard
$ionicFilterBar.hide() maybe?
Essentially, I have a list of products and a shopping cart. Each has its own UI state. And each view is collection-repeat.
When viewing products and using $ionicFilterBar it works as expected. However, when clicking an item, it adds the product to the shopping cart and the redirects to shopping cart. When redirecting I get an error in the products collection repeat - it seems be closing the $ionicFilterBar before redirecting is required?
The error starts off as:
Error: collection-repeat tried to compute the height of repeated elements "product in products", but was unable to. Please provide the "item-height" attribute. http://ionicframework.com/docs/api/directive/collectionRepeat/ at HTMLElement.refreshDimensions (http://localhost:8100/lib/ionic/js/ionic.bundle.js:50732:17)
So, I realized if you do...
$scope.showFilterBar = function () {
filterBarInstance = $ionicFilterBar.show({
items: $scope.products,
update: function (filteredItems) {
$scope.products = filteredItems;
},
});
};
I can later call filterBarInstance()
to "cancel" the filter-bar.
It still doesn't like switching between states unless until the filter-bar has been completely removed... which ends up with a delay before changing states...
This is definitely only an issue with collection-repeat...
Anyway, thank you for great work!
Thanks @ryanyakich ! The filter bar is configured to cancel on stateChangeSuccess so I would think it would cancel after the state change has already taken place. Are you not seeing this behavior? Do you have a codepen or example I can use to replicate what you are seeing?
Thanks!
Sorry for the delay.
http://codepen.io/anon/pen/GJzvGQ http://codepen.io/anon/pen/GJzvGQ
View the log when you add an item from the filtered data…
On Aug 5, 2015, at 12:14 PM, Devin Jett [email protected] wrote:
Thanks @ryanyakich https://github.com/ryanyakich ! The filter bar is configured to cancel on stateChangeSuccess so I would think it would cancel after the state change has already taken place. Are you not seeing this behavior? Do you have a codepen or example I can use to replicate what you are seeing?
Thanks!
— Reply to this email directly or view it on GitHub https://github.com/djett41/ionic-filter-bar/issues/27#issuecomment-128055000.
ionicfilter bar cancel button is working inside the $ionicFilterBar.show(). but i want it to be cancelled manually by me on certain successfull api response. how can i cancel the filter bar manually.. i have tried $ionicFilterBar.hide(), cancelfilterbar but i cant cancel it. the error states hide and cancelfilterbar is not a function or not defined.Please Help
Same case for me @rahulvaradharajan091 . If you find a way let me know
+1