dojox/grid/enhanced/plugins/exporter/_ExportWriter.js

  • Provides:

    • dojox.grid.enhanced.plugins.exporter._ExportWriter
  • Requires:

    • dojox.grid.enhanced.plugins.Exporter in common
  • dojox.grid.enhanced.plugins.exporter._ExportWriter

    • type
      Function
    • summary
      Writer initializations goes here.
    • parameters:
      • writerArgs: (typeof object)
        Any implementation of this class might accept a writerArgs object (optional),
        which contains some writer-specific arguments given by the user.
    • source: [view]
        // summary:
        //  Writer initializations goes here.
        // writerArgs: object?
        //  Any implementation of this class might accept a writerArgs object (optional),
        //  which contains some writer-specific arguments given by the user.
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.argObj

    • type
      Object
    • summary
  • dojox.grid.enhanced.plugins.exporter._ExportWriter._getExportDataForCell

    • type
      Function
    • parameters:
      • rowIndex: (typeof )
      • rowItem: (typeof )
      • cell: (typeof )
      • grid: (typeof )
    • source: [view]
        var data = (cell.get || grid.get).call(cell, rowIndex, rowItem);
        if(this.formatter){
         return this.formatter(data, cell, rowIndex, rowItem);
        }else{
         return data;
        }
    • summary
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.beforeHeader

    • type
      Function
    • parameters:
      • grid: (typeof EnhancedGrid)
    • source: [view]
        return true; //Boolean
    • summary
      We are going to start the travel in the grid.
      Is there anything we should do now?
    • tags:
    • returns
      Boolean
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.afterHeader

    • type
      Function
    • source: [view]
        // summary:
        //  The header line has been handled.
        // tags:
        //  protected extension
        // returns:
        //  undefined
    • summary
      The header line has been handled.
    • tags:
    • return_summary
      undefined
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.beforeContent

    • type
      Function
    • parameters:
      • items: (typeof Array)
        All the items fetched from the store
        return:
        true: go on handling the contents and then call afterContent.
        false: skip all the contents, won't call afterContent.
    • source: [view]
        return true; //Boolean
    • summary
      We are ready to go through all the contents(items).
    • tags:
    • returns
      Boolean
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.afterContent

    • type
      Function
    • source: [view]
        // summary:
        //  We have finished the entire grid travel.
        //  Do some clean up work if you need to.
        // tags:
        //  protected extension
        // returns:
        //  undefined
    • summary
      We have finished the entire grid travel.
      Do some clean up work if you need to.
    • tags:
    • return_summary
      undefined
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.beforeContentRow

    • type
      Function
    • parameters:
      • argObj: (typeof object)
        An object with at least the following context properties available:
        {
        grid,isHeader,
        row,rowIdx,
        spCols
        }
        return:
        true: go on handling the current data row and then call afterContentRow.
        false: skip the current data row, won't call afterContentRow.
    • source: [view]
        return true; //Boolean
    • summary
      Before handling a line of data (not header).
    • tags:
    • returns
      Boolean
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.afterContentRow

    • type
      Function
    • parameters:
      • argObj: (typeof object)
        An object with at least the following context properties available:
        {
        grid,isHeader,
        row,rowIdx,
        spCols
        }
    • source: [view]
        // summary:
        //  After handling a line of data (not header).
        // tags:
        //  protected extension
        // argObj:
        //  An object with at least the following context properties available:
        //  {
        //   grid,isHeader,
        //   row,rowIdx,
        //   spCols
        //  }
        // returns:
        //  undefined
    • summary
      After handling a line of data (not header).
    • tags:
    • return_summary
      undefined
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.beforeView

    • type
      Function
    • parameters:
      • argObj: (typeof object)
        An object with at least the following context properties available:
        {
        grid,isHeader,
        view,viewIdx,
        spCols(if isHeader==false)
        }
        return:
        true: go on handling the current view and then call afterView.
        false: skip the current view, won't call afterView.
    • source: [view]
        return true; //Boolean
    • summary
      Before handling a view.
    • tags:
    • returns
      Boolean
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.afterView

    • type
      Function
    • parameters:
      • argObj: (typeof object)
        An object with at least the following context properties available:
        {
        grid,isHeader,
        view,viewIdx,
        spCols(if isHeader==false)
        }
    • source: [view]
        // summary:
        //  After handling a view.
        // tags:
        //  protected extension
        // argObj:
        //  An object with at least the following context properties available:
        //  {
        //   grid,isHeader,
        //   view,viewIdx,
        //   spCols(if isHeader==false)
        //  }
        // tags:
        //  protected extension
        // returns:
        //  undefined
    • summary
      After handling a view.
    • tags:
    • return_summary
      undefined
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.beforeSubrow

    • type
      Function
    • parameters:
      • argObj: (typeof object)
        An object with at least the following context properties available:
        {
        grid,isHeader,
        row,rowIdx,
        view,viewIdx,
        subrow,subrowIdx,
        spCols(if isHeader==false)
        }
        return:
        true: go on handling the current subrow and then call afterSubrow.
        false: skip the current subrow, won't call afterSubrow.
    • source: [view]
        return true; //Boolean
    • summary
      Before handling a subrow in a line (defined in the grid structure).
    • tags:
    • returns
      Boolean
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.afterSubrow

    • type
      Function
    • parameters:
      • argObj: (typeof object)
        An object with at least the following context properties available:
        {
        grid,isHeader,
        row,rowIdx,
        view,viewIdx,
        subrow,subrowIdx,
        spCols(if isHeader==false)
        }
    • source: [view]
        // summary:
        //  Before handling a subrow in a line (defined in the grid structure).
        // tags:
        //  protected extension
        // argObj:
        //  An object with at least the following context properties available:
        //  {
        //   grid,isHeader,
        //   row,rowIdx,
        //   view,viewIdx,
        //   subrow,subrowIdx,
        //   spCols(if isHeader==false)
        //  }
        // returns:
        //  undefined
    • summary
      Before handling a subrow in a line (defined in the grid structure).
    • tags:
    • return_summary
      undefined
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.handleCell

    • type
      Function
    • parameters:
      • argObj: (typeof 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)
        }
    • source: [view]
        // summary:
        //  Handle a header cell or data cell.
        // tags:
        //  protected extension
        // argObj:
        //  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:
        //  undefined
    • summary
      Handle a header cell or data cell.
    • tags:
    • return_summary
      undefined
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.toString

    • type
      Function
    • source: [view]
        return ''; //String
    • summary
      Export to a string.
    • tags:
    • return_summary
      The exported result string.
    • returns
      String
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.argObj.grid

    • type
      EnhancedGrid
    • summary
      The grid object we are now handling.
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.argObj.isHeader

    • type
      bool
    • summary
      Indicating which context we're handling, header or content.
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.argObj.view

    • type
      _View
    • summary
      Reference to the current _View object.
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.argObj.viewIdx

    • type
      int
    • summary
      The index of the current _View object in the views array.
      If the grid does not have any rowselector view, it conforms to the index
      in the _ViewManager.views.
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.argObj.subrow

    • type
      _View.structure.cells[i
    • summary
      Reference to the current subrow.
      A subrow describe the innter structure of a row in a view, it's an array of cells
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.argObj.subrowIdx

    • type
      int
    • summary
      The index of the current subrow in the subrow array: _View.structure.cells.
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.argObj.cell

    • type
      dojox.grid.__CellDef
    • summary
      Reference to the current cell.
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.argObj.cellIdx

    • type
      int
    • summary
      The index of the current cell in the current subrow.
      It's different from cell.index, which is the index in the whole line.
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.argObj.row

    • type
      item
    • summary
      The current row of data (logically), a.k.a.: current item.
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.argObj.rowIdx

    • type
      int
    • summary
      The index of the current row (item).
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.argObj.spCols

    • type
      Array<int
    • summary
      An array of special column indexes(flat,not regarding structure).
      Special columns are typically attached to grid as a kind of UI facility
      by the grid widget, instead of some real data.
      For example, indirect selectors and row indexers.
      Users can choose to export it or not.
  • dojox.grid.enhanced.plugins.exporter._ExportWriter.argObj.colOffset

    • type
      int
    • summary
      If the grid has a _RowSelector view or something else, this view will NOT be
      passed to the user in argObj. So the column index (cell.index) will appear shifted
      (start from 1 instead of 0). This colOffset is provided to remove this shift.
      usage:
      var correctColIndex = argObj.cell.index + argObj.colOffset;
  • dojox.grid.enhanced.plugins.exporter

    • type
      Object
    • summary
  • dojox.grid.enhanced.plugins

    • type
      Object
    • summary
  • dojox.grid.enhanced

    • type
      Object
    • summary
  • dojox.grid

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary