I'm stuck! I can't get an inline renderer for DataGridColumn to work with an XML data provider, even though it works just fine for an Array data providerPlease see the example code.
 
Thanks in advance!
Jeff
 
 
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" height="350" width="250">
   
    <mx:Script>
        <![CDATA[
               
            [Bindable]
            public var myTestArray:Array =                 [
                    {label1:"/home", Test:true},
                    {label1:"/bin", Test:false}];
        ]]>
    </mx:Script>
 
 <mx:XMLListCollection id="myTestXML">
  <mx:XMLList xmlns="">
   <partition label="C:\\" Test="true"/>
   <partition label="D:\\" Test="false"/>
  </mx:XMLList>
 </mx:XMLListCollection>
 
 <!-- This works just fine with an Array data provider -->
 <mx:DataGrid dataProvider="{myTestArray}" width="200" height="100" editable="true">
  <mx:columns>
   <mx:DataGridColumn headerText="myTestArray" dataField="Test" rendererIsEditor="true" editorDataField="selected">
    <mx:itemRenderer>
     <mx:Component>
      <mx:CheckBox selected="{data.Test}" label="{data.label1}"/>
     </mx:Component>
    </mx:itemRenderer>
   </mx:DataGridColumn>
  </mx:columns>
 </mx:DataGrid>
 
 <!-- Why doesn't this work with an XML data provider? -->
 <!-- What are my options for getting it to work with the XML data provider? -->
 <!-- I'd prefer a solution that is similar to the current code "framework" I've got. -->
 <mx:DataGrid dataProvider="{myTestXML}" width="200" height="100" editable="true">
  <mx:columns>
   <mx:DataGridColumn headerText="myTestXML" dataField="@Test" rendererIsEditor="true" editorDataField="selected">
    <mx:itemRenderer>
     <mx:Component>
      <mx:CheckBox selected="{data.Test}" label="{data.label1}"/>
     </mx:Component>
    </mx:itemRenderer>
   </mx:DataGridColumn>
  </mx:columns>
 </mx:DataGrid>
</mx:Application>
__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





YAHOO! GROUPS LINKS




__,_._,___

Reply via email to