v1.0.6
- Added fin-hypergrid.min.js which was omitted from original release due to a technical issue.
- Added "treeview" support for self-joined tables:
- Self-joined tables have both a primary key column and a foreign key column that refers to a "parent" record in the same table.
- The default names for these columns are "ID" and "parentID" but alternate names can be specified.
- One column is specified as the "tree" column and is displayed as an interactive drill-down with right or down triangles.
- The default name for the tree column is "name" but an alternate name can be specified.
- Implemented as a new "data source" in hyper-analytics module.
- Tree view is switch on and off by calling a new method:
behavior.setRelation(options)— whereoptionsspecifies the alternate column names.
- Updated all "dependencies" in package.json to exact version numbers. Specifically, npm's default version numbers use the semver "^" operator. This operator has been removed in favor of the (implied) "=" operator.
- Fixed cell editor's error feedback count; error explanation now appears after every third failed attempt to save.
- Active column interface methods have been renamed to more accurately describe their function ("VisibleColumns" was already in use in Renderer.js to mean something different) (old methods retained for now with deprecation warnings):
behavior.getVisibleColumn(index)→behavior.getActiveColumn(index)behavior.getColumnCount(index)→behavior.getActiveColumnCount(index)behavior.getVisibleColumns()→behavior.getActiveColumns()dataModel.getVisibleColumns()→dataModel.getActiveColumns()
- Changed calling signature (old signature retained for now as an overload but with a deprecation warning):
grid.editAt(cellEditor, editPoint)→grid.editAt(editPoint)
- Some extraneous methods have been removed (old methods have generally retained for now with deprecation warnings):
- Removed
behavior.getVisibleColumnName(index)→behavior.getActiveColumn(index).name - Removed
behavior.getColumnId(index)→behavior.getActiveColumn(index).header - Removed
behavior.getHeader(index)→behavior.getActiveColumn(index).header - Removed
grid.registerCellEditor(Constructor, name)→grid.cellEditors.add(name, Constructor) - Removed
grid.createCellEditor(name)→grid.cellEditors.create(name) - Removed
grid.getCellProvider().xxxx→grid.cellRenderers.get('xxxx') - Removed
behavior.getCellProvider().xxxx→grid.cellRenderers.get('xxxx') - Removed
behavior.getCellProvider().xxxx→grid.cellRenderers.get('xxxx') - Removed
behavior.createCellProvider(). No replacement; do not call. Previously called byBehaviorconstructor;new CellRenderers()is now called byHypergridconstructor instead. - Removed
grid.registerLocalizer→grid.localization.add(name, localizer) - NOTE: First parameter
nameforcellEditors.add,cellRenderers.add,localization.addis now optional, deferring to the class name in the constructor supplied as the second parameter (now the first).
- Removed
- Changed some labels in Column Picker to reflect our actual terminology:
- Hidden Columns → Inactive Columns
- Visible Columns → Active Columns
Column.prototype.getCellProperties()now returns{}(empty object) rather thanundefinedif there were no cell properties.- Fixed a defect in the validator generated by the
localization.DateFormatter()factory function that was preventing successful editing of dates using such localizers. - Made
column.headerinto a getter/setter (local property:_header) so that setting the header here will update the actual header displayed in the grid, as expected. - Changed the default
'number'formatter's maximum fractional digits to 0 instead of 3 (Intl.NumberFormat's default). - Rather than suppressing formatting all together when you don't like the default, best practice is to define your own grid-wide standard (default) format using the localization option on grid instantiation (or redefining the defaults in
Hypergrid.localization). - Fixed the "row styling" example (demo dashboard checkbox).
- Fixed the "Reset" function (demo dashboard button).
- Removed the overly "opinionated" editor/renderer/type render property name cascade. Specifically:
- Render property 'editor' no longer defaults to render property 'format'; you can add this logic to your
dataModel.getCellEditorAtoverride if you want it. - Render property 'format' no longer defaults to render property 'type'; you can add this logic to your
dataModel.getCelloverride if you want it.
- Render property 'editor' no longer defaults to render property 'format'; you can add this logic to your
- The
autoPopulaterender property is deprecated; use{ editor: 'combobox' }instead. - Added "hh:mm" localizer example to demo.js.
- Added new column
birthTimeto widedata.js. - Expanded cell editors tutorial.
Cell renderers and editors
Refactored cell renderer interface calls to parallel the cell editor model:
- Each grid instantiation instantiates:
- a new
CellRenderersobject asgrid.cellRenderers— gets its own registry initialized with standard renderers - a new
CellEditorsobject asgird.cellEditors— gets its own registry initialized with standard editors
- a new
- These instances get their own registry, initialized with the standard renderers and editors, respectively.
- While both
grid.cellRenderers.add()andgrid.cellEditors.add()take a constructor as an argument, note the following conceptual difference between the cell editor and cell renderer registries:- Cell editors objects remain as constructors used to create the current cell renderer only when needed.
- Cell renderer objects are instantiated singleton instances.
- Added a new
rendererrender property so cell renderers can now be set declaratively like cell editors (in addition to programmatically). The default value (at the grid level) is 'SimpleCell'. - Moved the overrideable
cellProvider.getCell()(for programmatically selecting cell renderers) todataModel.getCell()in parallel with cell editor'sdataModel.getCellEditorAt(). - "Cell provider" has been broken up. The API is now instanced by each grid from
CellRenderers. - Cell renderers are now separate files; all extend from the
CellRendererbase class. - Renamed
editorPointtoeditPointwherever it appeared inside ofCellEditor.prototypefor naming consistency. - Cleared cruft, simplifying the internal implementations of:
Hypergrid.prototype.onEditorActivateHypergrid.prototype.editAtCellEditor.prototype.beginEditing(formerlybeginEditAt)
getCellEditorAt
The overrideable dataModel.getCellEditorAt() method for programmatically selecting cell editors is now called with two new additional parameters:
declaredEditorName- Your override of this method may choose to respect or replace this name. It then is expected to either use it to access a cell renderer constructor from the cell renderer registry or use some other constructor. In any case, it must instantiate and return a cell editor.options- See the getCellEditorAt API entry for details.
getCell
The overrideable dataModel.getCell() (formerly dataModel.getCellEditorAt()) method for programmatically selecting cell renderers is now called with an additional parameter:
declaredRendererName- Your override of this method may choose to respect or update this name. It then is expected to use it to fetch and return a cell renderer singleton from the cell renderer registry.
Localizers:
- New:
grid.localization→ a grid-specific instance ofLocalization - Renamed (old method retained for now with deprecation warning):
localization.set→localization.add - New:
Hypergrid.localization→ a shared defaults forlocale,numberOptions, anddateOptionsif constructor'soptions.localizationobject is missing or is missing any of those individual properties. - Renamed localizer methods so they are more descriptive of their actual functions:
.localize(value)→.format(value).standardize(value)→.parse(value)
- A cell editor's localizer is no longer overridden with 'null' on instantiation, allowing the inherited localizer to be seen. There is now a default localizer 'null' for text cell editors in Textfield.prototype.localizer which simply invokes
toString()for both.format()and.parse().)
Filter plug-in:
- Fixed
grid.setTableFilter(). - CQL (Column Query Language, the filter cell syntax) now accepts optional quotation marks and parentheses around operands. Quotation character is escaped by doubleing it. The actual quotation character a shared prop (default is double-quote character).
- CQL now considers operators to be reserved words. User is now warned when operand is missing or an (unquoted/unparenthesized) operand contains additional operators.
- Updated
behavior.setData(data)→behavior.setData(data, schema)where the newschemaparameter is optional. If you don't supply it, it will be derived from the fields list. This parallels the current grid instantiation logic when supplyingdataandschemain the options object for the first implicitsetDatacall. (The current options object is under review and may be altered substantially in the next sprint.) - Manage Filters: Fixed some bugs with the CQL and SQL tabs
- Internally, restored
conditionalsformal parameter to filter-tree'sFilterLeaf.prototype.getSyntaxbecause removing it broke SQL generator. Restored actual parameter inDefaultFilter's call. - Known issue: Filter does currently searches "formulas" (unformatted data). It does not search "values" (formatted data). (These terms are from Excel.) Searching formatted data would require formatting all the data on every search which is super-expensive. Normally, only visible data needs to be formatted -- a very small manageable number of rows.