ThirdCornerLLC / tc-grid

A declarative grid for AngularJS
MIT License
14 stars 2 forks source link

Need a way to update data without double calling paging and sorting #33

Closed Zacharias3690 closed 9 years ago

Zacharias3690 commented 9 years ago

Currently when the table loads it calls onPageChange() and onSortChange(). If both of these exist, we end up double calling an endpoint.

To fix this we could add another option called update that takes a function which returns page, count, sort and is called in place of onPageChange and onSortChange

timgit commented 9 years ago

It doesn't call both:

                        if (vm.options.sorting.onSortChange)
                            sortChanged();
                        else if (vm.options.paging.onPageChange)
                            pageChanged();
Zacharias3690 commented 9 years ago

You're right, double call was from an implementation issue