AutoComplete Using WCF

111 views
Skip to first unread message

Muhammad

unread,
Mar 9, 2012, 7:41:45 AM3/9/12
to Juice UI
Hi,

I am using Juice Autocomplete and would like to get the data from an
ajax enabled wcf. The webservice works fine and returns the data in an
array of strings.


Data From Ajax Enabled WCF:

{"d":["20417 ","20418 asdfsdfs","20419 ","20420 Quotation Test
1","20421 Test Job 1","20422 Test Job 2","20424 New Job Create
Quotation Using Tariff","20425 New Job Quotation using Tariff
1","20426 New Quotation Tariff 2","20427 New Job New Tariff","20443
sdfsfsa","20480 Fulfilment Log Job","20489 Test JOb","20491 test
job","20492 Test Job","20495 Test Job 20Feb2011 19:54","20497 Test
Job","20498 2nd Test Job"]}


Below is my given code.

<asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
<juice:Autocomplete ID="jAutocomplete" Source="http://localhost:2817/
DNN564/PSService.svc/getjobs" TargetControlID="txtsearch"
runat="server" />

Andrew Powell (appendTo)

unread,
Mar 9, 2012, 7:57:23 AM3/9/12
to jui...@googlegroups.com
At the moment Juice UI only supports setting the autocomplete source using an array of strings. This is a bug and it's being tracked here: https://github.com/appendto/juiceui/issues/11

Juice UI 0.9.1 will allow a source URL as you've attempted to use there.

As a temporary workaround, set the ClientIDMode on the TextBox to "Static" and use the following javascript:

<script>
  $(function(){
    $( "#txtSearch" ).autocomplete( "option", "source", "http://localhost:2817/ DNN564/PSService.svc/getjobs" );
  });
</script>

That should allow you to use the remote data source with Juice UI until 0.9.1 is released.

Cheers
Reply all
Reply to author
Forward
0 new messages