<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:grids="com.flexicious.grids.*" xmlns:columns="com.flexicious.grids.columns.*" xmlns:mate="http://mate.asfusion.com/" width="100%">
<mx:Script>
<![CDATA[
import com.flexicious.export.ExportController;
import com.flexicious.print.PrintController;
import com.flexicious.utils.UIUtils;
import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;
import com.sample.SampleUIUtils;
import com.sample.model.Employee;
import com.flexicious.utils.DateRange;
public function myStyleFunc(data:Object, col:AdvancedDataGridColumn):Object
{
if (data["annualSalary"] > 75000)
return {color:0xFF0000};
return null;
}
]]>
</mx:Script>
<mx:HBox width="100%">
<mx:Label text="# Selected Ids: {dgEmployees.selectedKeys.length}"/>
<mx:Spacer width="100%"/>
<mx:Button label="View Explanation For Example" click="UIUtils.openBrowserPopup('http://www.flexicious.com/Home/AdvancedFlexDataGridPagingFilterClient',
'width=1024,height=768,lef t=0,top=0, toolbar=No,location=No,scrollbars=Yes,status=No,resizable=No,fullscreen=No')"/>
</mx:HBox>
<mx:TextArea width="100%" text="This example shows a advanced grid bound to a client side collection of 466 records.(filterPageSortMode = client). It also demonsrate the print, export, custom footer, and dynamic filter (State column) "/>
<grids:ExtendedAdvancedDataGrid forcePagerRow="true" enablePreferencePersistence="true" preferencePersistenceKey="advancedClientGrid" pagerRenderer="com.sample.examples.support.CustomPagerControl" allowMultipleSelection="true" dataProvider="{Employee.getAllEmployees()}" enableFilters="true" enableCopy="true" enableFooters="true" enablePaging="true" id="dgEmployees" height="271" pagerPosition="bottomMiddle" pageSize="50" width="100%" styleFunction="myStyleFunc"
>
<grids:groupedColumns>
<columns:SelectAllAdvancedCheckBoxHeaderColumn width="15" selectedKeyField="employeeId"/>
<columns:ExtendedAdvancedDataGridColumn headerText="ID" dataField="employeeId" filterOperation="Contains" filterControl="TextInput"/>
<columns:ExtendedAdvancedDataGridColumn headerText="First Name" dataField="firstName" filterOperation="BeginsWith" filterControl="TextInput" />
<columns:ExtendedAdvancedDataGridColumn headerText="Last Name" dataField="lastName" filterOperation="BeginsWith" filterControl="TextInput"/>
<columns:ExtendedAdvancedDataGridColumn headerText="State" dataField="stateCode" filterRenderer="com.sample.examples.support.dynamicFilter.DynamicFilterControl"/>
<columns:ExtendedAdvancedDataGridColumn headerText="City" dataField="city" filterControl="TextInput" />
<columns:ExtendedAdvancedDataGridColumn headerText="Department" dataField="department" filterOperation="Equals" filterControl="MultiSelectComboBox" filterComboBoxBuildFromGrid="true" filterComboBoxWidth="150"/>
<columns:ExtendedAdvancedDataGridColumn headerText="Phone" dataField="phoneNumber" filterOperation="Contains" filterControl="TextInput"/>
<columns:ExtendedAdvancedDataGridColumn headerText="Hire Date" dataField="hireDate" filterControl="DateComboBox" labelFunction="SampleUIUtils.dataGridFormatDate" filterDateRangeOptions="{[DateRange.DATE_RANGE_THISQUARTER,DateRange.DATE_RANGE_LASTQUARTER,DateRange.DATE_RANGE_THISYEAR,DateRange.DATE_RANGE_LASTYEAR,DateRange.DATE_RANGE_CUSTOM]}" filterComboBoxWidth="150" footerOperation="count" footerLabel="Count:" footerOperationPrecision="0"/>
<columns:ExtendedAdvancedDataGridColumn textAlign="right" labelFunction="SampleUIUtils.dataGridFormatCurrency" width="100" headerText="Annual Salary" dataField="annualSalary" footerOperation="average" footerLabel="Avg:" footerFormatter="{SampleUIUtils.currencyFormatterWithCents}" filterControl="NumericRangeBox"/>
</grids:groupedColumns>
</grids:ExtendedAdvancedDataGrid>
</mx:VBox>