Hi All,
I am having trouble to set item renders (checkBox and comp InputText) in my
Advanced Datagrid.
Code Example:
<mx:AdvancedDataGrid id="contract_dg" width="100%" height="100%"
editable="true"
resizableColumns="false"
sortExpertMode="true">
<mx:columns>
<mx:AdvancedDataGridColumn headerText="Product ID"
dataField="productID"
width="0" visible="false" />
<mx:AdvancedDataGridColumn headerText="Description"
dataField="productName" width="150" editable="false" />
<mx:AdvancedDataGridColumn headerText="JAN"
dataField="jan" width="30"
textAlign="center" editable="false">
<mx:itemRenderer>
<fx:Component>
<mx:CheckBox
selected="{data.jan}" click="data.jan=!data.jan" />
</fx:Component>
</mx:itemRenderer>
</mx:AdvancedDataGridColumn>
<mx:AdvancedDataGridColumn headerText="FEB"
dataField="feb" width="30"
textAlign="center" editable="false">
<mx:itemRenderer>
<fx:Component>
<mx:CheckBox
selected="{data.feb}" click="data.feb=!data.feb" />
</fx:Component>
</mx:itemRenderer>
</mx:AdvancedDataGridColumn>
<mx:AdvancedDataGridColumn headerText="Price"
dataField="price"
width="60" rendererIsEditor="true" editorDataField="realValue" >
<mx:itemRenderer>
<fx:Component>
<com:NumberInput
decimalPlaces="2" allowNegative="no"
realValue="{data.price}"/>
</fx:Component>
</mx:itemRenderer>
</mx:AdvancedDataGridColumn>
</mx:columns>
</mx:AdvancedDataGrid>
I am receiving this message in the debugger for the checkBox:
warning: unable to bind to property 'jan' on class 'Object' (class is not an
IEventDispatcher)
warning: unable to bind to property 'feb' on class 'Object' (class is not an
IEventDispatcher)
The same for the price column:
warning: unable to bind to property 'price' on class 'Object' (class is not
an IEventDispatcher)
The com.NumberInput component is:
<?xml version="1.0" encoding="utf-8"?>
<mx:TextInput xmlns:mx="http://www.adobe.com/2006/mxml" textAlign="right"
creationComplete="init()" >
<mx:Script>
</mx:Script>
</mx:TextInput>
when I input the price number in the ADG and try "enter" the value return to
zero, if i leave the mouse the value apparently is there but when i check
the data in the acContract arrayCollection the price still zero.
But the values for the checkBoxes are there showing as "YES" for checked.
Any ideas of something missing or wrong in this code?
Thanks!
--
View this message in context:
http://apache-flex-users.2333346.n4.nabble.com/ADG-with-item-renderers-tp4626.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.