我正尝试将Ext.Grid导出到excel或.xls中,但由于某种原因,它无法获取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>
我哪里错了?
发布于 2012-12-27 11:20:49
如果我没记错的话,您使用的github存储库是针对ExtJS 3的。您可以改用此https://github.com/iwiznia/Ext.ux.Exporter。
记住使用this替换excelFormatter文件夹中的Style.js
https://stackoverflow.com/questions/12825539
复制相似问题