Class: Column

Column

Represent the Column of Grid

new Column(content, id, opt_datafield, opt_width, opt_datatype, opt_align, opt_renderer)

Parameters:
Name Type Argument Description
content string header Text
id string column id should be unique , if not class will generate a unique id for each column
opt_datafield string <optional>
field mapping to DataRow field name
opt_width number <optional>
width of column , defaults to 75
opt_datatype pear.data.Column.DataType <optional>
DataType , default DataType is pear.data.Column.DataType.TEXT
opt_align pear.data.Column.Align <optional>
text Align of column data , defaults to pear.data.Column.Align.LEFT
opt_renderer pear.ui.GridCellRenderer <optional>
Optional GridCellRenderer
Source:
Example
new pear.data.Column("header Text",'column-id',275,
                        pear.data.Column.DataType.NUMBER)

Extends

  • goog.events.EventTarget

Members

<static> Align :string

Align of Column
Type:
  • string
Properties:
Name Type Default Description
LEFT String left Default Alignment , if align is not specified
RIGHT string right
Source:

<static> DataType :string

DataType
Type:
  • string
Properties:
Name Type Default Description
NUMBER string number
TEXT string text
BOOLEAN string boolean
DATETIME string datetime
Source:

Methods

<protected> disposeInternal()

Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects
Source:

getAlign() → {pear.data.Column.Align}

Get Align
Source:
Returns:
Text Align of Column
Type
pear.data.Column.Align

getColumnFooterAggregatesFn() → {function}

get the Aggregate function
Source:
Returns:
Callback function for Footer Aggregate
Type
function

getColumnFormatter() → {Object.<function(pear.ui.GridCell), Object>}

Get the column formatting function - this function will be called for each DataCell for the column it belong to
Source:
Returns:
Type
Object.<function(pear.ui.GridCell), Object>

getDataField() → {string}

get Data Field , bound to this column
Source:
Returns:
Type
string

getDataType() → {pear.data.Column.DataType}

Get DataType of Column
Source:
Returns:
DataType of Column
Type
pear.data.Column.DataType

getExtraCSSClasses() → {?Array.<string>}

Extra CSS Classes
Source:
Returns:
Type
?Array.<string>

getGridCellRenderer() → {pear.ui.GridCellRenderer}

getGridCellRenderer
Source:
Returns:
column renderer
Type
pear.ui.GridCellRenderer

getHeaderText() → {string}

get Header Text of Column
Source:
Returns:
header text of column
Type
string

getId() → {string}

get Column Id
Source:
Returns:
Type
string

getVisibility() → {boolean}

get Column visibility
Source:
Returns:
Type
boolean

getWidth() → {number}

get Column width
Source:
Returns:
Type
number

isFrozen() → {boolean}

Is Column Frozen
Source:
Returns:
Type
boolean

setColumnFooterAggregatesFn(fn)

set the Callback function for Footer Aggregates Calculation
Parameters:
Name Type Description
fn function Aggregate Function - this function fn will be called if footer row is enabled/show and will be called for GridFooterCell which belongs to this Column
Source:

setColumnFormatter(fn, opt_scope)

Set callback function for formatting all GridCell Data which belongs to this column
Parameters:
Name Type Argument Description
fn function formatting function - which will be called for every GridCell which belongs to this column
opt_scope Object <optional>
whose scope to call the formatter function.
Source:
Example
function myformatter (GridCell) {

  // this function is called for every cell
  // for given column
}
...
...
column.setColumnFormatter(myformatter);

setExtraCSSClasses(classes)

Extra CSS Classes
Parameters:
Name Type Argument Description
classes ?Array.<string> <nullable>
Source:

setFrozen(freeze)

set column freeze
Parameters:
Name Type Description
freeze boolean
Source:

setGridCellRenderer(renderer) → {pear.ui.GridCellRenderer}

setGridCellRenderer
Parameters:
Name Type Argument Description
renderer pear.ui.GridCellRenderer <nullable>
GridCell Renderer
Source:
Returns:
[description]
Type
pear.ui.GridCellRenderer

setVisibility(visible)

set column visibility
Parameters:
Name Type Description
visible boolean
Source:

setWidth(width)

set width
Parameters:
Name Type Description
width number width of column
Source: