Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.1.6 #706

Merged
merged 3 commits into from
Mar 22, 2018
Merged

v2.1.6 #706

merged 3 commits into from
Mar 22, 2018

Conversation

joneit
Copy link
Contributor

@joneit joneit commented Mar 16, 2018

  • Fixed COPY (ctrl-C, command-C) regression (copy select data command)
  • Fixed single-column-after-fixed-column(s) render issue (was crashing renderer)
  • For restoring row selection(s) across data transformations (reindex calls):
    • restoreRowSelections — new property (formerly controlled by the checkboxOnlyRowSelections property which was creating logic conflicts)
    • restoreColumnSelections — new property to restore column selection(s) (new feature)
  • Behavior.prototype.getActiveColumnIndex — a new overload accepts a column name (string) in addition to existing overloads of a data row index (number) or column (object)
  • The behavior.getColumns() and behavior.getActiveColumns() arrays now also serve as column name dictionaries (point to column objects). This makes behavior.columnEnum (which are integers) obsolete (which will be deprecated in v3); if you need to know a column index, you can now ay for a column "per-cent" for example, grid.behavior.getColumns()['per-cent'].index. Names with punctuation are re-added as camel case, including even legal punctuation (_ and $); and names beginning with digit are prefixed with $. Thus, for "per-cent" you can also say grid.behavior.getColumns().perCent.index.
  • Column properties are now picked up from column schema on column create
    • This has advantages over declaring column properties in grid state object.
    • **column.addProperties(newProps) — new method doesn't clear existing props first.
    • The demo shows how props can now come from schema as well as from state object (column 'height' has a prop coming each source).
  • Load state (setState) adjustments:
    • behavior.clearState() now clears columns' state as well.
    • grid.addState(state) and behavior.addState(state) — new methods that do not call clearState before applying state.
    • state.columnProperties (column array) can now be an object (with indexes as keys) as well as an array, which makes for easier sparse array JSON strings. Because this object competes with state.columns (column collection by name), it is now always blacklisted by grid.saveState (so only columns is output).
  • grid.reindex() — Similar to repaint(), behaviorChanged, et al, this method can now be called repeatedly within a thread but will only ever be executed one time before the next render.
  • Assigning a value of undefined with the various set property methods now deletes the property from the properties object, revealing the underlying value from the prototype.
  • Row properties objects now have the grid properties object as their prototype (similar to column properties objects).
  • Registry.js has been simplified.
    • It no longer cares what kind of item is being registered.
    • It no longer has the ability to instantiate singletons from a constructor item.
    • It no longer supports global registries; all registries are now private.
  • CellEvent's row property support has been improved to be subgrid-aware. (This was an oversight.)
  • getActiveColumnIndex(columnOrIndexOrName: (object|number|string)) — The string overload is new and accepts a column name.

…heck those instead of checkboxOnlyRowSelections; removed region selections after reindex
@joneit
Copy link
Contributor Author

joneit commented Mar 16, 2018

@Dwaynekj @dcchuck @neilslinger Will be publishing these v2 fixes as 2.1.6 at EOD today if no questions or objections. Thanks to @nmichaud for consuming/testing! J.

@@ -721,50 +725,73 @@ var JSON = DataModel.extend('dataModels.JSON', {
* @this {dataModels.JSON}
* @memberOf dataModels.JSON~
*/
function getUnderlyingIndexesOfSelectedRows() {
var sourceIndexes = [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a deprecation warning for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Inner" function (not exposed)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh sorry, I should have expanded the view

@Dwaynekj
Copy link
Contributor

How do we reproduce
Fixed single-column-after-fixed-column(s) render issue

@joneit
Copy link
Contributor Author

joneit commented Mar 16, 2018

@Dwaynekj Umm.... just what it says: When there is only one column after one or more fixed columns. So in the demo, we already have 1 fixed column, so just reduce the the total number of columns to 2 so that there is only one column after the fixed column, and you will see the renderer start to throw errors and it hangs:

grid.properties.columnIndexes = grid.properties.columnIndexes.slice(0, 2);

(You cannot use .length = 2 here because the columnIndexes array is generated by a getter. Interesting idea, though: We could override length on the return value to be another getter/setter.... hmmm!)

@joneit joneit force-pushed the v2.1 branch 4 times, most recently from 008adee to b21d897 Compare March 20, 2018 16:53
@@ -889,6 +910,10 @@ var Hypergrid = Base.extend('Hypergrid', {
* Called from renderer/index.js
*/
deferredBehaviorChange: function() {
if (this.needsReindex) {
this.behavior.reindex();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @joneit Can you explain what this feature is for?

Dwaynekj
Dwaynekj previously approved these changes Mar 20, 2018
@joneit
Copy link
Contributor Author

joneit commented Mar 21, 2018

Hey @Dwaynekj deferredBehaviorChange makes beahviorShapeChanged, behaviorStateChanged, and reindex (synonym applyAnalytics) flag-bassed, to be executed once only at next render, rather than immediately. This means that these routines, like repaint(), can now be called repeatedly within a thread but will only ever be executed one time before the next render.

@joneit
Copy link
Contributor Author

joneit commented Mar 21, 2018

I'm delaying 2.1.6 release for further testing. The last commit introduced a bug. I will either withdraw it or re-do it. Should be done today though.....

@joneit
Copy link
Contributor Author

joneit commented Mar 21, 2018

2.1.6 looks good now.

@joneit joneit merged commit e99df2d into fin-hypergrid:develop Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants