And as soon as I say that, I get another
problem.
Scrolling down the datagrid randomnly checks and unchecks the boxes.
_________________________________________
Jonathan Miranda
Flexible Master of the Web
"In the
game of chess, it's important to never let your opponent see your pieces."
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.
_________________________________________
Jonathan Miranda
Flexible Master of the Web
"In the game of chess, it's important to
never let your opponent see
your pieces."
-----Original Message-----
From: [email protected]
[mailto:[email protected]]
On
Behalf Of Manish Jethani
Sent: Tuesday, February 07, 2006 11:23 AM
To: [email protected]
Subject: Re: [flexcoders] New Inline cell
renderers
On 2/7/06, Jonathan Miranda
<[EMAIL PROTECTED]> wrote:
> Well I'm closer but no cigar yet. I can get
the dataProvider to update
with the checkbox click, but each checkbox click requires
2 clicks! One
to get focus in the box and one to actually change
the checkbox...
There are two ways to set an editor: (1) the
"editorClass" property,
and (2) the "cellRenderer" and
"isCellEditor" properties. In the
latter case, the cell renderer is also the cell
editor (like your
CheckBox).
You don't have to use an inline cell renderer if
all you need is a
simple CheckBox.
<?xml version="1.0"
encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml"
xmlns="*"
layout="vertical">
<mx:Array id="array">
<mx:Object
Name="Item 1" Selected="false" />
<mx:Object
Name="Item 2" Selected="true"
/>
</mx:Array>
<mx:DataGrid dataProvider="{array}"
editable="true">
<mx:columns>
<mx:DataGridColumn
columnName="Name" />
<mx:DataGridColumn
columnName="Selected"
cellRenderer="mx.controls.CheckBox"
isCellEditor="true"
editorProperty="selected" />
</mx:columns>
</mx:DataGrid>
</mx:Application>
>and I can't figure out how to center the
Checkbox now since it's not
in an HBox anymore.
Same example above with an inline cell renderer
based on HBox:
<mx:cellRenderer>
<mx:Component>
<mx:HBox
horizontalAlign="center">
<mx:Boolean
id="selected">
{checkBox.selected}
</mx:Boolean>
<mx:CheckBox
id="checkBox"
selected="{dataObject.Selected}" />
</mx:HBox>
</mx:Component>
</mx:cellRenderer>
--
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
--
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
YAHOO! GROUPS LINKS