Does the simpleGrid require additional downloads?

2019-06-16 11:37发布

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?

1条回答
萌系小妹纸
2楼-- · 2019-06-16 12:10

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));
查看更多
登录 后发表回答