Web design and development in Salisbury and Portsmouth » javascript http://www.joshbuckley.co.uk Josh Buckley Thu, 11 Oct 2012 21:17:11 +0000 en-US hourly 1 http://wordpress.org/?v=242 Knockout.js DataTable bindings http://www.joshbuckley.co.uk/2011/07/knockout-js-datatable-bindings/ http://www.joshbuckley.co.uk/2011/07/knockout-js-datatable-bindings/#comments Sat, 30 Jul 2011 16:09:01 +0000 Josh http://www.joshbuckley.co.uk/?p=718 I’ve recently started using knockout.js, which is an implementation of Model-View-ViewModel (MVVM) for Javascript. Well, it covers the View-ViewModel part because the actual data model is on the server.

Along with Knockout, I’ve been using jQuery UI – which I’ve been using for years anyway.

Today, I needed a table widget. There isn’t currently one available in jQuery UI, though one is being developed, so I searched for an alternative. I came across DataTables (well, I’d actually used it before) – but there wasn’t a Knockout binding available. So I developed one, and I’m making it available under the MIT licence.

Demos

Everyone loves demos, so here are a few.

  1. Basic usage (no options): http://jsfiddle.net/vB3Aj/
  2. With options (and jQuery UI theming): http://jsfiddle.net/tdppH/1/

Usage

I’ve set up the demos on jsfiddle to use as little code as possible, so you’ll probably be able to work it out from those.

Any questions though, post in the comments.

Download

Download Knockout.js DataTables binding

]]>
http://www.joshbuckley.co.uk/2011/07/knockout-js-datatable-bindings/feed/ 10