SMART datagrid v.1 > Classes > GridExportOptions

[ grids ver.1.3.5]   Back  Forward

DataLudi.GridExportOptions.onProgress  property

Progress callback function which is called in each point of converting grid contents to Excel when async is true

function (grid:GridBase, current:Number, elapsed: Integer, message: String);    

current is the progress rate between 0 ~ 100, and elapsed is the elapsed time value in milliseconds. In addition, message displays the contents of being proceeded. 

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 onProgress(): Function
Setter
function setOnProgress(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
async
showProgress
title
GridExcelExporter
exportToExcel
GridBase
Examples
Async Excel Exporting