Releases: fin-hypergrid/core
Releases · fin-hypergrid/core
v1.0.9
- Restored Safari support
- Context Menu events no longer propagates
- Added
halign
render property. - Fixed: Vertical scrollbar is no longer misplaced 200 pixels to the left when grid overflows canvas's container width.
- Grid's container will default to a height of 300px and css relative positioning unless those attributes are set
- Selection model
- Added
multipleSelections
, a new grid property that defaults tofalse
. Set it totrue
to "opt in" to get the old behavior wherein CTRL-click(-drag) selects additional cell regions. These multiple regions are nearly useless. (The application developer can programmatically inspect the selection model to see all such selections, the user can only COPY the most recently selected region.) - Sample code: Added a new dashboard checkbox Selection: one cell region at a time which (when one row at a time is also checked) causes the cell selection to travel with the row selection. See the code in
fin-row-selection-changed
event listener in demo.js. - Fixed demo: The Selection: one row at a time dashboard checkbox now initializes properly.
- Fixed: User can now _un_check individual row selection checkboxes after clicking on the select all checkbox at the top of the row handle column.
- Added
- Tree view
- Fixed: Error was previously being thrown when column count was greater than row count.
- Improved sorting: Now only sorts on expandable rows (rows with drill-down controls), leaving non-expandable rows (leaf node rows) stable sorted (i.e., they retain their sort positions from the previous sorter).
- Improved default sort: When no column has an explicit sort, the group sorter is automatically applied, e.g., to the ID column which is usually hidden. UI no longer insists on a visible column sort; this functionality is now completely transparent to the user.
- Filtering: Filter cell syntax a.k.a. Column Query Language (CQL)
- Fixed: Error reported upon encountering operators consisting of consecutive non alpha chars, e.g.,
<=
,>=
, and<>
(all of which incidentally have Unicode equivalents in CQL,≤
,≥
, and≠
.) - Added
opMustBeInMenu
column schema option. Whentrue
, rejects manually entered valid operators not specifically in column's operator menu. Added usage example to demo.js onlast_name
column, which had a custom operator menu. - Fixed CQL syntax support: Certain error conditions were causing premature alerts. Now fails "gracefully."
- Fixed SQL syntax support:
- SQL parser
- Now accepts unquoted numeric operands
- Now accepts column name or alias as operand
- SQL output
- Now outputs column operands (restoring broken functionality)
- SQL parser
- Fixed: Error reported upon encountering operators consisting of consecutive non alpha chars, e.g.,
- Find Row API plug-in: Find/modify/replace/delete a matching data row object.
- Added
dataModel.addRow()
method to add a new data row to the grid. - Internal change: Replaced use of
KeyboardEvent.keyIdentifier
in favor ofKeyboardEvent.key
because the former will be dropped in Chromium M53 due out in September.KeyboardEvent.key
is also supported in IE 9 and FF 23. It is not however a perfect replacement. See comment under 1.4.0 for more information. - Added grid property
enableContinuousRepaint
(boolean). This is a dynamic property and can be set or cleared at any time. When this mode is set:- Repaint occurs continuously (without having to call
grid.repaint()
). grid.getCanvas().currentFPS
is a measure of the number times the grid is being re-rendered each second.- While useful to get a measure of your grid's render speed, we emphatically advise against shipping applications using this mode because it causes Hypergrid to gobble up CPU time even when the grid appears idle (the very scenario
repaint()
is designed to avoid).
- Repaint occurs continuously (without having to call
v1.0.8
- Wrapped column headers no longer overflow bottom of cell. Overflow is clipped.
- Clicking to right of last column no longer throws an error.
- Zooming out (e.g., 80%) now properly clears the grid before repainting.
- Tree-view plug-in improvements:
- Now sorts properly and maintains a sorted state:
- On any column sort, applies a group sorter which sorts the column as usual but then automatically stable-sorts each level of group starting with deepest and working up to the top level. (Stable sorting from lowest to highest level grouping is an efficient means of sorting nested data, equivalent to starting with the highest groups and recursing down the tree to each lowest group.)
- Because raw data order is assumed to be undefined and grouping structure requires that groups be sorted, automatically applies an initial default sort to the "tree" column (name or index specified in
treeColumn
option passed toTreeView
constructor; defaults to'name'
). If a default sort column is defined (name or index specified indefaultSortColumn
option; defaults to the tree column), the initial sort is applied to that column instead. - Automatically reapplies the default sort when user removes the sort. User can change the sort to some other column or columns, but if user removes the current sort (whatever that may be), tree column sort is added back. This guarantees that the groups will always be sorted so the drill-downs work as expected.
- Demo:
tree-view.html
- Stand-alone tree column. To put the drill-down controls in a column of its own, do all of the following steps:
- Add a blank column to your data which will be your tree column to hold just the drill-down controls.
- Specify the name of your blank column to the
TreeView
constructor inoptions.treeColumn
. Alternatively, call it'name'
(the default). - Set the new
unsortable
property for your tree column totrue
so it cannot be sorted. As it is all blank, there is nothing to sort. - Set the active column order (via the grid's
columnIndexes
property). You want your blank column to appear first (i.e., on the left). Exclude theID
andparentID
columns (unless you want these to appear). - Make the blank column (now the left-most column) a fixed column (via the grid's
fixedColumnCount
property). - Specify some other column for the initial sort (in
option.defaultSortColumn
). This will typically be the column that identifies the group. - Demo:
tree-view-separate-drill-down.html
- Now sorts properly and maintains a sorted state:
- Grouped column headers plug-in (
add-ons/grouped-columns.js
):- Include:
<script src="http://openfin.github.io/fin-hypergrid/build/add-ons/grouped-header.js"></script>
- Install:
fin.Hypergrid.groupedHeader.mixInTo(grid)
- Usage, for example:
grid.behavior.setHeaders({ lat: 'Coords|Lat.', long: 'Coords|Long.' })
- The shared option
GroupedHeader.delimiter
specifies the delimiter; the default value is the vertical bar character:'|'
setHeaders
is a convenience function that simply updates the headers of the named columns while increasing the header row height to accommodate the maximum level of grouping. The above example has only a single level of grouping; the group label is "Coords".- Demo:
grouped-header.html
- Include:
- Calculated columns are defined by assigning a "calculator" function to the column's
calculator
property. All cells in the column become calculated values.- Data for the column's cells may be undefined; but if defined, it is available to the calculator function, but otherwise ignored.
- If the cell value is a function, however, legacy behavior is maintained: This function takes priority over the column function.
- Upon selecting a new operator from a column filter cell's dropdown, rather than inserting the new operator at the cursor position, the old operator is now replaced by the new one the operator. If the column filter cell contains several expressions (i.e., concatenated with
and
,or
, ornor
), the operator in the expression under the cursor is replaced. - Group view
- Aggregations and Group View have been added as plug-ins and removed from HyperGrid core.
- The aggregations plug-in has the same behavior as before while the Group View is a view of the original columns, with drill downs in the tree cell for expanding the groups provided.
- Hypergrid now only loads with the original data source, the filter datasource as defaults, and the sorter data source.
- Demo 1:
aggregations.html
- See Group Demo for example usage:
group.html
.
v1.0.7
- Fixed
deprecated()
calls that were discarding their results instead of returning. (So the warning was logged, but then the code would fail.) - Rendering
- New members added to renderer's
config
object:config.untranslatedX
- Index into full column list. (The existingconfig.x
is the index into the active column list.)config.normalizedY
- Row index less an offset such that the first data row is now0
.config.dataRow
- So can be passed to calculator function as 1st parameter.config.columnName
- So can be passed to calculator function as 2nd parameter.
- Default renderer (SimpleCell.js)
- Now renders
false
data primitive as "false" instead of blank. - Adjusted clipping region so wrapped hdr txt does not overflow y.
- Now renders
- New members added to renderer's
- Tree-view
- Tree column is set to uneditable (while joined).
- Moved tree-view code out of Hypergrid core, making it a small API for installing and invoking tree-view on proper data. Can be found in the new add-ons folder:
./add-ons/tree-view.js
- Updated "Big Pink" demo (demo/index.html and demo/js/demoj.js) and the tree-view demo (demo/tree-view.js and demo/js/tree-view.js) to use the and the API.
- Created a drill-down API for use with aggregate view, tree view, and group view. Can also be found in the new add-ons folder:
./add-ons/drill-down.js
This is a mix-in. Just included it and call it'smixInTo
method with your data model.
- Aggregate data view
- Reversed the order in which each column of a multi-column sort is sorted, which was backwards.
- Calculated values
- Added parameters to cell calculator function:
- Note that cell calculator functions are called on render, on COPY operation (applied to selected rows, columns, cells, or cell regions), on sorting, and on filtering (was commented out on filter previously).
- Note that you can also set the following cell properties to functions, which will be called with the same parameters above:
color
backgroundColor
foregroundSelectionColor
backgroundSelectionColor
- Deprecated methods
dataModel.getDataSource()
→dataModel.dataSource
grid.getColumnSortState(columnIndex)
(removed)grid.removeColumnSortState(columnIndex, sortPosition)
(removed)
- Edits to documentation, especially to:
- Cell editors tutorial.
- Cell renderers tutorial.
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)
— whereoptions
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().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 byBehavior
constructor;new CellRenderers()
is now called byHypergrid
constructor instead. - Removed
grid.registerLocalizer
→grid.localization.add(name, localizer)
- NOTE: First parameter
name
forcellEditors.add
,cellRenderers.add
,localization.add
is 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 thanundefined
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.
- Render property 'editor' no longer defaults to render property 'format'; you can add this logic to your
- 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 asgrid.cellRenderers
— gets its own registry initialized with standard renderers - a new
CellEditors
object 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
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) 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
CellRenderer
base class. - Renamed
editorPoint
toeditPoint
wherever it appeared inside ofCellEditor.prototype
for naming consistency. - Cleared cruft, simplifying the internal implementations of:
Hypergrid.prototype.onEditorActivate
Hypergrid.prototype.editAt
CellEditor.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
, anddateOptions
if constructor'soptions.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 newschema
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 supplyingdata
andschema
in the options object for the first implicitsetData
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'sFilterLeaf.prototype.getSyntax
because removing it broke SQL generator. Restored ...