Skip to content

Instantly share code, notes, and snippets.

@chrisobriensp
Last active April 16, 2019 07:14
Show Gist options
  • Select an option

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

Select an option

Save chrisobriensp/d0696bb23ece2297ffecdb3076cae9f5 to your computer and use it in GitHub Desktop.
Showing a simple way of populating an SPFX dropdown with code. See http://cob-sp.com/SPFx-WP-Props2
private fetchOptionsSimple(): Array<IPropertyPaneDropdownOption> {
var options: Array<IPropertyPaneDropdownOption> = new Array<IPropertyPaneDropdownOption>();
options.push( { key: 'Added1', text: 'Added from code 1' });
options.push( { key: 'Added2', text: 'Added from code 2' });
return options;
}
protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
var fetchedOptions: Array<IPropertyPaneDropdownOption> = this.fetchOptions();
// other code for property pane here..
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment