Book Image

KnockoutJS Web Development

Book Image

KnockoutJS Web Development

Overview of this book

Table of Contents (13 chapters)
KnockoutJS Web Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The simpleGrid plugin


Just like jQuery allows for custom plugins, it is possible to use plugins with Knockout as well. Here, we are going to use a simple plugin to add grid functionality to our page. This plugin also smartly adds paging to the page. We will also do some simple CSS to set our grid so it loosens up the space between the cells in the table.

Tip

The reason we code with jQuery, KnockoutJS, Bootstrap, and other Don't Repeat Yourself (DRY) libraries is that they package our work. We don't have to rethink, recode, or repeat our work when this is done. Using solutions such as jQuery and KnockoutJS, we can DRY out our code by adding our own library extensions. The simple grid plugin is an example of this.

Note that we will cover enough detail in this book that by the end you should be able to modify this plugin or build your own. However, you will have to understand JavaScript, CSS, HTML, and other topics enough to get the job you are seeking to DRY out. Regarding KnockoutJS, you will...