Привет, я использую angular с jqxWidget. В этом я использую jqxInput, который должен обновлять / загружать источник, основываясь на пользовательских значениях ввода, и тип источника данных json.
Здесь я могу получить данные из службы, но в раскрывающемся списке это не не показывать до тех пор, пока я не переместу курсор в текстовое поле jqxInputComponent назад.
import { jqxInputComponent } from 'jqwidgets-ng/jqxinput';
@ViewChild('inputReference', {static: false}) myInput: jqxInputComponent;
// during input I am trying to search contact details
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.ZoneKey
};
});
this.source.localdata = data;
// I am able to get correct response format till here
this.dataAdaptor = new jqx.dataAdapter(this.source);
// 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.
});
}
Пожалуйста, дайте мне знать, если у вас есть какие-либо предложения с использованием jqxInput.