Skip to content

Instantly share code, notes, and snippets.

View kamranayub's full-sized avatar

Kamran Ayub kamranayub

View GitHub Profile
@kamranayub
kamranayub / knockout.extendedCheckedBinding.js
Last active December 10, 2015 10:08 — forked from anonymous/knockout.extendedCheckedBinding.js
A smarter `checked` and `value` binding that play nice together.
// Now you can bind your checkbox selection to an observable array of model
// properties, instead of having to bind it to a property on the item
// itself (e.g. `isSelected`).
// For more information, see:
// http://kamranicus.com/Blog/Posts/61/a-smarter-checked-binding-for-knockoutjs
// For a demo, see:
// http://jsfiddle.net/kamranayub/G8YZU
var oldValueBinding = ko.bindingHandlers['value'];