Exports an Ext.data.Store to Excel or CSV
Switch branches/tags
Nothing to show
Pull request Compare This branch is 1 commit behind edspencer:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
CSVFormatter
ExcelFormatter
example
Base64.js
Button.js
Exporter-all.js
Exporter.js
Formatter.js
README.textile
build

README.textile

Ext.ux.Exporter

About

Exporter is a generic export class which takes any Ext.data.Store-based component (e.g. grids and similar) and exports the data in any format.

Exporter works completely client-side. It uses a Formatter class to generate a document (.xls, .csv etc) and then redirects the user’s browser to a data url so that they can view or download it.

Installation

Download the latest version in any of the following ways:

To install Ext.ux.Exporter, just include Exporter-all.js somewhere on your page:

<script type="text/javascript" src="Exporter-all.js"></script>

Usage

The most common use case for the Exporter is exporting a grid to Excel, which is as simple as doing the following:

var grid = new Ext.grid.GridPanel({
  store: someStore,
  tbar : [
    {
      xtype: 'exportbutton',
      store: someStore
    }
  ],
  //your normal grid config goes here
});

The provided ‘exportbutton’ is just a specialised Ext.Button subclass which redirects the user to the generated data url. If you want to provide your own implementation here, just check out the Button.js code (it’s ridiculously simple).

Example

Download or clone the code (see Installation section for details) and then drag the example/index.html file into any browser to see an example of the Exporter at work.