Yes, I think “data.isSelected=cb.selected” is the key.

 

You absolutely must update the dataProvider for the checkboxes to work correctly.  The list controls re-use the visual elements when you scroll.

 

Perhaps modifying your original code to the below might work.

<mx:Binding source="checkbox.selected" destination=" data.isSelected "/>

 

Tracy

 

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of John Zhao
Sent: Thursday, November 02, 2006 11:42 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Checkbox in Datagrid - checks disappear when scrolling

 

Try this as the ItemRenderer instead.

 

<mx:Component className="inlineCB">
                  <mx:HBox horizontalAlign="center" backgroundAlpha="100"  >
                   <mx:Script>
                    <![CDATA[
                     public var selected:Boolean;
                    ]]>
                   </mx:Script>                  
                   <mx:CheckBox id="cb" selected="{data.isSelected}"  click="selected=data.isSelected=cb.selected;"  />
                  </mx:HBox>
                  </mx:Component>

 

-John


From: [EMAIL PROTECTED]ups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of app.developer
Sent: Thursday, November 02, 2006 10:53 AM
To: [EMAIL PROTECTED]ups.com
Subject: [flexcoders] Checkbox in Datagrid - checks disappear when scrolling

If I use

<mx:Component id="inlineEditor">

<mx:Canvas width="100%" height="100%">
<mx:Script>
<![CDATA[
public var value:uint;
]]>
</mx:Script>
<mx:CheckBox id="checkbox" selected="{Boolean(data.isSelected)}"
horizontalCenter="0" verticalCenter="0"/>
<mx:Binding source="checkbox.selected" destination="value"/>
</mx:Canvas>

</mx:Component>

....for the DataGridColumn....

<mx:DataGridColumn dataField="isSelected" rendererIsEditor="true"
editorDataField="value" textAlign="center"
itemRenderer="{inlineEditor}"/>

....the selected checkboxes are not selected if a scroll through the
dataGrid. Has anyone had this problem and solved it?

Precia

__._,_.___

--
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
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to