Does the simpleGrid require additional downloads?
Asked Answered
A

1

8

I want to try the simpleGrid in a HotTowel project. When it came to:

this.gridViewModel = new ko.simpleGrid.viewModel({
        data: this.items, ....

it threw an exception:

Unable to get property 'viewModel' of undefined or null reference`

I stepped through and found that ko.simpleGrid is undefined.

Must any other files be added or is simpleGrid available from the standard Knockout.js library?

Amid answered 29/8, 2013 at 10:1 Comment(2)
Simplegird is not built in. You need to download and include it: knockoutjs.com/examples/resources/knockout.simpleGrid.1.3.jsDoss
nevesv's link is old ... better to go to the Knockout grid example page, click the jsFiddle link at the bottom, then in the jsFiddle expand the External Resources in the left nav. There should be a link to the simpleGrid js file. As of October 2017 it is knockout.simpleGrid.3.0.js. Incidentally, I also think it's a big omission that this wasn't mentioned on their example page.Galileo
A
8

Check the fiddle (http://jsfiddle.net/rniemeyer/QSRBR/) provides in the Simple Grid sample. It need the KO library + knockout.simpleGrid.1.3.js

And you need to define the PageGridModel

ko.applyBindings(new PagedGridModel(initialData));
Abmho answered 4/9, 2013 at 19:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.