Skip to content

Fix for FLEX-33774 #7

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
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
26 changes: 25 additions & 1 deletion frameworks/projects/spark/src/spark/components/Grid.as
Original file line number Diff line number Diff line change
Expand Up @@ -3521,6 +3521,10 @@ public class Grid extends Group implements IDataGridElement, IDataProviderEnhanc
if (invalidatePropertiesFlag)
UIComponentGlobals.layoutManager.validateClient(this, false);

var firstCell:CellPosition = null;
if (valueCopy.length > 0)
firstCell = valueCopy[0] as CellPosition;

gridSelection.removeAll();
for each (var cell:CellPosition in valueCopy)
{
Expand All @@ -3529,6 +3533,12 @@ public class Grid extends Group implements IDataGridElement, IDataProviderEnhanc

doFinalizeSetSelection(cell ? cell.rowIndex : -1,
cell ? cell.columnIndex : -1);

if (firstCell != null)
{
anchorRowIndex = firstCell.rowIndex;
anchorColumnIndex = firstCell.columnIndex;
}
}

/**
Expand All @@ -3542,6 +3552,10 @@ public class Grid extends Group implements IDataGridElement, IDataProviderEnhanc
if (invalidatePropertiesFlag)
UIComponentGlobals.layoutManager.validateClient(this, false);

var firstRowIndex:int = -1;
if (valueCopy.length > 0)
firstRowIndex = valueCopy[0] as int;

var newRowIndex:int = -1;
gridSelection.removeAll();
for each (newRowIndex in valueCopy)
Expand All @@ -3550,6 +3564,9 @@ public class Grid extends Group implements IDataGridElement, IDataProviderEnhanc
}

doFinalizeSetSelection(newRowIndex, -1);

if (firstRowIndex >= 0)
anchorRowIndex = firstRowIndex;
}

/**
Expand All @@ -3566,6 +3583,10 @@ public class Grid extends Group implements IDataGridElement, IDataProviderEnhanc
if (invalidatePropertiesFlag)
UIComponentGlobals.layoutManager.validateClient(this, false);

var firstRowIndex:int = -1;
if (valueCopy.length > 0)
firstRowIndex = dataProvider.getItemIndex(valueCopy[0]);

var newRowIndex:int = -1;
gridSelection.removeAll();
for each (var item:Object in valueCopy)
Expand All @@ -3575,6 +3596,9 @@ public class Grid extends Group implements IDataGridElement, IDataProviderEnhanc
}

doFinalizeSetSelection(newRowIndex, -1);

if (firstRowIndex >= 0)
anchorRowIndex = firstRowIndex;
}

/**
Expand Down Expand Up @@ -5920,4 +5944,4 @@ public class Grid extends Group implements IDataGridElement, IDataProviderEnhanc
}
}
}
}
}