Hi I a trying to get data from a service and then I am trying to integrate it with jqxInput in angular. Even though I am able to get data from service, data binding is not working correctly. In dropdown I am not able to get data until and unless I change the cursor position.
Please let me know if you have any suggestion using jqxInput.
source = {
datatype: 'json',
datafields: [{
name: 'label',
type: 'label'
},
{
name: 'value',
type: 'value'
}],
localdata: [],
data: {
maxRows:10
}
}
oninput(event){
this.dataAdaptor = new jqx.dataAdapter(this.source);
this.contactService.search(event.args.item.value).subscribe( res => {
// Some code to checking normal conditions then finding value
//After checking conditions running below code
let data = res.resObj.map((item) => {
return {
label: item.userName,
value: item.ContactNumber
};
});
this.source.localdata = data;
// I am able to get correct response format till here
this.dataAdaptor = new jqx.dataAdapter(this.source,{
autoBind: true});
// here when I am trying to open dropdown/suggesion, it shows null
this.myInput.opened(true);
// it shows values only on change on cursor position.
});
}