SMART datagrid v.1 > Classes > GridExportOptions

[ grids ver.1.3.5]   Back  Forward

DataLudi.GridExportOptions.onFinished  property

asynctrue时,将会被调用在提交导出的时点的回调函数。 

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

如果在没有提交导出的状态下发生错误,就会将例外传递至error参数。 elapsed是毫秒单位的进度时间值。 

如果将showProgress指定为true,即使没有使用回调,也就自动显示表示进展状态的进度条。 

默认值为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导出...');
            },
            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
Excel异步导出