Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>here is the sample code that may help you.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; </code></pre> <p></p> <pre><code>&lt;mx:Script&gt; &lt;![CDATA[ import mx.collections.ArrayCollection; [Bindable] private var dpFlat:ArrayCollection = new ArrayCollection([ {Region:"Southwest", Territory:"Arizona", Territory_Rep:"Barbara Jennings", Actual:38865, Estimate:40000}, {Region:"Southwest", Territory:"Arizona", Territory_Rep:"Dana Binn", Actual:29885, Estimate:30000}, {Region:"Southwest", Territory:"Central California", Territory_Rep:"Joe Smith", Actual:29134, Estimate:30000}, {Region:"Southwest", Territory:"Nevada", Territory_Rep:"Bethany Pittman", Actual:52888, Estimate:45000}, {Region:"Southwest", Territory:"Northern California", Territory_Rep:"Lauren Ipsum", Actual:38805, Estimate:40000}, {Region:"Southwest", Territory:"Northern California", Territory_Rep:"T.R. Smith", Actual:55498, Estimate:40000}, {Region:"Southwest", Territory:"Southern California", Territory_Rep:"Alice Treu", Actual:44985, Estimate:45000}, {Region:"Southwest", Territory:"Southern California", Territory_Rep:"Jane Grove", Actual:44913, Estimate:45000} ]); ]]&gt; &lt;/mx:Script&gt; &lt;mx:DataGrid id="dg" lockedColumnCount="1" width="500" height="50%" horizontalScrollPolicy="on" rowCount="5" horizontalCenter="0" verticalCenter="0" dataProvider="{dpFlat}"&gt; &lt;mx:columns&gt; &lt;mx:DataGridColumn id="col" width="100" dataField="Region" headerText="Region" &gt; &lt;mx:headerRenderer &gt; &lt;mx:Component id="cmp"&gt; &lt;mx:Image width="25" height="25" source="{imgSource}" click="image1_clickHandler(event)" &gt; &lt;mx:Script&gt; &lt;![CDATA[ import mx.core.Application; [Bindable] private var imgSource:String = "arrow_left.gif"; var flag:Boolean; protected function image1_clickHandler(event:MouseEvent):void { if(flag) { flag = false; Application.application.dg.horizontalScrollPosition = 0; imgSource = "arrow_left.gif"; } else { flag = true; imgSource = "arrow_right.gif"; Application.application.dg.horizontalScrollPosition = 2 } } ]]&gt; &lt;/mx:Script&gt; &lt;/mx:Image&gt; &lt;/mx:Component&gt; &lt;/mx:headerRenderer&gt; &lt;/mx:DataGridColumn&gt; &lt;mx:DataGridColumn id="col1" width="300" dataField="Territory" headerText="Territory"/&gt; &lt;mx:DataGridColumn id="col2" width="300" dataField="Territory_Rep" headerText="Territory_Rep"/&gt; &lt;mx:DataGridColumn id="col3" width="300" dataField="Actual" headerText="Actual" /&gt; &lt;mx:DataGridColumn id="col4" width="300" dataField="Estimate" headerText="Estimate" /&gt; &lt;/mx:columns&gt; &lt;/mx:DataGrid&gt; </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    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.
    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