let newItem: { [key: string]: Object } = {
Name: customValue,
Code: customValue
};
// new object added to data source.
(this.comboObj.dataSource as Object[]).push(newItem);
// close the popup element.
this.comboObj.hidePopup();
// pass new object to addItem method.
this.comboObj.addItem(newItem);
// select the newly added item.
this.comboObj.value = customValue; |
public customValueSpecifier(args) {
// I try to change user enterd value
let text = args.text;
if (text === "Holland") {
text = "Nederland";
}
const newItem: { [key: string]: any } = { Name: text, Code: text };
// close the popup element.
this.comboObj.hidePopup();
// pass new object to addItem method.
this.comboObj.addItem(newItem);
// select the newly added item.
this.comboObj.value = text;
// The bounded variable updates OK, but combobox doesn't reflect the change
console.log(this.country);
} |
public customValueSpecifier(args) {
let text = args.text;
if (text == "Holland") {
text = "Nederland";
}
const newItem: { [key: string]: any } = { Name: text, Code: text };
this.comboObj.addItem(newItem);
// select the newly added item.
this.comboObj.value = text;
// The bounded variable updates OK, but combobox doesn't reflect the change
console.log(this.country);
setTimeout(() => {
(this.comboObj as any).inputElement.value = text;
}, 10);
} |