Hi all,

Any ideas why on scroll of a datagrid the #1010 error is firing from the ListBase class on this line of code: rowMap[r.name].rowIndex = newIndex;

I have seen this problem in the past with Flex 2 and funnily enough have not seen it since, now its rearing its head again. Using the below code (love the comments by the Adobe team) and digging in the debugger I see that r.name (CustomGridRenderer3134) is not showing in list of items on the rowMap hence the error being thrown?

protected function shiftRow(oldIndex:int, newIndex:int, numCols:int, shiftItems:Boolean):void
{
    var r:IListItemRenderer;
    for (var j:int = 0; j < numCols; j++)
    {
        r = listItems[oldIndex][j];
        if (shiftItems)
        {
            listItems[newIndex][j] = r;
            rowMap[r.name].rowIndex = newIndex;
        }
        // this is sort of a hack to accomodate the fact that
        // scrolling down does a splice which throws off these values.
        // probably better to call shiftRow with different parameters?
        else
            rowMap[r.name].rowIndex = oldIndex;
    }
    if (shiftItems)
        rowInfo[newIndex] = rowInfo[oldIndex];
}

Cheers, Simon

Reply via email to