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

Enalbling frozenColumn disables cell range selection #336

Closed
BillyGeat opened this issue Feb 7, 2019 · 6 comments · Fixed by #337
Closed

Enalbling frozenColumn disables cell range selection #336

BillyGeat opened this issue Feb 7, 2019 · 6 comments · Fixed by #337

Comments

@BillyGeat
Copy link

BillyGeat commented Feb 7, 2019

As stated here #26 (comment) enabling frozen columns should make also cell range selection working (again).
But I tried a simple example where cell range selection works until I activate frozenColumn. Then it selects only one the first cell clicked and does not select the other (dragged over).

I have also created a detailed StackOverflow post with an jsfiddle example here: https://stackoverflow.com/questions/54574757/enalbling-frozencolumn-disables-cell-range-selection

EDIT / UPDATE
Maybe important info: I just updated my local copy of the repository and now, if I drag to select cells with frozenColumns activated, I get an error:

slick.cellrangedecorator.js:51 Uncaught TypeError: Cannot read property 'top' of null
at CellRangeDecorator.show (slick.cellrangedecorator.js:51)
at SlickGrid.handleDragStart (slick.cellrangeselector.js:115)
at Event.notify (slick.core.js:147)
at trigger (slick.grid.js:2029)
at HTMLDivElement.handleDragStart (slick.grid.js:3854)
at HTMLDivElement.dispatch (jquery-1.11.2.min.js:3)
at HTMLDivElement.$event.dispatch (jquery.event.drag-2.3.0.js:382)
at HTMLDivElement. (jquery.event.drag-2.3.0.js:267)
at Function.each (jquery-1.11.2.min.js:2)
at m.fn.init.each (jquery-1.11.2.min.js:2)

@ghiscoding
Copy link
Collaborator

Can you please use latest code, PR #331 got merged yesterday to fix a cell range issue (#329) with frozen grids (with slick.cellrangeselector.js). Also note that I know you're not using latest code because the line 51 is a curly brace and so it cannot be an error with Cannot read property 'top' of null as you mentioned

@BillyGeat
Copy link
Author

I am pretty sure, that right now, I have the latest version of the code base...
A curly brace you mention exist in file slick.cellrangeselector.js but the error I got comes from slick.cellrangedecorator.js and there is a "top" property in my copy. Maybe I miss something else?

@ghiscoding
Copy link
Collaborator

Actually the error came from the slick.cellrangedecorator.js while I thought it was the slick.cellrangeselector.js. On the other end, the yesterday PR might have introduced a small issue, it doesn't seem to work when you specify only 1 frozen (column or row). So basically if you add frozenRow: 0 as a temporary patch, that will work... so I'll look into fixing this sometime today but for now you can use the hack I just mentioned

@ghiscoding
Copy link
Collaborator

Found the issue, the new PR has 2 new variables which were not initialized causing NaN to show up in the slick.cellrangedecorator.js because that was not a valid number.

Can you please try again, I fixed and merged the code

@BillyGeat
Copy link
Author

BillyGeat commented Feb 7, 2019

Yes, both issues are now fixed, great! Works without the "frozenRow" workaround and I do not get the JS error in the console anymore (it was driving me crazy, why it worked in my jsfiddle (where scrollbars were visible) and not in my local development version (where I had only horizontal scrolling or no at all).
Thank you!

@ghiscoding
Copy link
Collaborator

ghiscoding commented Feb 7, 2019

Good thanks for the feedback 😉

Also note that we'll be releasing a new version on NPM in the coming days, we were just waiting to see if anything came up with latest PRs... and you found an issue, so thanks for reporting :)

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 a pull request may close this issue.

2 participants