1

我正在尝试在 excel 或 .xls 中导出 Ext.Grid,但由于某种原因,它不会在 Mac 中获取数据。该文件在 Windows 中以 .xlt 格式导出,不会在 MS Office excel 中打开。虽然导出的文件在 Ubuntu 中导出并使用 Libre 打开时包含所有数据。

我正在使用 github 中提供的Ext.ux.Exporter。该文件是执行所有工作的 Exporter-all.js。我真的很困惑我哪里错了?

这是excel导出按钮上的代码,

var grid = new Ext.grid.GridPanel({
    title: "Intersected Species Info",
    store: stor,
    width: 585,
    height: 260,
    stripeRows: true,
    tbar: [],
    columns: columns,
    listeners: {
        render: function (grid) {
            grid.getSelectionModel().selectFirstRow();
        }
    }
});

var exportCSV = new Ext.ux.Exporter.Button({
    component: grid,
    text: 'Download CSV'
});

grid.getTopToolbar().add(exportCSV);

这是我导入 js 文件的地方,

<script src="../exporter/Exporter-all.js" type="text/javascript"></script>

我哪里不对?

4

1 回答 1

0

如果我没记错的话,您使用的那个 github 存储库适用于 ExtJS 3。您可以改用此https://github.com/iwiznia/Ext.ux.Exporter

请记住使用此替换 excelFormatter 文件夹中的 Style.js

很抱歉抛出一堆链接,但这个线程解释得很好。您也可以按照此处的示例进行操作。

于 2012-12-27T03:20:49.053 回答