Skip to content
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
}
}
}
}
}