Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can easily toggle the visibility of the whole column when rolling over items in column1 that way:</p> <pre><code>&lt;mx:DataGrid dataProvider="{[{c1:'a1', c2:'b1', c3:'c1'}]}"&gt; &lt;mx:columns&gt; &lt;mx:DataGridColumn headerText="Column 1" dataField="c1"&gt; &lt;mx:itemRenderer&gt; &lt;mx:Component&gt; &lt;mx:Label text="{listData.label}" rollOver="DataGrid(owner).columns[2].visible = true" rollOut="DataGrid(owner).columns[2].visible = false" &gt; &lt;mx:Script&gt; &lt;![CDATA[ import mx.controls.DataGrid; ]]&gt; &lt;/mx:Script&gt; &lt;/mx:Label&gt; &lt;/mx:Component&gt; &lt;/mx:itemRenderer&gt; &lt;/mx:DataGridColumn&gt; &lt;mx:DataGridColumn headerText="Column 2" dataField="c2" /&gt; &lt;mx:DataGridColumn headerText="Column 3" dataField="c3" visible="false" /&gt; &lt;/mx:DataGrid&gt; </code></pre> <p>Of course, you'd better create new class instead of inline item renderer.</p> <p>Showing the only renderer in the 3rd column is very tricky, because if the whole column is invisible, then no renderers for that column is created. </p> <p>I think it's better to use tooltip-like solution, like this:</p> <pre><code>&lt;mx:Script&gt; &lt;![CDATA[ import test.CellRenderer; ]]&gt; &lt;/mx:Script&gt; &lt;mx:UIComponent id="textFlowContainer" width="100%" height="100%" /&gt; &lt;mx:DataGrid dataProvider="{[{c1:'a1', c2:'b1', c3:'c1'}]}"&gt; &lt;mx:columns&gt; &lt;mx:DataGridColumn headerText="Column 1" dataField="c1" itemRenderer="{new ClassFactory(CellRenderer)}" /&gt; &lt;mx:DataGridColumn headerText="Column 2" dataField="c2" itemRenderer="{new ClassFactory(CellRenderer)}" /&gt; &lt;/mx:columns&gt; &lt;/mx:DataGrid&gt; </code></pre> <p>Where test.CellRenderer is:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;mx:Label xmlns:mx="http://www.adobe.com/2006/mxml" text="{listData.label}" rollOver="rollOverHandler()" rollOut="rollOutHandler(event)"&gt; &lt;mx:Script&gt; &lt;![CDATA[ import mx.managers.PopUpManagerChildList; import mx.managers.PopUpManager; import mx.controls.Label; import mx.controls.DataGrid; private var popupLabel:Label; private function rollOverHandler ():void { popupLabel = new Label(); popupLabel.addEventListener(MouseEvent.ROLL_OUT, rollOutHandler); popupLabel.text = data.c3; PopUpManager.addPopUp(popupLabel, this, false, PopUpManagerChildList.PARENT); var p1:Point = new Point(0, this.y); p1 = localToGlobal(p1); var p2:Point = new Point(listData.owner.x+listData.owner.width, 0); p2 = listData.owner.parent.localToGlobal(p2); popupLabel.move(p2.x, p1.y); } private function rollOutHandler (event:MouseEvent):void { if (popupLabel &amp;&amp; !popupLabel.hitTestPoint(event.stageX, event.stageY)) { PopUpManager.removePopUp(popupLabel); popupLabel = null; } } ]]&gt; &lt;/mx:Script&gt; &lt;/mx:Label&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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