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

Hypergrid 3.0.2 #742

Merged
merged 9 commits into from
Aug 29, 2018
Merged

Hypergrid 3.0.2 #742

merged 9 commits into from
Aug 29, 2018

Conversation

joneit
Copy link
Contributor

@joneit joneit commented Jul 26, 2018

Synopsis

  1. Regression when no data rows (Issue Regression when no data rows #741)
  2. Fix linter errors in columnEnum.js
  3. Avoid throwing error on a mouse event received before columns are created
  4. Testbench demo: Restored regressed help tip "top-level global vars"
  5. DataModel instantiation option now accepts array
  6. Remove finbars.css from <head> section
  7. New column property: resizeColumnInPlace (Issue Column resize behavior - resize only adjacent columns, not entire grid #749)
  8. Fix editOnNextCell feature (Issue Regression: editOnNextCell broken #745)
  9. Avoid throwing error when dragging a column and column(s) selected (Issue Dragging column when column(s) selected throws error #751)

1. Regression when no data rows (Issue #741)

Solution was to properly handle edge cases in grid.renderer.paintGridLines:

  • No data rows
  • No header rows

2. Fix linter errors in columnEnum.js

3. Avoid throwing error on a mouse event received before columns are created

This annoying error happened "sometimes" (when the mouse was moved over the grid) during reload.

4. Testbench demo: Restored regressed help tip "top-level global vars"

The commit for this is in the build repo.

5. DataModel instantiation option now accepts array

As a convenience feature, when an array, instantiates a multi-stage data model as a data source stack. Each data source is instantiated in turn, passing the previous stack tip to the next constructor, forming a linked list. Each is data source module is a subclass of datasaur-base, which implements method inheritance on the stack.

Previously: Single-stage data model

var MyDataModel = require('./my-data-model');
var options = { DataModel: MyDataModel };
var grid = new Hypergrid(options); 

Alternatively, the following produces the same result:

var options = { dataModel: new MyDataModel };
var grid = new Hypergrid(options); 

Previously: Multi-stage data model

var dataModel = new (require('datasaur-indexed'))();
dataModel = new (require('datasaur-indexed'))(dataModel);
var grid = new Hypergrid({ dataModel: dataModel }); 

Now, with this enhancement: Multi-stage data model

The following is a short hand for the above

var DataModel = [ require('datasaur-local'), require('datasaur-indexed') ];
var grid = new Hypergrid({ DataModel: DataModel });

6. Remove finbars.css from <head> section

This stylesheet was being completely overridden by the duplicate in the <body> section (which remains).

7. New column property: resizeColumnInPlace (Issue #749)

Resizing a column through the UI (by clicking and dragging on the column's
right border in the column header row) normally affects the width of the whole grid.

Set this new property to truthy to inversely resize the next column.
In other words, if user expands (say) the third column, then the fourth column will contract —
and vice versa — without therefore affecting the width of the grid.

This is a column property and may be set for selected columns (myColumn.properties.resizeColumnInPlace)
or for all columns by setting it at the grid level. (myGrid.properties.resizeColumnInPlace).

Note that the implementation of this property does not allow expanding a
column beyond the width it can borrow from the next column.
The last column, however, is unconstrained and resizing it will affect the total grid width.

8. Fix editOnNextCell feature (Issue #745)

Issue was new cellEvent failed to define its gridCell.y prop.

9. Avoid throwing error when dragging a column and column(s) selected (Issue #751)

Fixed. This was due to improperly clearing existing selections in SelectionModel.prototype.clear.

This commit also blocks dragging column on right-click.

@joneit joneit force-pushed the 3.0.2 branch 2 times, most recently from 7f495f9 to 0546429 Compare August 27, 2018 21:12
@joneit joneit changed the base branch from develop to master August 29, 2018 11:24
@joneit joneit changed the base branch from master to develop August 29, 2018 11:27
@joneit joneit merged commit d7f1c30 into fin-hypergrid:develop Aug 29, 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.

1 participant