dojox/grid/enhanced/plugins/exporter/_ExportWriter (version 1.10)

Summary

This is an abstract class for all kinds of writers used in the Exporter plugin. It utilizes the strategy pattern to break the export work into several stages, and provide interfaces for all of them.

Implementations might choose some of the functions in this class to override, thus providing their own functionalities.

The Exporter will go through the grid line by line. So in every line, all the Views will be reached, and the header line is only handled once.

An argObj object is passed to most functions of this class. It carries context arguments that make sense when they are called.

Usage

var foo = new _ExportWriter(writerArgs);
dojox/grid/enhanced/plugins/exporter/_ExportWriter
Parameter Type Description
writerArgs object
Optional

Any implementation of this class might accept a writerArgs object (optional), which contains some writer-specific arguments given by the user.

Property Summary

Method Summary

Properties

Methods

_getExportDataForCell(rowIndex,rowItem,cell,grid)
Parameter Type Description
rowIndex undefined
rowItem undefined
cell undefined
grid undefined
Returns:undefined
afterContent()

We have finished the entire grid travel. Do some clean up work if you need to.

Returns:any

undefined

afterContentRow(argObj)

After handling a line of data (not header).

Parameter Type Description
argObj object

An object with at least the following context properties available:

{
    grid,isHeader,
    row,rowIdx,
    spCols
}
Returns:any

undefined

afterHeader()

The header line has been handled.

Returns:any

undefined

afterSubrow(argObj)

Before handling a subrow in a line (defined in the grid structure).

Parameter Type Description
argObj object

An object with at least the following context properties available:

{
    grid,isHeader,
    row,rowIdx,
    view,viewIdx,
    subrow,subrowIdx,
    spCols(if isHeader==false)
}
Returns:any

undefined

afterView(argObj)

After handling a view.

Parameter Type Description
argObj object

An object with at least the following context properties available:

{
    grid,isHeader,
    view,viewIdx,
    spCols(if isHeader==false)
}
Returns:any

undefined

beforeContent(items)

We are ready to go through all the contents(items).

Parameter Type Description
items Array

All the items fetched from the store

Returns:any | boolean
  • true: go on handling the contents and then call afterContent.
  • false: skip all the contents, won't call afterContent.
beforeContentRow(argObj)

Before handling a line of data (not header).

Parameter Type Description
argObj object

An object with at least the following context properties available:

{
    grid,isHeader,
    row,rowIdx,
    spCols
}
Returns:any | boolean
  • true: go on handling the current data row and then call afterContentRow.
  • false: skip the current data row, won't call afterContentRow.
beforeHeader(grid)

We are going to start the travel in the grid. Is there anything we should do now?

Parameter Type Description
grid EnhancedGrid
Returns:any | boolean
  • true: go on handling the header row and then call afterHeader.
  • false: skip the header row, won't call afterHeader.
beforeSubrow(argObj)

Before handling a subrow in a line (defined in the grid structure).

Parameter Type Description
argObj object

An object with at least the following context properties available:

{
    grid,isHeader,
    row,rowIdx,
    view,viewIdx,
    subrow,subrowIdx,
    spCols(if isHeader==false)
}
Returns:any | boolean
  • true: go on handling the current subrow and then call afterSubrow.
  • false: skip the current subrow, won't call afterSubrow.
beforeView(argObj)

Before handling a view.

Parameter Type Description
argObj object

An object with at least the following context properties available:

{
    grid,isHeader,
    view,viewIdx,
    spCols(if isHeader==false)
}
Returns:any | boolean
  • true: go on handling the current view and then call afterView.
  • false: skip the current view, won't call afterView.
handleCell(argObj)

Handle a header cell or data cell.

Parameter Type Description
argObj object

An object with at least the following context properties available:

{
    grid,isHeader,
    row,rowIdx,
    view,viewIdx,
    subrow,subrowIdx,
    cell,cellIdx,
    spCols(if isHeader==false)
}
Returns:any

undefined

toString()

Export to a string.

Returns:any | string

The exported result string.

Error in the documentation? Can’t find what you are looking for? Let us know!