New GitHub Repository for KnockoutJS Binding Handlers

KnockoutJSYesterday I created a new GitHub repo for KnockoutJS binding handlers for use with SharePoint. I’ve been using KnockoutJS for over a year now, and love working with it to build Single Page Application (SPAs) and other interactive functionality inside SharePoint.

I thought starting a repo that could store bindingHandlers for KnockoutJS that are generally useful for working with SharePoint would be useful for a lot of people.

sympmarc/KOBindings on GitHub

See the Creating custom bindings section of the KnockoutJS documentation for an overview on what binding handlers are all about.

I’ve collected some of these binding handlers and built others. Where possible, I give credit to the source in each file. Unfortunately, in my first year or so of using KnockoutJS, I collected a lot of these without maintaining the source location. If you see your work here, please let me know and I will give you credit!

  • /src contains one file per bindingHandler
  • /html contains example usage of the corresponding bindingHandler

If you’ve been working with KnockoutJS and SharePoint and would like to contribute, feel free to issue a pull request. I’m hoping this will become a repo that is useful for the SharePoint community as well as the KnockoutJS community at large.

I’m also very open to suggestions on how to structure the repo to make it optimally useful. To get things rolling, I’ve posted some of the simpler binding handlers I use, most of which help in working with jQueryUI capabilities.

Similar Posts

6 Comments

    1. John:
      This is always a struggle with SharePoint. I’m still running a public-facing WSS 3.0 site at FPWeb that has old demos on it. Office365 doesn’t give us a good anonymous capability.

      The goal with these custom bindings is to give an assist to people who are already using KnockoutJS and would like some shortcuts. I started with these more generic bindings intentionally, but you’re right that as we get more SharePoint specific, demos will be tricky.

      M.

  1. I don’t use SharePoint, but I do use Knockout and I’d love to see more binding libraries like this. One thing I would suggest is that you make this an NPM module by adding a package.json file to your repo and then publishing it to NPM. I’m not sure how many KO users are using Browserify but I do and I find that it works really well with KO.

    1. Jesse:

      Good suggestion. Pull request? ;=) But seriously, I’m really hoping that the community can jump into this and turn it into a great resource.

      How are you liking Browserify? I’m on the RequireJS bandwagon right now and it looks like they aim to accomplish similar things?

      M.

Leave a Reply to Bryan (@brmathews) Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.