Line: 5571 Error: Not enough storage is available to complete this operation

Line: 5571 Error: Not enough storage is available to complete this operation

我在 jqGrid 中尝试添加数据(20K 条记录)时出现 "Not enough storage is available to complete this operation." 错误。此问题出现在 IE 9 中。

代码:

//这一行向jqgrid中添加了20k条记录

    $.when(GetDataBySelectedCode())
           .done(function (ResultData) {
                  if (ResultData!= null) {//able to get result here
                      BindDataInGridNoLimit(ResultData);
                    } 

      }).fail(function (xhr, textStatus, errorThrown) {                
         if (textStatus != 'abort') {
        //todo: error message               
     }
  });

function BindDataInGridNoLimit(data)
{
   DataGrid[0].addJSONData(data);//fails while adding data
}

调用堆栈

环境:

观察:

a) 具有 20K 条记录的相同代码在 Chrome 中工作正常。 b) 具有几百条记录的相同代码在 IE 9 中工作正常。

问题:

此问题是否与 jqgrid 和 IE 9 组合有关?如何解决这个问题?

如有任何建议/解决方案,我们将不胜感激。

在我看来,您尝试添加大量数据而不使用本地分页。它没有实际意义,速度很慢,用户必须向下滚动才能看到数据。使用较小的 rowNum 值更有效,它指定页面的大小并使用 datatype: "local"loadonce:truedatatype: "jsonstring"。用户需要单击 "next page" 按钮才能查看下一部分数据。这是一个小缺点,但使用滚动条滚动网格行也需要时间。其主要优点是:数据将在本地保存为纯 JavaScript 数据。 DOM 大小不会有问题(没有这样的错误)。您获得的最重要的优势:更好的性能。我怀疑用户几乎会立即看到第一页数据,将鼠标悬停在行上会很快,滚动数据也会很快。

我建议你打开树演示,它在 jqGrid 中全部加载 90000 行数据。 The first demo display 25 rows and you can easy scroll over 4500 pages of data. The second grid displays 1000 from 90000 rows and the user can scroll down to see the 1000 rows and the user can use local paging to go over the 90 pages (1000 rows per page). If you would try to open the last demo 尝试一次显示所有 90000 行,您将等待很长时间,最后可能会收到一条错误消息。

我很清楚我的建议意味着更改代码和更改用户界面。另一方面,应该清楚的是,在网格中填充数千行没有多大意义。没有人会滚动并阅读所有数据。 2-5页的数据绝对够了。网格应该只有过滤器工具栏,以便用户可以填充数据并显示 数据的一小部分他真的很感兴趣