Extjs4.2纯前台导出excel代码中,Button.js的构造函数中
this.on("afterrender", function () { // We wait for the combo to be rendered, so we can look up to grab the component containing it
self.setComponent(self.store || self.component || self.up("gridpanel") || self.up("treepanel"), config);
});
目测应该是支持treepanel的,结果测试结果为不支持treepanel,经查原来是在Worksheet.js中,关于buildRows方法中有这么一段代码
buildRows: function () {
var rows = [];
this.store.each(function (record, index) {
rows.push(this.buildRow(record, index));
}, this);
return rows;
}
如果是treepanel,那个这里的store为TreeStore,但是TreeStore并没有each方法,所以导致这段代码无法继续执行。
时间: 2024-10-22 05:10:55