-
make
Column.prototype.columnClasscorrectly handle names containing '.' -
column methods for getting/formatting a table cell's value (see below)
-
add an
Grid.prototype._isFilteredmethod that is used to determine whether the grid adds afilteredclass. default behavior should be something like:_isFiltered: function() { var collection = this.get('collection'); return collection && collection.query.params.query != null; } -
integrate spinner into grid so that it just shows up when grid is disabled
-
add a
PowerGrid.prototype.selectedmethod that returns the currently selected model or an array of selected models
current Column implementation just provides getValue, which glosses over a
number of different use cases. first of all, the Column class is responsible
for a number of things, including:
- getting the correct value from a model
- usually a simple property lookup, sometimes it can be really involved
- providing the appropriate value for sorting
- this is not currently true, but it needs to be
- providing the appropriate value for displaying to the user (a.k.a. formatting the value)
am i forgetting anything? so what set of methods do we need here? here's my take, let me know if you think we should do something else:
// this just gets the property from the model, similar to `modelProperty`
// in the old grid
getValue: function(model) {
return model.get(this.get('name'));
}
// for sorting -- should we even include this as a hook? or just make the
// sorting use `getValue`?
getSortValue: function(model) {
return this.getValue(model);
}
// for display/formatting
//
// could also be something like `getDisplayValue: function(model) {` to
// follow the convention above, but i think the function below conveys
// intent more clearly, and as @mmuzamil points out, allows more brevity
formatValue: function(value, model) {
return value;
}
let me know what you guys think.
- duplicate
<th>class names undefinedcss class on<thead>
- we need a
.propaget()onView. it should propagate the call both to otherViewinstances andWidgetinstances BoundWidgetGroupis causing everyone headaches. let's refactor it:- first we modularize a bunch of stuff (note these dont inherit from
VieworWidget, they're just utility classes):- binding: the first pass at this is mostly done
- widgetizing: basically just copy the code from
WidgetGroup - processing errors from API calls: currently the only place we do
this (or more accurately, something like this), is in
BoundWidgetGroup, but we need something more general that probably uses aBindinginstance to match errors to UI fields
- then we have some class called like
Formor something*, which inherits fromViewand ties all this stuff together, while hopefully not sacrificing too much either in flexibility or power
- first we modularize a bunch of stuff (note these dont inherit from
* note that in following with the javascript community conventions, we'd want
to choose some hipster name for this like Formality or Formr
the first 3 and last of the powergrid 'todos' are donezo.