I'd like to make a binding for knockout which uses the JQuery Autocomplete Combobox and allows for 2 way binding.
http://jsfiddle.net/rniemeyer/PPsRC/ from this question has gotten a start, but doesn't fully implement the combobox functionality as on the jQuery demo site. (ie. selection highlighting, button styling, button not submitting the form, etc.).
This is a bit late, but I have a two way autocomplete combo box binding in my Knockout UI library (see Dropdown). Take a look and see if it helps.
Thanks
I have used http://harvesthq.github.com/chosen/ in my projects. It works perfectly over standard HTML control SELECT. So I have used standard bindings for managing SELECT (options, value, selectionOptions) and additional custom binding chosen
to convert standard control to fancy one.
You could checkout usage example: http://jsfiddle.net/romanych/PcXrP/6/
There is code of binding. It is pretty simple
ko.bindingHandlers.chosen = {
init: function(elemenet, valueAccessor) {
var chosenOptions = ko.utils.unwrapObservable(valueAccessor());
$(elemenet).chosen(chosenOptions);
},
update: function(elemenet, valueAccessor, allValuesAccessor) {
// Subscribe to any change of underlying SELECT-element
ko.utils.unwrapObservable(allValuesAccessor().value);
ko.utils.unwrapObservable(allValuesAccessor().options);
ko.utils.unwrapObservable(allValuesAccessor().selectedOptions);
$(elemenet).trigger("liszt:updated");
}
};