Yeah, you would need to create an xml file in a data folder and then
insert this text:

<?xml version="1.0" encoding="utf-8"?>

<catalog>
    <product productId="1">
        <name>t-shirt</name>
        <price>1.50</price>
        <brand>false</brand>
    </product>
    <product productId="2">
        <name>polo</name>
        <price>2.00</price>
        <brand>true</brand>
    </product>
    <product productId="3">
        <name>sweater</name>
        <price>2.50</price>
        <brand>false</brand>
    </product>
    <product productId="4">
        <name>car</name>
        <price>3.00</price>
        <brand>false</brand>
    </product>
    <product productId="5">
        <name>truck</name>
        <price>3.50</price>
        <brand>false</brand>
    </product>
</catalog>


Thanks for taking a look at my problem, let me know if there are any
other problems and what I can do to solve this obstacle.

Sal

--- In [email protected], "b_alen" <[EMAIL PROTECTED]> wrote:
>
> The example that you pasted contains errors and there's no XML
> provided. Please send a compilable simplified example. Btw, I'm using
> E4X by just loading XML with URLLoader and then typing the result as
> XML. It's brilliant. 
> 
> Alen
> 
> 
> --- In [email protected], "emobilecat" <emobilecat@> wrote:
> >
> > Hello everyone, I am trying to select checkboxes in a datagrid where
> > needed. In addition, when the user clicks on the name the checkbox on
> > the side will be selected depending on the xml tag is set to true or
> > false.  I am having trouble because I am not familiar with how to
> > handle xml when converted to e4x format in my HTTPService on which I
> > call the datagrid's data through an XMLListCollection.  Could someone
> > please guide me in the right direction?  Below is what I've coded so
> > far, not too difficult.
> > 
> > Thank You
> > Sal
> > 
> > 
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> > layout="vertical" creationComplete="init()">
> >     
> >     <mx:Script>
> >             <![CDATA[
> >                     public function init():void{
> >                             catalog.send();
> >                     }
> >             ]]>
> >     </mx:Script>
> >     
> >     <mx:HTTPService id="catalog" url="data/catalog.xml" useProxy="false" 
> >             result="(catalog.lastResult.catalog.product)" 
> > resultFormat="e4x"/>
> >             
> >     <mx:XMLListCollection id="xlc"
source="{catalog.lastResult.product}"/>
> >     
> >     <mx:HBox>
> >             <mx:CheckBox selected="{grid.selectedItem.brand}" label="In 
> > Stock"/>
> >             
> >             <mx:Panel width="100%" height="100%" title="Part Numbers">
> >             <mx:DataGrid id="grid" width="100%" height="100%"
showHeaders="false"
> >                     dataProvider="{xlc}" textAlign="center">
> >                     <mx:columns>
> >                             <mx:DataGridColumn>
> >                                     <mx:itemRenderer>
> >                                             <mx:Component>
> >                                                     <mx:Canvas>
> >                                                             <mx:LinkButton 
> > label="{data.name}"/>
> >                                                     </mx:Canvas>
> >                                             </mx:Component>
> >                                     </mx:itemRenderer>
> >                             </mx:DataGridColumn>
> >                             <mx:DataGridColumn>
> >                                     <mx:itemRenderer>
> >                                             <mx:Component>
> >                                                     <mx:Canvas>
> >                                                             <mx:CheckBox 
> > selected="{data.brand}" label="On Sale"/>
> >                                                     </mx:Canvas>
> >                                             </mx:Component>
> >                                     </mx:itemRenderer>
> >                             </mx:DataGridColumn>
> >                     </mx:columns>
> >             </mx:DataGrid>          
> >     </mx:Panel>
> >     </mx:HBox>
> > </mx:Application>
> >
>


Reply via email to