ThirdCornerLLC / tc-grid

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

Fix #34 - Call onLoad with fallback to old behavior during init #38

Closed mbreedlove closed 9 years ago

mbreedlove commented 9 years ago

onPageChange and onSortChange are no longer called during init. A new config option, onLoad, is a callback to have the grid optionally load it's own data during during init.

Zacharias3690 commented 9 years ago

@mbreedlove @timgit I think we should use page/sort change as a backup in case onLoad isn't available. It helps with backwards compatibility.

On the other hand, calling on page/sort change isn't really verbose and is unexpected. What do y'all think?

mbreedlove commented 9 years ago

@Zacharias3690, that's a good call. I think we should fall back to the old behavior for now. We can remove the calling of onPageChange and onSortChange during a major release as it's a breaking change, like you said.

I updated the commit to try onLoad first, then the old behavior if onLoad is undefined.