# Test Print/Export plugins of dojox.grid.EnhancedGrid

# dojox.grid.EnhancedGrid - Print, Export

## Printer API

Use Title:

#### Usage 1:

    someGrid.printGrid({
        title: "A title: All Content",
        cssFiles: ["cssfile1.css","cssfile2.css"],
        writerArgs: {table:"border='border'"},
        fetchArgs: {start: 0, count: 100}
    });

    someGrid.printSelected({
        title: "A title: Only Selected",
        cssFiles: ["cssfile1.css","cssfile2.css"],
        writerArgs: {table:"border='border'"}
    });

Generate an HTML string containing all the content in the grid and then print it.

- A title, an array of CSS files and an associative array containing HTML tag attributes can be provided.
- All three arguments are optional
- The generated HTML page assigns predefined CSS classes for grid rows and columns, so the user can design styles for every rows,columns or even a single cell.

#### Usage 2:

    someGrid.exportToHTML({
        title: "Export All To HTML",
        cssFiles: ["cssfile1.css","cssfile2.css"],
        writerArgs: {table:"border='border'"},
        fetchArgs: {start: 0, count: 100}
    }, function(html){
        /* do sth with the generated html page */
    });

    var html =
    someGrid.exportSelectedToHTML({
        title: "Export Selected Rows to HTML",
        cssFiles: ["cssfile1.css","cssfile2.css"],
        writerArgs: {table:"border='border'"}
    });

Do not print, only generate html string. Users can use this to implement preview.

## Exporter API

Separator is:
Results:

#### Usage:

    someGrid.exportGrid("csv", {
    	writerArgs: {separator:":"},
    	fetchArgs: {start: 0, count: 100}
    }, function(str){
        /* do sth with str */
    });

    var str =
    someGrid.exportSelected("csv", {
    	writerArgs: {separator:"###"}
    });

Export grid content to a specified format.

- The type argument is a supported format name, mandatory.
- The writerArgs argument is a format-specific argument, optional.
- If we are exporting everything, a callback function should be provided.
- Actually, the printer is implemented using an HTML Table exporter

Note: To see the tundra theme, just append ?theme=tundra to the URL.