title: Deferring computation in paginated lists with knockoutjs
body: <p>I am using knockoutjs 2.0 with the deferred-updates plugin. I have a view that is designed to paginate a list, as follows:</p>
  
  <pre><code>function PaginatedView(label, items, size) {
      var self = this;
  
      this.label = ko.observable(label);
  
      // List of all items to display
      this.list = ko.observableArray(items);
  
      // List that contains the items on the current page
      this.rows = ko.observableArray([]);
  
      this.pageSize = ko.observable(size || 5);
      this.pageIndex = ko.observable(0);
  
      function populateList() {
          var size = self.pageSize();
          var start = self.pageIndex() * size;
          self.rows( self.list.slice(start, start + size) );
          console.log(self.label() + ": Set rows to range", start, start + size - 1);
      }
  
      // if the deferEvaluation value is true, no items are ever displayed
      ko.computed(populateList, null, {deferEvaluation: false});    
  
      this.maxPageIndex = ko.computed(function() {
          return Math.ceil(this.list().length / this.pageSize()) - 1;
      }, this);
  
      this.pageList = ko.computed(function() {
          var pages = [];
          for (var p = 0; p &lt;= self.maxPageIndex(); p++)
              pages.push(p+1);
  
          return pages;
      });
  
      this.goToPage = function(p) {
          p--;
          if (p&gt;=0 &amp;&amp; p&lt;=self.maxPageIndex())
              self.pageIndex(p);
      }
  };
  </code></pre>
  
  <p>In my application, I create multiple views that paginate through different lists of objects. For the purposes of tracking which items people actually see, I would like to defer the computation of the pagination (in the <code>populateList()</code> function above) until the view is actually ready to be displayed. </p>
  
  <p>I thought I could achieve this with the deferred-updates plugin by setting the <code>deferEvaluation</code> option to false. But if I do that, I see no output at all. I've built a small <a href="http://jsfiddle.net/gene/ruBwu/" rel="nofollow">test case</a> with jsfiddle to illustrate the problem. With the value set to false, the console will show two lines of output before any list is selected; with the value set to true, no list elements are ever displayed.</p>
  
  <p>What am I doing wrong?</p>