ThirdCornerLLC / tc-grid

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

Need a config setting for specifying loading behavior #34

Closed timgit closed 9 years ago

timgit commented 9 years ago

Currently, the grid calls sortChanged or pageChanged based on settings in the config during loading.

In place of this, I'd prefer to create a section in the config dedicated to loading behavior so it's clearly understood when the grid will or will not call these callbacks.

timgit commented 9 years ago

Here's a candidate implementation. Basically, unless you pass in a fetchOnLoad callback, the grid will not call the sort or page changed callbacks. I'm assuming we'd look for the sorting settings and pass the current sort in the callback. The page should most likely always be set to 1. Your thoughts?

var config = {
   fetchOnLoad: callback
};

This would merit a bump to 0.8 since it would break all existing grid implementations.

Zacharias3690 commented 9 years ago

I like the idea, but not the name. fetchOnLoad sounds like a boolean to me. Following our naming convention we could use onLoad.

timgit commented 9 years ago

onLoad it is then