title: Knockout.js "select all" checkboxes
body: <p>I've just started playing around with Knockout.js, and it seems really cool. What I have is a grid. This grid has a column with a checkbox at the top to "select all" of the elements, as well as deselect. Standard grid behavior.</p>
  
  <p>Here's my code so far:</p>
  
  <p><strong>Javascript:</strong></p>
  
  <pre><code>// Define a "banner" class
  function banner(inventory, name, artType, artSize) {
      return {
          isSelected : ko.observable(false),
          inventory : ko.observable(inventory),
          name : ko.observable(name),
          artType : ko.observable(artType),
          artSize : ko.observable(artSize)
  
      };
  }
  
  var viewModel = {
      banners : ko.observableArray([new banner("network", "Banner #1"), new banner("oo", "Banner #2")]),
      addBanner : function() {
          this.banners.push(new banner("network", "Banner"));
      },
      selectAll : function() {
          this.banners.isSelected(true)
      }       
  
  };
  
  ko.applyBindings(viewModel);
  </code></pre>
  
  <p>I'm binding the "selectAll" event to the checkbox like this:</p>
  
  <pre><code>&lt;th&gt;&lt;input data-bind="click: selectAll" type="checkbox" /&gt;&lt;/th&gt;
  </code></pre>
  
  <p>And for each individual banner I have in my list, their checkbox looks like this:</p>
  
  <pre><code>&lt;td&gt;&lt;input data-bind="checked: isSelected" type="checkbox" /&gt;&lt;/td&gt;
  </code></pre>
  
  <p>For some reason my selectAll function isn't working correctly. I'm fairly new to this OO javascript programming paradigm, so I may be doing something blatantly wrong here.</p>
  
  <p>Thanks!</p>