| <?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <s:BorderContainer |
| xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:mx="library://ns.adobe.com/flex/mx" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| borderVisible="false" |
| preinitialize="init()"> |
| |
| <fx:Declarations> |
| <s:ArrayCollection id="dp1"> |
| <s:DataItem country="USA" firstName="JozFN" lastName="AltFN" position="FW" club="VilCB" number="00"/> |
| <s:DataItem country="USA" firstName="CarFN" lastName="BocFN" position="DF" club="RenCB" number="01"/> |
| <s:DataItem country="USA" firstName="TimFN" lastName="HowFN" position="GK" club="EveCB" number="02"/> |
| <s:DataItem country="USA" firstName="CliFN" lastName="DemFN" position="MF" club="FulCB" number="03"/> |
| <s:DataItem country="USA" firstName="RobFN" lastName="FinFN" position="FW" club="RslCB" number="04"/> |
| <s:DataItem country="USA" firstName="HerFN" lastName="GomFN" position="FW" club="PacCB" number="05"/> |
| <s:DataItem country="USA" firstName="LanFN" lastName="DonFN" position="MF" club="lagCB" number="06"/> |
| <s:DataItem country="USA" firstName="OguFN" lastName="OnyFN" position="DF" club="MilCB" number="07"/> |
| </s:ArrayCollection> |
| |
| <s:ArrayCollection id="columns1"> |
| <s:GridColumn id="c1_1" dataField="country" /> |
| <s:GridColumn id="c1_2" dataField="firstName" /> |
| <s:GridColumn id="c1_3" dataField="lastName" /> |
| <s:GridColumn id="c1_4" dataField="position"/> |
| <s:GridColumn id="c1_5" dataField="club"/> |
| <s:GridColumn id="c1_6" dataField="number"/> |
| </s:ArrayCollection> |
| </fx:Declarations> |
| |
| <fx:Script> |
| <![CDATA[ |
| [Bindable] |
| private var selInd:Vector.<int> = new Vector.<int>; |
| |
| private function init():void{ |
| selInd[0]=1; |
| selInd[1]=3; |
| } |
| |
| private function showData():void{ |
| lbl.text = dg.selectedIndices.toString(); |
| } |
| ]]> |
| </fx:Script> |
| |
| <s:layout> |
| <s:VerticalLayout/> |
| </s:layout> |
| |
| <s:DataGrid |
| id="dg" |
| requestedMinRowCount="5" |
| dataProvider="{dp1}" |
| columns="{columns1}" |
| selectionMode="multipleRows" |
| selectedIndices="{selInd}" |
| creationComplete="showData()"/> |
| |
| <s:Label id="lbl"/> |
| |
| |
| </s:BorderContainer> |