O'Reilly logo

Mastering KnockoutJS by Timothy Moran

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

KoGrid

KoGrid is a plugin that creates a binding that renders tabular data. As its GitHub page notes, it is "a direct knockout port of ng-grid which was originally inspired by KoGrid, which was inspired by SlickGrid." Its history might have been affected by the grandfather paradox.

In its most basic operation mode, KoGrid can bind against an array of objects, turning their properties into columns and their values into cells:

var vm = {
      people: ko.observableArray([{name: "Moroni", age: 50},
                                      {name: "Tiancum", age: 43},
                                      {name: "Jacob", age: 27},
                                      {name: "Nephi", age: 29},
                                      {name: "Enos", age: 34}])
   }
<div class="gridStyle" data-bind="koGrid: { data: people }"></div>

You can see this example in the cp8-kogrid branch. Except for needing to manually specify, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required