Does sound like a bug I guess, probably the dataObject is being reset when you click on the row and that’s overriding the click behavior on the checkbox.  Try overriding set dataObject and see if it’s getting called a little too often.  If so you can maybe react in there and just update the selected checkbox manually instead of through binding?  Or some other workaround might appear if you figure out how to predict the double behavior.

 

And please get a bug filed.

 

Matt

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Jonathan Miranda
Sent: Wednesday, February 08, 2006 7:39 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] New Inline cell renderers

 

Sorry to shamelessly bump this, but can anyone think of a “fix” solution for this since it seems to be a bug? If the CheckBox is tied to something actually in the dataProvider, it takes 2 clicks (one for row focus, one to click the box) to change even though I’m using a “isCellEditor” and not an editorClass (if I change dataObject.compare to dataObject.somevar, it works…but then doesn’t save the state obviously for sorting/scrolling the datagrid). I’m trying right now to work with the “change” function of the Datagrid, seeing if the mouse position is in the correct column then toggling the checkbox, but then I can’t figure out how to disable the checkbox so it doesn’t double toggle.

Ideas for a fix for this?

 

_________________________________________

Jonathan Miranda

Flexible Master of the Web

"In the game of chess, it's important to never let your opponent see your pieces."

 

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Jonathan Miranda
Sent: Tuesday, February 07, 2006 12:09 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] New Inline cell renderers

 

This may be right in theory, but not in practice. Try this out – in the dataProvider is a field called “compare” that is always false. Everything takes 2 clicks.

<mx:DataGrid editable="true" width="100%" height="80%" id="resultsDG" dataProvider="{searchService.result.hospitals.hospital}">

                                                                <mx:columns>

                                                                    <mx:Array> 

                                                                        <mx:DataGridColumn textAlign="center" columnName="compare" headerText="Compare" width="75" isCellEditor="true" editorProperty="selected">

                                                                                    <mx:cellRenderer>

                                                                                                                                    <mx:Component>

                                                                                                                                                <mx:HBox horizontalAlign="center">

                                                                                                                                                            <mx:Boolean id="selected">

                                                                                                                                                               &nbs p;        {checkBox.selected}

                                                                                                                                                            </mx:Boolean>

                                                                                                                                                            <mx:CheckBox id="checkBox"

                                                                                                                                                               &nbs p;        selected="{dataObject.compare}" />

                                                                                                                                                </mx:HBox>

                                                                                                                                    </mx:Component>

                                                                                                                        </mx:cellRenderer>       

                                                                        </mx:DataGridColumn>

                                                                        <mx:DataGridColumn editable="false" textAlign="center" cellRenderer="nameRenderer" columnName="name" headerText="Hospital Name"/>

                                                                        <mx:DataGridColumn editable="false" textAlign="center" columnName="distance" headerText="Distance" width="100" id="distance"/>

                                                                        <mx:DataGridColumn editable="false" textAlign="center" cellRenderer="swfRenderer" columnName="quality" headerText="Quality" width="100"/>

                                                                    </mx:Array>

                                                                </mx:columns>        

                                                            </mx:DataGrid>

 

 

_________________________________________

Jonathan Miranda

Flexible Master of the Web

"In the game of chess, it's important to never let your opponent see your pieces."

 

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Manish Jethani
Sent: Tuesday, February 07, 2006 11:58 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] New Inline cell renderers

 

On 2/7/06, Jonathan Miranda <[EMAIL PROTECTED]> wrote:
> Awesome man, thanks - saved me an hour of banging my head on the table.
> I've no clue why your example and mine cause a different amount of
> clicks needed though.

If you use "editorClass", it needs two clicks - one for activating the
cell editor and one for selecting the CheckBox.  If you use
"cellRenderer" and set "isCellEditor" to true, it needs only one click
(because the cell editor and the cell renderer are one and the same,
so there's no need for activation).





--
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