Skip to content

v1.0.6

Choose a tag to compare

@joneit joneit released this 23 Jun 19:23
· 1198 commits to master since this release
  • 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) — where options specifies 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().xxxxgrid.cellRenderers.get('xxxx')
    • Removed behavior.getCellProvider().xxxxgrid.cellRenderers.get('xxxx')
    • Removed behavior.getCellProvider().xxxxgrid.cellRenderers.get('xxxx')
    • Removed behavior.createCellProvider(). No replacement; do not call. Previously called by Behavior constructor; new CellRenderers() is now called by Hypergrid constructor instead.
    • Removed grid.registerLocalizergrid.localization.add(name, localizer)
    • NOTE: First parameter name for cellEditors.add, cellRenderers.add, localization.add is now optional, deferring to the class name in the constructor supplied as the second parameter (now the first).
  • 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 than undefined if 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.header into 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.getCellEditorAt override if you want it.
    • Render property 'format' no longer defaults to render property 'type'; you can add this logic to your dataModel.getCell override if you want it.
  • The autoPopulate render property is deprecated; use { editor: 'combobox' } instead.
  • Added "hh:mm" localizer example to demo.js.
  • Added new column birthTime to 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 CellRenderers object as grid.cellRenderers — gets its own registry initialized with standard renderers
    • a new CellEditors object as gird.cellEditors — gets its own registry initialized with standard editors
  • These instances get their own registry, initialized with the standard renderers and editors, respectively.
  • While both grid.cellRenderers.add() and grid.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 renderer render 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) to dataModel.getCell() in parallel with cell editor's dataModel.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 CellRenderer base class.
  • Renamed editorPoint to editPoint wherever it appeared inside of CellEditor.prototype for naming consistency.
  • Cleared cruft, simplifying the internal implementations of:
    • Hypergrid.prototype.onEditorActivate
    • Hypergrid.prototype.editAt
    • CellEditor.prototype.beginEditing (formerly beginEditAt)
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 of Localization
  • Renamed (old method retained for now with deprecation warning): localization.setlocalization.add
  • New: Hypergrid.localization → a shared defaults for locale, numberOptions, and dateOptions if constructor's options.localization object 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 new schema parameter is optional. If you don't supply it, it will be derived from the fields list. This parallels the current grid instantiation logic when supplying data and schema in the options object for the first implicit setData call. (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 conditionals formal parameter to filter-tree's FilterLeaf.prototype.getSyntax because removing it broke SQL generator. Restored actual parameter in DefaultFilter'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.