SCRIPT28:堆栈空间不足

时间:2015-12-15 14:15:48

标签: javascript extjs internet-explorer-11

当我尝试将数据数组编码为Json并将其存储到数组中时,在IE 10,11中获取堆栈空间

var SelPeriod = Ext.getCmp('SelectedPeriodGrid');

SelPerioddata = [];

var PeriodsSelected = SelPeriod.getStore('MarkettrackDrillDownPeriods').getRange();

for (var i = 0; i < PeriodsSelected.length; i++) {
    SelPerioddata.push(PeriodsSelected[i]);
}
var SelPerioddatajson = [];

SelPerioddatajson = Ext.JSON.encod(SelPerioddata);

1 个答案:

答案 0 :(得分:1)

尝试仅使用记录的数据,例如:

SelPerioddata.push(PeriodsSelected[i].data);

你也可以这样重写:

var selPeriod = Ext.getCmp('SelectedPeriodGrid'),
  periodsSelected = selPeriod.getStore('MarkettrackDrillDownPeriods').getRange(),
  selPerioddatajson = Ext.JSON.encode(periodsSelected.map(function(record) {
    return record.data;
  }));