Apache flex 如何在flex数据网格中自动增加序列号?

Apache flex 如何在flex数据网格中自动增加序列号?,apache-flex,Apache Flex,我在Datacolumn一节中这样声明了如何写自动递增序列号?我相信你的观点是错误的。DataGridColumn是现有数据的可视化表示。如何填充DataGrid.dataProvider将决定如何自动生成序列我的问题私有函数sortSerial(oItem:Object,iCol:int)得到了答案:int{var iIndex:int=ac.getItemIndex(oItem)+1;return int(iIndex);}因此通常不赞成只使用代码的答案。请考虑更新你的答案来解释这是如何解决

我在Datacolumn一节中这样声明了如何写自动递增序列号?

我相信你的观点是错误的。
DataGridColumn
是现有数据的可视化表示。如何填充
DataGrid.dataProvider
将决定如何自动生成序列我的问题私有函数sortSerial(oItem:Object,iCol:int)得到了答案:int{var iIndex:int=ac.getItemIndex(oItem)+1;return int(iIndex);}因此通常不赞成只使用代码的答案。请考虑更新你的答案来解释这是如何解决你的问题的。
<mx:DataGridColumn labelFunction="sortSerial" headerText="Sl no" />
  private function sortSerial(oItem:Object,iCol:int):int
        {
            var iIndex:int = ac.getItemIndex(oItem) + 1;
            return int(iIndex);
        }