Package | com.iwobanas.controls |
Class | public class DataGrid2CSV |
Note that DataGrid2CSV does not handle saving CSV file to filesystem or transmitting it over network, all what DataGrid2CSV does is returning String containing data in SCV format which then may be saved or transmitted by application code.
Property | Defined by | ||
---|---|---|---|
columnSeparator : String = ","
String used to separate columns in exported data.
| DataGrid2CSV | ||
includeHeader : Boolean = true
Flag indicating if header row should be added at the top of CSV document.
| DataGrid2CSV | ||
rowSeparator : String = "
"
String used to separate rows in exported data.
| DataGrid2CSV | ||
target : DataGrid
Target DataGrid from which data should be exported.
| DataGrid2CSV | ||
useRawData : Boolean = false
Flag indicating if raw data should be used when possible.
| DataGrid2CSV |
Method | Defined by | ||
---|---|---|---|
getCSV():String
Get the data from DataGrid formatted as CSV.
| DataGrid2CSV |
Method | Defined by | ||
---|---|---|---|
escapeValue(value:String):String
Escape passed value so that it can be used as CSV field.
| DataGrid2CSV | ||
getDataRow(item:Object):String
Get data row in CSV format for a given DataGrid item.
| DataGrid2CSV | ||
getDataRows():String
Get all data rows in CSV format.
| DataGrid2CSV | ||
getFieldValue(item:Object, column:DataGridColumn):String
Get the String value for a given DataGrid item and column.
| DataGrid2CSV | ||
getHeadrRow():String
Get header row in CSV format.
| DataGrid2CSV |
columnSeparator | property |
public var columnSeparator:String = ","
String used to separate columns in exported data. According to RFC 4180 this should be comma. Column separator is not added after last column in row.
This property can be used as the source for data binding.
includeHeader | property |
public var includeHeader:Boolean = true
Flag indicating if header row should be added at the top of CSV document.
This property can be used as the source for data binding.
rowSeparator | property |
public var rowSeparator:String = "
"
String used to separate rows in exported data. According to RFC 4180 this should be CRLF.
This property can be used as the source for data binding.
target | property |
public var target:DataGrid
Target DataGrid from which data should be exported. This may also be subclass of DataGrid for example MDataGrid.
This property can be used as the source for data binding.
useRawData | property |
public var useRawData:Boolean = false
Flag indicating if raw data should be used when possible.
If true
label functions will not be used for columns
with dataField
defined i.e. standard toString()
function will be used.
If false
label functions will be used for all columns
with label function defined.
This property can be used as the source for data binding.
escapeValue | () | method |
protected function escapeValue(value:String):String
Escape passed value so that it can be used as CSV field. By default all fields are surrounded with double quotes and double quotes inside field are escaped by adding double quotes (see RFC 4180).
Parametersvalue:String — value which should be escaped
|
String — escaped value
|
getCSV | () | method |
public function getCSV():String
Get the data from DataGrid formatted as CSV.
All parameters including target
have to be set before call to this function.
String — DataGrid formatted as CSV or empty String if target is not set.
|
getDataRow | () | method |
protected function getDataRow(item:Object):String
Get data row in CSV format for a given DataGrid item.
Parametersitem:Object |
String — data row in CSV format
|
getDataRows | () | method |
protected function getDataRows():String
Get all data rows in CSV format.
This function iterates over DataGrid data provider and calls getDataRow()
.
String — all data rows in CSV format
|
getFieldValue | () | method |
protected function getFieldValue(item:Object, column:DataGridColumn):String
Get the String value for a given DataGrid item and column.
Depending on useRawData
flag this may be label
created using label function or raw data converted to String.
item:Object — DataGrid item for which value should be returned
|
|
column:DataGridColumn — DataGrid column for which value should be returned
|
String — value for a given DataGrid item and column
|
getHeadrRow | () | method |
protected function getHeadrRow():String
Get header row in CSV format.
ReturnsString — header row in CSV format
|