The combobox demo, has url attached while defining the combobox, instead i would like to transfer the control onChange to some other method and load once the response is available.
i used $(‘#jqxCombobox1’).jqxComboBox({source: data}); but the problem with this is, the searchString typed by user is lost when the data is available.
var source = {
datatype: “json”,
datafields: [
{ name: ‘id’ },
{ name: ‘name’ },
],
async: false
};
var dataAdapter = new $.jqx.dataAdapter(source);
$(“#jqxCombobox1”).jqxComboBox({
selectedIndex: 0,
source: dataAdapter,
displayMember: ‘name’,
valueMember: ‘id’,
minLength:3,
width: ‘100%’,
height: 22,
showArrow: false,
remoteAutoComplete: true,
placeHolder : ‘Search Something…’,
search: function (searchString) {
callMethod(searchString);
}
});
function callMethod(searchString){
//do something
// load data when available and after formatting
$(‘#jqxCombobox1’).jqxComboBox({source: data});
}