I have a listbox as shown below
<ejs-listbox [dataSource]="this.data" height='250'></ejs-listbox>
Array 'data' is declared in the typescript code:
public data = ["item1", "item2", "item3"];
There is a button in the page. When clicking it, a new item is added into data.
onButtonClick() {
this.data.push("item4");
}
The problem is: my listbox does not refresh automatically to reflect the update of its data source. I have to switch to another page and switch back in order to see the change.
What is the correct way to achieve the automatic refresh of listbox? Thanks.