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.

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.

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