Skip to content

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

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frameworks/projects/spark/src/spark/components/Grid.as
Original file line number Diff line number Diff line change
Expand Up @@ -4396,6 +4396,7 @@ public class Grid extends Group implements IDataGridElement, IDataProviderEnhanc
{
gridLayout.topGridView = topGridView = createGridView();
topGridView.gridViewLayout.verticalScrollingLocked = true;
topGridView.gridViewLayout.horizontalScrollPosition = centerGridView.horizontalScrollPosition;
gridViewsChanged = true;
}

Expand Down Expand Up @@ -4432,6 +4433,7 @@ public class Grid extends Group implements IDataGridElement, IDataProviderEnhanc
{
gridLayout.leftGridView = leftGridView = createGridView();
leftGridView.gridViewLayout.horizontalScrollingLocked = true;
leftGridView.gridViewLayout.verticalScrollPosition = centerGridView.verticalScrollPosition;
gridViewsChanged = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ public class GridViewLayout extends LayoutBase
*/
override public function measure():void
{
const gridView:GridView = target as GridView; // TBD: requestedRowCount should be a local property...
const gridView:GridView = target as GridView;
const grid:Grid = this.grid;

if (!gridView || !grid)
Expand Down Expand Up @@ -1876,10 +1876,12 @@ public class GridViewLayout extends LayoutBase
const gridColumn:GridColumn = getGridColumn(columnIndex);
if (gridColumn)
{
renderer.rowIndex = rowIndex;
renderer.rowIndex = rowIndex + viewRowIndex;
renderer.column = gridColumn;
if (dataItem == null)
dataItem = getDataProviderItem(rowIndex);
rowIndex += viewRowIndex;
columnIndex += viewColumnIndex;

renderer.label = gridColumn.itemToLabel(dataItem);

Expand Down