SMART datagrid v.1 > Classes > GridExportOptions

[ grids ver.1.3.5]   Back  Forward

DataLudi.GridExportOptions.onFinished  property

Callback function which is called at the point of committing exporting when async is true

function (grid:GridBase, error:*, elapased:Integer);    

If an error occurs in the state of not committing exporting, an exception will be transferred to error parameter. elapsed is the progress time value in milliseconds. 

If specify showProgress as true, even if do not use callback, it will automatically display the progress bar of indicating the progress state. 

Defaults to null.

Getter
function onFinished(): Function
Setter
function setOnFinished(value: Function)
Code -1
    $('#export').click(function () {
        new DataLudi.exportToExcel(grdMain, {
            target: "local",
            fileName: "dlgrid.xlsx",
            async: true,
            onStart: function (grid) {
                grid.showProgress('Excel exporting...');
            },
            onProgress: function (grid, current, elapsed, message) {
                grid.setProgress(0, 100, current, message + ' in ' + elapsed.toLocaleString());
            },
            onFinished: function (grid, error, elapsed) {
                grid.closeProgress();
                if (err) {
                    alert('Export failed: ' + err);
                }
            }
        });
    });
See Also
onStart
onProgress
async
showProgress
title
GridExcelExporter
exportToExcel
GridBase
Examples
Async Excel Exporting