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

Don't care for query string...

2 Answers 268 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Gabriel
Top achievements
Rank 1
Gabriel asked on 24 Dec 2011, 01:19 AM
I'm trying to create an autocomplete box. My web service uses MS Web API and I'd prefer to pass the value of autocomplete input field to the URL like this:
.../getProducts/sku=VALUE FROM FIELD

How would I go about this? If not, is one able to form a proper query string that won't need additional parsing to get a the value out? I've noticed the query string does not contain traditonal key/values.

I've also noticed the query string is chock full of crap despite me not specify paging, filtering, etc. I will be handling all this on the server and don't need to specify these items. Is it possible to remove this too?

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 26 Dec 2011, 09:46 AM
Hi,

 You should use the parameterMap setting of the transport to send a query string parameter:

$("#autocomplete").kendoAutoComplete( {
  dataSource: {
    transport: {
      read: "...",
      parameterMap: function() {
         return { sku: $("#autocomplete").data("kendoAutoComplete").value() };
      }
   }
  }
});

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Gabriel
Top achievements
Rank 1
answered on 26 Dec 2011, 11:33 PM
Thanks, works a treat.
Tags
AutoComplete
Asked by
Gabriel
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Gabriel
Top achievements
Rank 1
Share this question
or