You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Within fields declaration in a PropertyFieldCollectionData, an optional 'render' property to allow for customizing the output individual items in a dropdown field.
PropertyFieldCollectionData('links',{key: 'linksKey',label: 'Links',panelHeader: 'Select update types',manageBtnLabel: 'Manage links',value: this.properties.links,fields: [
...buttonFields,{id: 'themeColor',title: 'Theme Color',type: CustomCollectionFieldType.dropdown,/* This is an example of how render method would be used */onRender: (option:IDropdownOption)=>{if(option.data&&!!option.data.color){constoptionClassName=getBackgroundStyle(option.data.color);return<divclassName={optionClassName}>{option.text}</div>;}else{returnoption.text;}}options: [{key: COLORS.themeDark,text: 'ms-themeDark',data: {color: COLORS.themeDark}},key: COLORS.themePrimary,text: 'ms-themePrimary',data: {color: COLORS.themePrimary}}],},]})exportconstCOLORS={themeDark: 'themeDark'themePrimary: 'themePrimary',};importmsBackgroundColorsfrom'./msBackgrounds.module.scss';exportfunctiongetBackgroundStyle(themeColor: string): string{letstyle;// get theme stylesswitch(themeColor){caseTHEME_COLOR.themeDark:
style=msBackgroundColors.themeDark;break;caseTHEME_COLOR.themePrimary:
style=msBackgroundColors.themePrimary;break;}returnstyle;}
Category
Version
1.10.0
Desired Behavior
Within fields declaration in a PropertyFieldCollectionData, an optional 'render' property to allow for customizing the output individual items in a dropdown field.
msBackgrounds.module.scss
Observed Behavior
There is no ability to customize the output of items PropertyFieldCollectionData dropdown type field,
Thanks!
The text was updated successfully, but these errors were encountered: