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

                                                                                                                                                                        {checkBox.selected}

                                                                                                                                                            </mx:Boolean>

                                                                                                                                                            <mx:CheckBox id="checkBox"

                                                                                                                                                                        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: [email protected] [mailto:[email protected]] On Behalf Of Manish Jethani
Sent: Tuesday, February 07, 2006 11:58 AM
To: [email protected]
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