datagrid第一行序列

   <!--序列-->
               <mx:DataGridColumn minWidth="20" width="40" sortable="false" headerText="序号">
				<mx:itemRenderer>
	            <mx:Component>
	                  <mx:DataGridItemRenderer >
	                  <mx:Script>
	                  <![CDATA[
	                  		import mx.collections.IList;
	                        import mx.controls.dataGridClasses.DataGridListData;
	                        import mx.controls.DataGrid;
	                        override public function set data(value:Object):void{
	                              super.data = value;
	                              var dgListData:DataGridListData = listData as DataGridListData;
	                              var dgList:DataGrid = dgListData.owner as DataGrid;
	                              var arr:IList = dgList.dataProvider as IList;
	                              dgListData.label = arr==null?"":""+arr.getItemIndex(value);
	                              dgListData.label = (dgListData.rowIndex+1).toString();
	                              
							}
	                  ]]>
	                  </mx:Script>
	                  </mx:DataGridItemRenderer>
	            </mx:Component>
	            </mx:itemRenderer>
            </mx:DataGridColumn>

你可能感兴趣的:(java)