This is a migrated thread and some comments may be shown as answers.

Autocomplete w/RemoteData and Knockout all inside a Template?

1 Answer 121 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Zach
Top achievements
Rank 1
Zach asked on 30 Nov 2012, 05:59 PM
We're trying to get the following scenario to work with no luck - can anyone shed light on this?

We have a jQuery template with a Kendo Autocomplete control inside (an input). The input must be bound to a remote datasource to allow filtering the results on the server. The input is used to pick a code from a set of 20,000+ codes, and the user can select more than one code, thus the input is templated - make sense? The user picks a code, then if another is desired they hit the "another code" button and the template fires off and a new Autocomplete control is born and so on.

We've spent days trying to get this to work but the combination of the Kendo autocomplete inside the jQuery template, plus the remote data source (which never works), plus ultimately binding the selected code to a model via Knockout, all that together paints a very complex picture. 

Here are some scenarios we did get working but none suffice for our project:

- use local data instead of a delegate to remote data. This is not good because it requires us to pull back 20,000+ possible codes onto the client

- binding the selected code to a model via Knockout - this actually works fine

Can anyone shed light? Thanks in advance!

1 Answer, 1 is accepted

Sort by
0
Accepted
Burke
Top achievements
Rank 1
answered on 30 Nov 2012, 07:44 PM
Hi Zach!

Can you explain more about exactly what isn't working?

I have tried to reproduce your scenario from what I understand and it was pretty easy to do.  Lets use this as a starting point and we can work from here.  This example uses Kendo UI MVVM (as I am not so familiar with Knockout), but I'm sure we can substitute it out when we get going.

http://jsbin.com/orisix/1

Cheers!
Tags
AutoComplete
Asked by
Zach
Top achievements
Rank 1
Answers by
Burke
Top achievements
Rank 1
Share this question
or