blob: 45f9f1f4aa6bc8a482a9dd4f44ab9b254ae2c84b [file] [log] [blame]
<?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.
-->
<!--
A very simple DataGrid example.
The ArrayCollection is the list of dataProvider items, one per DataGrid row and the DataGrid
automatically creates one column for each property in the first item. The dataProvider
property tag isn't specified because it's the default property and leaving it out makes the code
just a little simpler looking. Although any class that implements IList can be used an a
dataProvder, ArrayCollection is convenient because it enables the column sorting support.
We've used the s:DataItem class to create data items for this example although in this case
fx:Object would have worked equally well, because the example doesn't rely on data item
property bindings. DataItem is used to define an untyped Object whose properties are bindable.
-->
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark">
<s:Panel title="Spark DataGrid Control Example of a very simple DataGrid"
width="75%" height="75%"
horizontalCenter="0" verticalCenter="0">
<s:DataGrid id="dataGrid" requestedRowCount="5" verticalCenter="0" horizontalCenter="0">
<s:ArrayCollection>
<s:DataItem key="1000" name="Abrasive" price="100.11" call="false"/>
<s:DataItem key="1001" name="Brush" price="110.01" call="true"/>
<s:DataItem key="1002" name="Clamp" price="120.02" call="false"/>
<s:DataItem key="1003" name="Drill" price="130.03" call="true"/>
<s:DataItem key="1004" name="Epoxy" price="140.04" call="false"/>
<s:DataItem key="1005" name="File" price="150.05" call="true"/>
<s:DataItem key="1006" name="Gouge" price="160.06" call="false"/>
<s:DataItem key="1007" name="Hook" price="170.07" call="true"/>
<s:DataItem key="1008" name="Ink" price="180.08" call="false"/>
<s:DataItem key="1009" name="Jack" price="190.09" call="true"/>
</s:ArrayCollection>
</s:DataGrid>
</s:Panel>
</s:Application>