为DataGrid提供一个ComboBox类型的ItemRenderer,如下图:

取得组件在父容器中的索引_flex 但是在点击ComboBox的时候取不到DataGrid当前的selectedIndex,不能实现需要的功能。

利用下面代码可取得当前项在DataGrid的dataProvider中的索引。

 

  1. var itemIndex:int = ArrayCollection((owner as DataGrid).dataProvider).getItemIndex(_ownerData);