1

I want to call a web service and use it in combox for search. Here is the function that i used to call my service web:

var xmlhttp = new XMLHttpRequest();
var url = "http://176.31.230.211/mtmap/MapSrv.svc/getCities";
var params = JSON.stringify({
    sessId:"1",
    cityName:"ra"
});
xmlhttp.open("POST", url, true);

xmlhttp.setRequestHeader("Content-type", "application/json");

xmlhttp. önreadystatechange = function() {
        if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                console.log(xmlhttp.responseText);
        }
}
xmlhttp.send(params);

I created the ComboBox using the GeoExt bibliography:

var promosCombo = new Ext.form.ComboBox({   
 id : 'promosCombo',
 triggerAction : 'all',
 emptyText : "Ville, Avenue, Rue...",
 editable : false,
 store : promosStore,
 mode : 'local',
 valueField : 'value',
 displayField : 'display',
});

here is my store:

var promosStore = new Ext.data.JsonStore({
 url : 'http://176.31.230.211/mtmap/MapSrv.svc/getCities',
 fields : ['display', 'value'],
 root : 'rows',
 autoLoad : true
});

What i want exactly is when i start to tape in my ComboBox the list of the city appear so i can choose the city.

closed as unclear what you're asking by PolyGeo Oct 6 '18 at 5:34

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • a3ni what do you mean? – Hamri Said Mar 21 '17 at 19:09