Handsontable example

HTML

<div id="table" style="width: 200px; height: 100px; overflow:hidden;"></div>

CSS

</style><!-- Ugly Hack due to jsFiddle issue: http://goo.gl/BUfGZ -->

<script src="http://handsontable.com/dist/jquery.handsontable.full.js"></script>
<link rel="stylesheet" media="screen" href="http://handsontable.com/dist/jquery.handsontable.full.css">
<link rel="stylesheet" media="screen" href="http://handsontable.com/demo/css/samples.css">

<style type="text/css">
* {
  margin: 0;
  padding: 0;
  font-family: "sans-serif";
}

JavaScript

/**
 * This Handsontable plugin implements deferred data loading, useful for
 * large tables ("infinite scrolling").
 *
 * 
 *  Example usage
 *  -------------
 *  In this example data is fetched from a Django + Tastypie Api
 *
 *  var hot = new Handsontable(document.getElementById('table'), {
 *      dataSource: function(page, cb) {
 *          $.get("/api/v1/tablename", {page: page}).sucess(function(result) {
 *              cb(result.objects, result.meta.total_count);
 *          });
 *      },
 *      pageSize: 400,
 *      rowsBuffered: 400
 *  });
 *
 * 
 *  Options explained
 *  -----------------
 *
 *  - dataSource (mandatory):
 *        Data loading function. It replaces the *data*
 *        option / the loadData() function.
 *        It's arguments are: 
 *          1. a page number (1-based)
 *          2. A callback function. This function accepts two arguments:
 *             1. the data array
 *             2. the total row count. After the first page is loaded,
 *                the data array of the given size is created.
 *                Changes to the total count are currently not taken into
 *                account
 *
 *  - pageSize (optional):
 *        Number of rows to load in one batch.
 *        Default: 100
 *
 *  - rowsBuffered (optional):
 *        Number of rows above and below the visible range to be automatically
 *        preloaded
 *        Default: 100
 *
 *  - loadDelay (optional):
 *        Delay in ms before starting a page load. This is
 *        done to prevent every page from being loaded
 *        during fast scrolling.
 *        Maybe it could be made more intelligent by determining
 *        the scrolling speed?
 *        Default: 100
 *    
 *  - loadingMsg (optional):
 *        DOM selector that should act as replacement for the default
 */
(function(Handsontable) {
    "use strict";

    /**
     * @class
     */
    function LazyLoader(instance, opt) {
        this.instance = instance;
        this.dataSource =...