ionic-filter-bar icon indicating copy to clipboard operation
ionic-filter-bar copied to clipboard

$ionicFilterBar.hide() maybe?

Open ryanyakich opened this issue 9 years ago • 6 comments

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)

ryanyakich avatar Aug 03 '15 16:08 ryanyakich

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!

ryanyakich avatar Aug 04 '15 14:08 ryanyakich

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!

djett41 avatar Aug 05 '15 16:08 djett41

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.

ryanyakich avatar Aug 10 '15 11:08 ryanyakich

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

rahulvaradharajan091 avatar Mar 14 '16 14:03 rahulvaradharajan091

Same case for me @rahulvaradharajan091 . If you find a way let me know

jeremie-olivier avatar Mar 16 '16 02:03 jeremie-olivier

+1

wal-nadeem avatar Apr 18 '16 11:04 wal-nadeem