https://github.com/bryanlarsen/hobo-jquery/commit/f4c38038d323ec0326a7d6974185c275df1b0879
Here's the documentation:
Creates an enhanced version of the [jQuery-UI demo
combobox](http://jqueryui.com/demos/autocomplete/#combobox). This
will turn any select (even a select-many) into a combobox.
NOTE: backwards compatibility with the Hobo&Rails prototype/lowpro
handlers requires event.simulate.js. You may need to rerun your
hobo_query:install generator to copy this file into your application.
Standard usage:
<hjq-combobox>
<select .../>
</hjq-combobox>
If you don't supply the select, it will use Hobo's `<input>` tag.
This is usually the right default.
You can tell Hobo to always use a combobox for select-one,
select-many, select-input and/or select-menu.
<extend tag="select-one">
<hjq-combobox tag="select-one">
<old-select-one merge/>
</hjq-combobox>
</extend>
To make the behavior more like the demo's, turn off autoFill & clearButton:
<hjq-combobox autoFill="&false" clearButton="&false"/>
Combobox is a new control that is built on autocomplete. The
autocomplete options may not be used directly. If you need any of
them let me know -- they shouldn't be too hard to add if you volunteer
to test them.
### Attributes
- `autoFill` (default: true): select first value rather than clearing
if there's a match
- `clearButton` (default: true): add a "clear" button
- `adjustWidth` (default: true): if true, will set the autocomplete
width the same as the old select. (requires jQuery 1.4.4 to work on
IE8)
- uiStyle (default: false): if true, will add classes so that the
autocomplete input takes a jQuery-UI style. If false, the standard
Hobo style is used.
### Events
- `selected` (default: `$(this).simulate('change');`): this is a
jQuery-UI event handler. The default value for this option fires the
`onchange` handler on the underlying `select` in a manner compatible
with both prototype.js and jQuery. For this to work,
event.simulate.js must be loaded, and jQuery must be put into
noConflict mode. hobo-jquery should be doing both of these for you if
you are using it as recommended in the README.
cheers,
Bryan
Thank you Bryan!
This control looks very nice, I'll certainly try it in a couple of big
selects I wanted to change :)
Regards,
Ignacio
El 17/06/11 16:53, Bryan Larsen escribi�:
- --
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk39f1kACgkQBPlUJ6RHaORu9QCdG77LhePh33+im46DC8q/M83F
/QAAn0C76/oPpiutZNGWCQxOoxkg8AvX
=+r3b
-----END PGP SIGNATURE-----
By the way, the biggest reason why hobo-jquery only contains a subset
of jQuery-UI is because I personally do not have a use for the widget.
And since an untested widget is a broken widget, it's not in
hobo-jquery.
But if anybody is willing to help with development & testing, most
jQuery-UI and plugin widgets are not hard to add to jQuery-UI.
Bryan
> --
> You received this message because you are subscribed to the Google Groups "Hobo Users" group.
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to hobousers+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
>
>
If they cannot enter new values, I suggest changing your schema to add
ElementarySchool and HeatingSystem models. Then you would
automatically get a select-one element, which you can convert to
hjq-combobox by using <hjq-combobox/> instead of <input/>.
If they can enter new values, then your current schema makes sense.
<hjq-autocomplete source="&ModelName.all.*.elementary_school.uniq"/>
(This could be made more efficient if you got the database to do the
uniqifying).
Bryan