View Full Version : autocomplete textfield data from webservice

30 Aug 2012, 2:43 AM

i am unable to get data from a web service to combo box and i have to made this combo box as autocomplete field. Please give me the comple code for this. Thanks in advance for help.

30 Aug 2012, 4:57 AM
You could have a look at this: http://docs.sencha.com/ext-js/4-1/#!/example/form/forum-search.html

30 Aug 2012, 5:25 AM
in place of url i hv given webservice path and method name but i an unable to get. Thanks in advance

30 Aug 2012, 5:37 AM
It is not coming in place of url if we give webservice name and method name can u modify the code available and send me the modified code for my problem ? Thanks in advance

30 Aug 2012, 5:38 AM

Here is sample example for filling combobox from DB table-

GenresWebService.asmx (webservice)

using System.Web.Script.Serialization; // Add this namespace for serialization

public class GeneresWebService: System.Web.Services.WebService
public string GetGeneres()
SqlConection con = new SqlConection(conectionString);
String sql = "SELECT genre_id, genre_ame FROM generes_movie" ;
SqlDataAdapter da = new SqlDataAdapter(sql, con);
DataSet genres = new DataSet();
da.Fill(genres, "movie_geners");

JavaScriptSerializer jss = new JavaScriptSerializer();
string json = jss.Serialize(genres);

return "{items: " + json + "}";



var movie_genres = new Ext.data.Store({
reader: new Ext.data.JsonReader({
fields: ['genre_id', 'genre_name'],
root: 'items'
proxy: new Ext.data.HttpProxy({
url: '../GenresWebService.asmx/GetGenres'
;var movie_form = new Ext.FormPanel({
url: 'movie-form-submit.aspx',
renderTo: 'myform',
frame: true,
title: 'Movie Information Form',
width: 400,
defaults: {
anchor: '100%'
items: [{
xtype: 'combo',
typeAhead :true ,
hiddenName: 'genre',
fieldLabel: 'Genre',
mode: 'remote',
store: movie_genres,
displayField: 'genre_name',
valueField: 'genre_id'