| <?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:Application xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| xmlns:mx="library://ns.adobe.com/flex/mx" |
| minWidth="955" minHeight="600"> |
| <!-- Sample program for spark.collections.Sort and SortField --> |
| <fx:Declarations> |
| <s:Sort id="sortbyLastName_FirstName"> |
| <s:fields> |
| <s:SortField name="last"/> |
| <s:SortField name="first"/> |
| </s:fields> |
| </s:Sort> |
| <mx:ArrayCollection id="collection" sort="{sortbyLastName_FirstName}"> |
| <mx:source> |
| <fx:Object first="Anders" last="Dickerson"/> |
| <fx:Object first="Eileen" last="Maccormick"/> |
| <fx:Object first="Aiden" last="MacCormick"/> |
| <fx:Object first="Steve" last="MacGregor"/> |
| </mx:source> |
| </mx:ArrayCollection> |
| </fx:Declarations> |
| |
| <s:VGroup> |
| <s:VGroup> |
| <s:HGroup> |
| <s:Label text="Input Locale ID Name: "/> |
| <s:TextInput id="inputLocaleIDName"/> |
| <!-- |
| Sets the locale style on the document UI component. |
| The SortField and Sort objects defined in the |
| fx:Declarations section will inherit this style. |
| --> |
| <s:Button click="{setStyle('locale', inputLocaleIDName.text); |
| collection.refresh()}" label="Apply"/> |
| </s:HGroup> |
| <s:Label text="Example: 'en-US', 'fr-FR', 'zh-CN', 'ar-SA'"/> |
| </s:VGroup> |
| <s:DataGrid dataProvider="{collection}" width="100%" |
| creationComplete="{collection.refresh()}"> |
| <s:columns> |
| <s:ArrayList> |
| <s:GridColumn dataField="last"/> |
| <s:GridColumn dataField="first"/> |
| </s:ArrayList> |
| </s:columns> |
| </s:DataGrid> |
| </s:VGroup> |
| </s:Application> |