Actually Ben, you shouldn't have to get the data in the itemRenderer.  The data should be passed to the itemRenderer from the DataGridColumn.  The itemRenderer would look like this:

<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" horizontalAlign="center">
    
 <mx:CheckBox id="cb_planNumber label="{data.PlanNumber}"   selected="{data.PlanNumberSelected}"/>
 
</mx:HBox>

-TH

--- In flexcoders@yahoogroups.com, "Tim Hoff" <[EMAIL PROTECTED]> wrote:
>
>
> Hey Ben,
>
> In addition to setting the label, you have to set the selected property.
>
> var q:QName = new QName(DOCUMENT_METADATA_NAMESPACE, "PlanNumber");
> var r:QName = new QName(DOCUMENT_METADATA_NAMESPACE,
> "PlanNumberSelected");
> cb_planNumber.label = data[q];
> cb_planNumber.selected = data[r];
>
> Depending on your data structure, PlanNumberSelected is the value field
> from the data.
>
> -TH
>
> --- In flexcoders@yahoogroups.com, "ben.clinkinbeard"
> ben.clinkinbeard@ wrote:
> >
> > Hello, I have seen this dicussed on here a bit but nothing seems to be
> > working for me. I have a DataGrid whose dataProvider property is bound
> > to an XMLList. One of the columns, however, uses an itemRenderer to
> > display a checkbox with a label. The label comes from the data item,
> > so this is what my itemRenderer component currently looks like:
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
> > horizontalAlign="center" creationComplete="getLabel()">
> > <mx:Script>
> > <![CDATA[
> > import
> >
> com.fmr.tests.PSA_Cairngorm.business.namespaces.DOCUMENT_METADATA_NAMESP\
> ACE;
> >
> > private function getLabel():void
> > {
> > use namespace DOCUMENT_METADATA_NAMESPACE;
> > var q:QName = new QName(DOCUMENT_METADATA_NAMESPACE, "PlanNumber");
> > cb_planNumber.label = data[q];
> > }
> > ]]>
> > </mx:Script>
> > <mx:CheckBox id="cb_planNumber" />
> > </mx:HBox>
> >
> > The problem is that when the XMLList that is the dataProvider is
> > updated, the checkboxes' labels get updated correctly, but the
> > selected state of the checkboxes does not. So basically I need to
> > capture that event so that I can uncheck all of the checkboxes. A
> > 'labelChanged' event or something similar would be great but doesn't
> > seem to exist. What am I missing here?
> >
> > Thanks in advance,
> > Ben
> >
>

__._,_.___

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





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to