forked from Knockout-Contrib/KoGrid
-
Notifications
You must be signed in to change notification settings - Fork 18
Getting Started
Ken Smith edited this page Aug 8, 2013
·
6 revisions
Getting up and running with KoGrid should be as painless as possible, and that's the way we designed it!
Make sure you have jQuery, Knockout and the koGrid-x.x.x.js scripts loaded on your page!
- Setup a
DIV
as the container for KoGrid to bind to
<div data-bind="koGrid: { data: myObsArray }"></div>
- Setup your ViewModel with an observableArray that you want KoGrid to bind to:
var vm = {
myObsArray: ko.observableArray([
{ firstName: 'John', lastName: 'Doe' },
{ firstName: 'Jane', lastName: 'Doe' }
])
};
- Call applyBindings like you already do
ko.applyBindings(vm);