Skip to content

Instantly share code, notes, and snippets.

@chrisobriensp
Last active January 23, 2017 23:09
Show Gist options
  • Select an option

  • Save chrisobriensp/01fdefae59df9a323b853637ef4f0cb8 to your computer and use it in GitHub Desktop.

Select an option

Save chrisobriensp/01fdefae59df9a323b853637ef4f0cb8 to your computer and use it in GitHub Desktop.
SPFX propertyPaneSettings() code for a PropertyPaneDropdown populated dynamically. See http://cob-sp.com/SPFx-WP-Props2
protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
if (!this.listsFetched) {
this.fetchOptions().then((response) => {
this.dropdownOptions = response;
this.listsFetched = true;
// now refresh the property pane, now that the promise has been resolved..
this.onDispose();
});
}
return {
pages: [
{
header: {
description: "Basic settings"
},
groups: [
{
groupName: "COB dropdown field (PropertyPaneDropdown)",
groupFields: [
PropertyPaneDropdown('dropdownProperty', {
label: 'This is the label',
options: this.dropdownOptions
})
]
}
]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment