Hypergrid v3.0.0
Please make careful note herein of breaking changes.
In addition (depending on what version you are upgrading from), you will want to reveiw the release notes of late versions of 2.1.x, which added many new features!
CAUTION: DO NOT BLINDLY UPGRADE YOUR APP TO VERSION 3!!
While this new version is largely backwards compatible for many use cases, there are breaking changes as the major version number increment implies, especially around the dataModel object which will affect those applications that manipulate or depend on low-level aspects of the v2 dataModel object.
If you feel your use application is not one of those, do give it a try. Otherwise, please check back here in a few days for detailed release notes noting the pain points migrating from v2 to v3.
Demos
The demos have been removed from this core repo to a new repo called build. The live demo links on the CDN have not changed, including the default demo, the dev testbench. For a listing of the other demos, see the new demo index. (Note that because the links haven't changed, you may need to clear your cache to see all of the latest versions (although some of their contents haven't changed at all.)
Data model changes
We have retired the internal DataModel
class and dataModels/JSON
subclass, previously referenced as grid.behavior.dataModel
. That reference now points to an external black-box dataModel.
(Some properties of the retired objects that dealt with the internal structure of the data model, such as .DataSources
, .source
, .dataSource,
.pipeline, and
.controllers`, are now gone. How the external data model works is no longer of any interest to Hypergrid. Furthermore, “data controllers” have been replaced with messaging.
)
To make this transition easier (seamless, in fact, for most developers), we have included a new default data model in the build (datasaur-local
which subclasses datasaur-base
), used when developers do not “bring their own” external data model, provided to either of two new instantiation options, dataModel
(a fully instantiated data model API) or DataModel
(a data model constructor).
The new data model interface is responsible for implementing a very small core set of three methods. Implementation of any of an additional larger set of methods is optional. When unimplemented, Hypergrid injects “fallback” implementations that provide basic functionality. This ensures that basic access to the data model is backwards compatible. The .dataModel.getCell
and .getCellEditorAt
“hooks” are both still supported.
(Note that DataSourceBase
and DataSourceLocal
have been retired.)
A detailed wiki describing the data model interface is forthcoming.
Data model messaging
New to Hypergrid is data model events. Hypergrid subscribes to and handles some basic data model events (for those data models that implement events), before propagating them out to the grid as grid events (which the application layer can subscribe to). You can also roll your own custom data model events to listen for as grid events. By convention, data model event strings should be revised with fin-hypergrid-data-
.
For example, Hypergrid handles the fin-hypergrid-data-schema
data model event by “decorating” the dataModel.schema
array with a self-referential dictionary with column names as keys, including “camelized” versions of keys with underscores and hyphens, etc.
Behavior
changes
- The internal
behaviors/JSON
subclass ofBehavior
is now calledLocal
. - Behavior object support for data controllers (
grid.behavior.getController
,.setController
,.prop
) have been retired in favor of data model messaging. - The properties
Behavior.prototype.columnEnum
,.columnEnumKey
, and.columnEnumDecorators
have been deprecated in favor of accessing column schema through.schema
,.columns
, and.allColumns
, all of which now sport self-referential dictionaries. (Deprecated means these properties are still supported for now but accessing them will issue deprecation warnings to the console.)
Old deprecated methods retired
All methods previously deprecated in versions 1.x.x (which issued deprecation warnings to the console) have been removed. These methods are no longer supported and calling any of them will now throw an error. (You were warned.)
Miscellany
- Fixed
removeAllEventListeners
- Added
fin-hypergrid/src/lib/SelectionRectangle.js
LikeRectangle
but.extent
coords are exclusive rather than inclusive (i.e., 1 greater), which works better with.width
,.height
, and.area
which were previously of little use. - New
Hypergrid
methods:addState
stashRowSelections
unstashRowSelections
stashColumnSelections
unstashColumnSelections
- Improved
registerTheme
andregisterThemes
logic.