Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In your data object, make sure to fire an event every time the included property changes. In your 2nd itemRenderer listen to the event and update the value whenever the property changes.</p> <p>Conceptually like this:</p> <p>In the data object: </p> <pre><code>private var _included : Boolean; public function get included():Boolean{ return this._included; } public function set included(value:Boolean):void this._included = value; this.dispatchEvent(new Event('includedChanged'); } </code></pre> <p>Add a renderer to your second column, like this:</p> <pre><code> &lt;mx:DataGridColumn headerText="Antal" headerStyleName="gridheader" width="40" dataField="antal" editorDataField="value" editable="true"&gt; &lt;mx:itemRenderer&gt; &lt;fx:Component&gt; &lt;mx:Label dataChange="onDataChange()" &gt; &lt;fx:Script&gt; &lt;![CDATA[ public function onDataChange():void{ thistext = data['Antal']; this.data.addEventListener('includedChanged',onIncludedChange); } public function onIncludedChange(e:Event):void{ this.text = data['Antal']; } ]]&gt; &lt;/fx:Script&gt; &lt;/mx:Label&gt; &lt;/fx:Component&gt; &lt;/mx:itemRenderer&gt; &lt;mx:itemEditor&gt; &lt;fx:Component&gt; &lt;mx:NumericStepper stepSize="1" width="35" height="20" focusOut="numericstepper1_changeHandler(event)"&gt; &lt;fx:Script&gt; &lt;![CDATA[ import mx.events.NumericStepperEvent; override public function set data(value:Object):void{ super.data = value; if (value &amp;&amp; value.hasOwnProperty("minNo")) minimum = value.minNo; if (value &amp;&amp; value.hasOwnProperty("maxNo")) maximum = value.maxNo; } protected function numericstepper1_changeHandler(event:Event):void { if(data.antal &gt; 0) data.included = true; else data.included = false; } ]]&gt; &lt;/fx:Script&gt; &lt;/mx:NumericStepper&gt; &lt;/fx:Component&gt; &lt;/mx:itemEditor&gt; &lt;/mx:DataGridColumn&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload