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

1k views Asked by At

I am getting "Not enough storage is available to complete this operation." error while trying to add data (20K records) in jqGrid. This issue is occurring in IE 9.

enter image description here

enter image description here

Code:

//This line adds 20k records to the jqgrid

    $.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
}

Call Stack

enter image description here

Environment:

  • ASP.NET Web Forms, Visual Studio 2012, jqGrid 4.6.0, IE 9, jquery 1.11.1
  • In jqGrid, I have not enabled paging as it is the requirement from end users.

Observations:

a) The same code with 20K records works fine in Chrome. b) The same code with few hundreds of records works fine in IE 9.

Question:

Is this issue related to jqgrid and IE 9 combination? How to fix this issue?

Any suggestions / solutions are appreciated.

1

There are 1 answers

0
Oleg On BEST ANSWER

It seems to me that you try to add a lot of data without local paging. It have not real sense, it's slow and the user will do have to scroll below to see the data. It's much more effective to use small rowNum value, which specify the size of the page and use datatype: "local" or loadonce:true or datatype: "jsonstring". The user will need to click on the "next page" button to see the next portion of data. It's a small disadvantage, but scrolling the grid rows using the scroll bar take time too. The main advantage which one will have: the data will be saved locally as pure JavaScript data. You will have no problem with DOM size (no such error). The most important advantage which you get: much better performance. I suspect that the user will see the first page of data practically immediately, hovering on the rows will be quickly and scrolling of data will be quickly too.

I recommend you to open tree demos which all loads 90000 rows of data in jqGrid. 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 which try to display all 90000 rows at once you will wait long time and get probably an error message at the end.

It's clear for me that my suggestion means changing of the code and changing of the user interface. On the other side it should be clear for all that filling thousand of rows in the grid have not much sense. Nobody will scroll and read all the data. 2-5 pages of the data will be absolutely enough. The grid should just have filter toolbar, so that the user could filler the data and to display small subset of the data are really interesting him.