As I am following the tutorial (Use cascading dropdowns in web part properties) for learning the sharepoint framework. I did everything as mentioned in the article, but I am not able to access the method "refreshPropertyPane()". Please find the below where i am calling this method. By using this method I want to refresh the web part property pane after getting list of options from API. Please find the below code :
export default class ListItemsWebPart extends BaseClientSideWebPart<IListItemsWebPartProps> {
protected onPropertyPaneConfigurationStart(): void {
this.listsDropdownDisabled = !this.lists;
this.itemsDropdownDisabled = !this.properties.listName || !this.items;
if (this.lists) {
return;
}
this.context.statusRenderer.displayLoadingIndicator(this.domElement, 'options');
this.loadLists()
.then((listOptions: IDropdownOption[]): Promise<IDropdownOption[]> => {
this.lists = listOptions;
this.listsDropdownDisabled = false;
this.refreshPropertyPane();// ==> I am not able to access method.
return this.loadItems();
})
.then((itemOptions: IDropdownOption[]): void => {
this.items = itemOptions;
this.itemsDropdownDisabled = !this.properties.listName;
this.refreshPropertyPane();
this.context.statusRenderer.clearLoadingIndicator(this.domElement);
this.render();
});
}
}