<mx:DataGridColumn headerText="序号" width="70" minWidth="70">
<mx:itemRenderer>
<mx:Component>
<mx:Label text="{this.parentDocument.genrowno(data)}"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
public function genrowno(ob:Object):String {
ob.sID=String(alarm_rule_action_detail_dg.dataProvider.getItemIndex(ob)+1);
return String(alarm_rule_action_detail_dg.dataProvider.getItemIndex(ob)+1);
}
本文介绍了一个使用Flex(Flex SDK)自动生成表格序号的方法。通过一个公共函数genrowno,可以为每一项数据生成唯一的序号,并显示在DataGridColumn中。此方法适用于需要在Flex应用中动态生成列表序号的情况。
1963

被折叠的 条评论
为什么被折叠?



