Posts for jquery


  • 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.