Load Date range data from XML : XML data « Data Model « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Data Model » XML dataScreenshots 
Load Date range data from XML
Load Date range data from XML
           

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        

        public function displayDates():void {
            var dateRanges:Array = [];
            for (var i:int=0; i<shows.show.length(); i++) {
                var cDate:Date = new Date(shows.show[i].showDate.toString());
                var cDateObject:Object = {rangeStart:cDate, rangeEnd:cDate};
                dateRanges.push(cDateObject);
            }
            dc1.selectedRanges = dateRanges;
        }
      
    </mx:Script>
    <mx:XML id="shows" format="e4x">
        <data>
            <show>
                <showID>1</showID>
                <showDate>02/12/2010</showDate>
                <showTime>10:45am/11:15am</showTime>
            </show>
            <show>
                <showID>2</showID>
                <showDate>02/23/2010</showDate>
                <showTime>7:00pm</showTime>
            </show>
        </data>
    </mx:XML>
    <mx:DateChooser id="dc1" showToday="false" creationComplete="displayDates()" />
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Displaying hierarchical XML dataDisplaying hierarchical XML data
2.Declare XML variableDeclare XML variable
3.Using the XML component to embed XML
4.Using the XML class to embed XML
5.Using XML class's static propertiesUsing XML class's static properties
6.Using the source property to filter and bind to XML data
7.Populating XML by binding external dataPopulating XML by binding external data
8.XML used for E4X examples
9.Looping over an XML structure using its indexLooping over an XML structure using its index
10.Looping over an XML fragmentLooping over an XML fragment
11.Adding a child XML node at the endAdding a child XML node at the end
12.For each variable from xml dataFor each variable from xml data
13.Use XMListCollection removeItemAt() method to remove the itemUse XMListCollection removeItemAt() method to remove the item
14.Use URLLoader to load XML data from server
15.Construct XML data from returning result from service call
16.Load XML data from server with URLLoader
17.Use reference XML data element and attributeUse reference XML data element and attribute
18.An data model with binding destinations in curly bracesAn <mx:XML> data model with binding destinations in curly braces
19.Define data Model structure with xml
20.Reference attribute value in XML modelReference attribute value in XML model
21.Set the value of the format attribute of the tag to xml
22.Model with a simple XML structure
23.XML data
24.Get value from XML data by using namespaceGet value from XML data by using namespace
25.Get XML from PhpGet XML from Php
26.Navigate an XML Document in E4X
27.Encode an ActionScript Data Object as XML
28.Populate a Component with Complex XML Data
29.Binding XML to ListBinding XML to List
30.Binding XML data to LabelBinding XML data to Label
31.External XML File
32.Bind to Properties on XML by Using E4XBind to Properties on XML by Using E4X
33.Use XPath to get data
34.Use Regular Expressions in E4X Queries
35.Looping over nodes as keysLooping over nodes as keys
36.Inserting a node after an existing one
37.Using || (or) notationUsing || (or) notation
38.Reference Repeated ComponentsReference Repeated Components
39.Referene Repeated Child ComponentsReferene Repeated Child Components
40.Reference Nested ComponentsReference Nested Components
41.Adding and removing leaf nodes at run timeAdding and removing leaf nodes at run time
42.namespace variablenamespace variable
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.