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

Filter and sorting aren't working #115

Closed
billfranklin opened this issue Mar 12, 2015 · 8 comments
Closed

Filter and sorting aren't working #115

billfranklin opened this issue Mar 12, 2015 · 8 comments
Assignees
Labels
Milestone

Comments

@billfranklin
Copy link

I am using a service to populate the bind-resource with a JSON data provider. The data populates fine, and the table paginates, but I am unable to get the filter or the sorting to work. Here is my table heading and controller

    <div tasty-table bind-resource="vm.notifications" bind-filters="vm.filters">
        <table class="table table-striped table-condensed">
            <thead bind-not-sort-by="vm.notSortBy">
    function HomeController(notificationFactory){
        var vm = this;
        vm.debug = true;
        vm.filters = '';
        vm.notSortBy = [];
        vm.notifications = {'header':[],'rows':[]};

        notificationFactory.list().then(function(data){
            vm.notifications = data;
            return vm.notifications;
        });

    }
@Zizzamia Zizzamia added this to the Version 0.5.2 milestone Mar 12, 2015
@Zizzamia Zizzamia self-assigned this Mar 12, 2015
@Zizzamia
Copy link
Owner

I did not try yet your code, but a possible issue could the fact you don't pass a $scope variable.
And the internal $scope.$watch can not work properly in this case.

@billfranklin
Copy link
Author

I added $scope to the controller...didn't change anything.

@Zizzamia
Copy link
Owner

The sorting is not working because you miss add the tasty-thead directive.
Here an example of the Complete Tasty table version http://zizzamia.com/ng-tasty/directive/table/complete

@joamaki
Copy link

joamaki commented Mar 16, 2015

I'm having this issue as well. Seems like the simple http example is misbehaving as well: http://zizzamia.com/ng-tasty/directive/table/simple-http. Pressing the headers to sort only works sometimes and only in one direction.

@Zizzamia
Copy link
Owner

Hi @joamaki,
can you please give me an example of code with the Javascript and Markup you are using.
If you guys can recreate the error here will be so easy for me fix it in an hour. ThankYou

@joamaki
Copy link

joamaki commented Mar 18, 2015

As said earlier, the code in the simple-http example shows this. It gets triggered
when 'watch-resource' is set to 'collection'. Try clicking few times on the "Name" header in the 'simple-http' example and compare it to the behaviour in the 'simple' example.

@Zizzamia
Copy link
Owner

Ops! That looks a bug. I will take care of that, thanks for the feedback.

@Zizzamia
Copy link
Owner

I double check, and in the new version I will release soon 0.5.2 the bug is gone.

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

No branches or pull requests

3 participants