Posts for js


  • Useful Knockout JS Validation Rules

    Knockout validation is an excellent starting point for adding validation rules to your apps. This is my collection of extra rules I add to my projects to fill in some gaps in the base.

  • 5 Useful Knockout JS Binding Handlers

    Knockout JS is an awesome MVVM framework and is probably my favorite templating library. That being said, there are a couple helpers I add to every project to make it more useful in real work applications. (Note: all markup examples are using bootstrap

  • Fast Cross Browser jQuery Select Filter

    I was working on an existing SharePoint project which had a custom control with a large select list populated with a few thousand items. To make it easier to use the select list, a textbox was used which filtered the list as the user typed. It was ok in chrome, terrible in FF, and downright painful to use in IE. Below is my rewrite of the filter code which is instant across all browsers (IE8+, didn't have a 7 to test). The original function did the regex search on the existing list sets and removed items that did not match. To restore removed items as the search was cleared or letters removed from the search box, the rest of the options would be removed and then it would loop through a cached list of the original option set and append them to the DOM object of the select one at a time.