SMART datagrid v.1 > Classes > GridExportOptions

[ grids ver.1.3.5]   Back  Forward

DataLudi.GridExportOptions.onProgress  property

asynctrue时,将会被调用在转换网格内容为Excel的每个时点的进度回调函数。 

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

current是0到100之间的进步率,并且elapsed是已消逝的毫秒单位的时间值。 另外,message显示当前进行中的内容。 

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

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