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

Fix issue with Spark Grid scrolling/alignment when using locked columns/rows #46

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

pzahra
Copy link

@pzahra pzahra commented Oct 30, 2017

Contrary to StackOverflow belief, lockedColumnCount and lockedRowCount are usable in the Spark DataGrid, but the item renderer "selected" state is misaligned. Scrollbars are also misaligned when changing dataProvider. This fixes it.

@Harbs
Copy link
Contributor

Harbs commented Oct 31, 2017

Thanks for this. Do you have a small test case that demonstrates the improved behavior?

@pzahra
Copy link
Author

pzahra commented Oct 31, 2017

Sure, I deleted that particular sandbox a while ago but I can describe it. Start with the old s:DataGrid, give it a dataset large enough to give it a nice long pair of scrollbars. Now set a couple of rows and columns to be locked (one column and three rows, I used). You'll need to provide a custom cell renderer like we had that sets its own background using the "selected" state instead of letting the control background show through (we were using this because some cells needed to be different colours and still indicate when they were selected). Run that and select some random cells. Notice that inside the main scrollable area the highlight is offset by the number of rows that are locked (not columns). If you have a second dataset that is smaller, switching to that while the data is scrolled all the way will also misalign the panes.

I created a library to replace it, but since it changed the package names I had to include a bunch of copies of other files just to change the imports. I can provide you with a zip file of that; it's essentially the changeset here (with an added userData property on GridColumn that is unrelated).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants