AutoComplete in Jquery using knockout js

2019-07-27 07:47发布

问题:

I am trying to do autocoplete using jquery.

I am using Editable Grid.Like this

I tried to implement autocomplete the editable textbox present in the grid. [My Code][http://jsfiddle.net/bhagirathip/x6H8s/4/]

Please figure out the what i did wrong .

when I trying to do autocomplete without Knock Out js queries it working fine but when i trying with the knock out js query it is not working .

Please figure out where i have done mistake.

Thanks in advance

回答1:

You should create a custom binding for autocomplete. Here is binding created by Ryan Niemeyer - How to create an auto-complete combobox?.



回答2:

Apparently from the code you have posted, you are actually trying to initialize autocomplete before the elements are created.

The applybinding will bind your data on iddle (after a timeout of 0 ms) which means after the $() has returned and more important after the $('.txtMemberSearch').autocomplete({...}) has run.

I think you should try Artems proposal.