Note that there are some explanatory texts on larger screens.

plurals
  1. POLoading a large number of rows into a SlickGrid using async JQuery requests and RavenDB
    primarykey
    data
    text
    <p>I need to load > 10k rows of data into a <a href="https://github.com/mleibman/SlickGrid/wiki" rel="nofollow noreferrer">SlickGrid</a></p> <p>I believe SlickGrid is designed for just this sort of use based on the following official example which loads 500,000 client-side rows: <a href="http://mleibman.github.com/SlickGrid/examples/example-optimizing-dataview.html" rel="nofollow noreferrer">Optimizing The DataView</a> </p> <p>Since I cannot violate RavenDBs 'safety first' rule that stipulates returning less than 1024 rows per session query, I have used RavenDB's skip-take mechanism which allows the web-client to gather all 10K rows from the server in bites size chunks of 256 rows per http request.</p> <p>My question is this: What is the best way to feed these rows into the SlickGrid as they are returned from the server? Does SlickGrid actively support the asynchronous loading of chunked up data-subsets like this? </p> <p>I am looking for:</p> <ol> <li>A SlickGrid callback that allows me to issue the next server request. </li> <li>An optimised way of appending the resulting rows into the DataView in one go e.g. </li> </ol> <p><code>grid.appendRows(rowSubset)</code></p> <p><a href="https://stackoverflow.com/q/9706833/776476">SlickGrid RemoteModel vs. Dataview Model</a> suggests SlickGrid is designed to work either with large client-side datasets or in the more grid-usual <em>page-on-demand</em> server model. I want to use the former client-side approach as it results in a superior User Experience, imho.</p> <p><strong>Disclaimer</strong>: I understand that I am loading a large number of rows and that the usual approach would be to simply request each page from the server as required. No matter how laudable this approach may be, this is not what I am trying to achieve. Instead I am deliberately attempting to load the entire dataset from the server in such a way that it does not inconvenience the user.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COWhat purpose does presenting all 10k rows serve? If it's a presentation thing then surely displaying small sets would suffice. On the other hand, if it's for generating file contents then presenting in a webpages isn't likely to be the best solution.
      singulars
    2. COSlickGrid is clever enough to manage the optimised display of the correct rows as it adds / removes browser dom nodes under the hood. Caching all the rows client side means that I can take advantage of all of of that goodness plus slickgrid's filtering, sorting etc on the fast client, rather than being chatty with the server. I add the first 256 rows to slick grid, chunk-download the remaining, then update the grid. The user gets an instantly usable grid and about 5 secs later they have the complete dataset to work with.
      singulars
    3. COI'd reconsider your approach. It kind of defeats the purpose of an ajax-based solution, given that the same could be achieved on page load but I'd say that a) You should never send 10k records to a user that needs only 10 (or x <= 10k), b)While it's probably safe to say that SlickGrid have done a good job of creating "all that goodness" but with a dataset of this size you'll never match server side (native language calls) database interaction, serving small - relevant to the user - packages.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload