Packagecom.iwobanas.controls
Classpublic class MDataGrid
InheritanceMDataGrid Inheritance mx.controls.DataGrid
ImplementsISearchable

This class extends standard mx.controls.DataGrid by adding following features:



Public Properties
 PropertyDefined by
  copyDataProvider : Boolean = true
Flag indicating if data provider should be copied.
MDataGrid
  found : Boolean
[read-only] Flag indicating if last search ended successfully true or not false.
MDataGrid
  originalCollection : ICollectionView
If copyDataProvider is set this variable will store original data provider converted to ICollectionView if needed while dataProvider will store a copy of data provider.
MDataGrid
  searchExpression : RegExp
[read-only] String wildcard converted to the regular expression (RegExp).
MDataGrid
  searchString : String
[read-only] String wildcard used in last search.
MDataGrid
Public Methods
 MethodDefined by
  
find(wildcard:String, caseInsensitive:Boolean = true):Boolean
Find item matching given wildcard and assign first match to selectedItem.
MDataGrid
  
findNext():Boolean
Find next match using parameters specified in last call to found() function.
MDataGrid
  
findPrevious():Boolean
Find previous match using parameters specified in last call to found() function.
MDataGrid
  
Mark datagrid so that data provider will be refreshed (new filters values will take effect) on next call commitProperties().
MDataGrid
Events
 EventSummaryDefined by
   Dispatched when the originalCollection property changes.MDataGrid
Property detail
copyDataProviderproperty
public var copyDataProvider:Boolean = true

Flag indicating if data provider should be copied. If true shallow copy of data provider is created and filters applied to data provider doesn't affect data provider. If false filters are applied to original data provider. NOTE: Changing this value when dataProvider is set will take effect after next call to dataProvider setter.

foundproperty 
found:Boolean  [read-only]

Flag indicating if last search ended successfully true or not false.

This property can be used as the source for data binding.

Implementation
    public function get found():Boolean
originalCollectionproperty 
public var originalCollection:ICollectionView

If copyDataProvider is set this variable will store original data provider converted to ICollectionView if needed while dataProvider will store a copy of data provider. If copyDataProvider is false this will equal to dataProvider.

This property can be used as the source for data binding.

searchExpressionproperty 
searchExpression:RegExp  [read-only]

String wildcard converted to the regular expression (RegExp).

This property can be used as the source for data binding.

Implementation
    public function get searchExpression():RegExp
searchStringproperty 
searchString:String  [read-only]

String wildcard used in last search.

This should equal to the string passed to the find() function.

This property can be used as the source for data binding.

Implementation
    public function get searchString():String
Method detail
find()method
public function find(wildcard:String, caseInsensitive:Boolean = true):Boolean

Find item matching given wildcard and assign first match to selectedItem.

Unlike standard findSting() function this functions searches labels of all visible columns. It also supports wildcards containing "?" or " characters interpreted as any character or any character sequence respectively.

The search starts at selectedIndex location and if match is find stops immediately. If it reaches the end of the data provider it starts over from the beginning. If you need to navigate between matches user findNext() / findPrevious() functions.

Parameters
wildcard:String — text to search for
 
caseInsensitive:Boolean (default = true) — flag indicating whether search should be case insensitive

Returns
Booleantrue if text was fond or false if not

See also

findNext()method 
public function findNext():Boolean

Find next match using parameters specified in last call to found() function.

Returns
Boolean
findPrevious()method 
public function findPrevious():Boolean

Find previous match using parameters specified in last call to found() function.

Returns
Boolean
invalidateColumnFilters()method 
public function invalidateColumnFilters():void

Mark datagrid so that data provider will be refreshed (new filters values will take effect) on next call commitProperties(). This function may eventually be called by "filteChange" and "filterValueChange" event handlers but for now it is directly called by ColumnFilterBase.

Event detail
originalCollectionChangeevent 
Event object type: com.iwobanas.controls.dataGridClasses.MDataGridEvent

Dispatched when the originalCollection property changes.