1

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();
  });
}
}
3

In the release note for RC0 it states:

BaseClientSideWebPart
...

  • Removed refreshPropertyPane (still on context object)

...
IWebPartContext
...

  • Moved isPropertyPaneRenderedByWebPart, openPropertyPane, refreshPropertyPane to IPropertyPaneAccessor

...

so use:

this.context.propertyPane.refresh();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.