Live data from Hacker News

Make Better Select Boxes with Chosen

harvesthq.github.com

51–60 of 89 posts

Re: Make Better Select Boxes with Chosen

#52
We've been using it for some time now, but it renders differently across different browsers with subtle alignment and padding issues. In the end, we just disabled it on anything less than IE8 and not one of the major web rendering engines. But it's pretty.

Re: Make Better Select Boxes with Chosen

#55
post #53

These are sexy. If you are looking for ideas, it would be really cool to see an improved scrolling of some kind. Still feels 1.0 with the ugly blue scrollbar. Something like this but with softer colors: http://i.imgur.com/ixqa6.jpg

I'm a fan of the look of the transient scrollbars, not so much that they disappear though.

Re: Make Better Select Boxes with Chosen

#56

We've been using this for what feels like 9 months with Picplum. One thing we did is for on select menus with few items, we hide the search box: $(".recipient_relation").chosen disable_search_threshold: 10 And if in Backbone you'd like to have it preselect the value, run something like this after render (so you don't have to add much logic to your handlebar template for the markup): @$("#address_country_field option"…

Is the element you are binding chosen to visible from the start? I'm finding that chosen does not like to be bound to an element until it is visible. I tend to do a lot of setup on render of fields that are hidden and displayed later in the same view, but chosen throws an error on 'searchfield[0]'.

Correct, it's called after render puts the view into the DOM

Re: Make Better Select Boxes with Chosen

#57
post #22

I've been using this a lot in our projects. It would be really a killer for selects with thousands of items. But it really kills the performance at least with Firefox. For small country selects it's still fine.

If you have selects with thousands of items, you really need a better navigation scheme than a select box, even if it does have search.

Re: Make Better Select Boxes with Chosen

#58

The project "rationale" has a lot of holes in it. > Instead of forcing your users to scroll through a giant list of items, they can just start typing the name of the item they were looking for. Who's forcing? Modern browsers allow a user to type (in lowercase) text to find in a select element while focused and will scroll to an exact match inside of it. It would require some instructions, but deviations of that behav…

I don't think 'massively bloated' is a fair way to describe either jQuery or Prototype. Both of these libraries offer a lot. A better way to say it would be 'picked up some weight recently'. That being said, I agree that this would be better off without jQuery; when every millisecond, every kilobyte matters, jQuery is simply off the table.

I agree with you that 'massively bloated' is a huge overstatement, and this plugin is clearly intended for desktop-style apps as an improvement to the default desktop-browser's select element. In desktop-land the 32kb it takes to download jQuery (min+gz) is absolutely nothing, and easily overshadowed by a single image file.

Perspective: My company has a jQuery/jQueryUI single-page web app (with MVC underpinnings) which serves a number of commercial customers very successfully. Does it matter that the whole app (which includes this plugin) may take 2-10 seconds to load from a cold-cache? No. After that there is absolutely zero load time throughout the entire app.

Btw, we also don't care about oldIE because we can insist commercial customers install Chrome-frame, which they are generally happy to do. They'd much rather that than we push a new 'native' desktop app at them and require them to install a .NET or Java runtime.

I wish people moaning about bloat and browser-support would actually think about the developers out there building products for very really use-cases that don't match their own mythical high-expectations of 'zero footprint/works-everywhere'. Some of us just want to get work done for paying clients and plugins like this are absolute life-savers.

Re: Make Better Select Boxes with Chosen

#59

There is a newer project named Select2 now which handles remote data sets and offers infinite scrolling: http://ivaynberg.github.com/select2/ (Tried to submit it as a story the other day but zero upvotes.)

Thanks! This is considerably smaller than I expected it to be as well (7KiB minified) which is an acceptable size to chuck into our site.
Post reply on HN