Reference: |
This topic provides sample code for creating an aggregated DataGrid. It also describes the API filter function.
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp()"> <mx:Script> <![CDATA[ import mx.charts.HitData; import mx.controls.Alert; import mx.collections.ArrayCollection; public var grid1:ibiObject = new ibiObject(); public var fex:String = "http://localhost:8080/ibi_apps/WFServlet ?IBIF_ex=xmltest"; public function initApp():void { grid1.init(fex,dataReady); } public function dataReady(grid:ibiObject,obj:*):void { grid1.populateGrid(false); load_main1agg(); }
public function load_main1agg():void { var aggField:Array = new Array(); var byField:Array = new Array(); var calOpts:Array = new Array(); aggField.push("DOLLARS"); byField.push("ST"); byField.push("REGION"); calOpts.push("Sum","Average"); grid1.aggregate(aggField,byField,calOpts, true, false); main1agg.dataProvider = grid1.prGridagg; } ]]> </mx:Script>
<mx:DataGrid x="10" y="38" width="435" id="main1agg" height="193"> <mx:columns> <mx:DataGridColumn id="col1" headerText="Region" dataField="REGION"/> <mx:DataGridColumn id="col2" headerText="State" dataField="ST"/> <mx:DataGridColumn id="col3" headerText="Total Sales" dataField="Sum.DOLLARS"/> <mx:DataGridColumn id="col4" headerText="Average Sales" dataField="Average.DOLLARS"/> </mx:columns> </mx:DataGrid> </mx:Application>
filterOption of type Array: Specifies the filter condition used to search for values. Possible values of filterOption are EQ, NE, GT, GE, LT, LE, BT, and CT.
filterString of type Array. An Array of Arrays of Strings: Specifies the value that the filter function uses to filter the grid rows.
condition of type Array: Specifies how multiple filters are combined. The possible values for condition are "and" and "or."
caseSen of type Boolean: Specifies whether the filter is case-sensitive or not.
WebFOCUS |