knockout-jqAutocomplete icon indicating copy to clipboard operation
knockout-jqAutocomplete copied to clipboard

data-bind options as list rather than object

Open mcshaz opened this issue 10 years ago • 1 comments

in order to

  • emulate existing ko behavior, such as the 'options' binding
  • flawlessly fit in with plugins like the knockout validations library

I would suggest the binding syntax change from:

<input data-bind="jqAuto: { value: myValue, source: myOptions, inputProp: 'name', labelProp: 'description', valueProp: 'id' }" />

to

<input data-bind="value: myValue, jqAutoSource: myOptions, jqAutoInputProp: 'name', jqAutoLabelProp: 'description', jqAutoValueProp: 'id'" />

this would involve using the allBindingsAccessor, rather than just the valueAccessor. I am happy to make these changes & make a pull request if there is feedback that this is a useful (although breaking) change - I guess in the first instance both syntaxes should be accounted for.

mcshaz avatar May 23 '15 09:05 mcshaz

I would not necessarily be opposed to allowing additional syntax, but it would be best to be backwards compatible. The other challenge that I see is that the existing value binding adds its own handlers.

rniemeyer avatar May 28 '15 02:05 rniemeyer