Posts

Showing posts from April, 2019

Property Pane dynamic fields

Image
In most cases, we need to dynamically build the Property Pane based on some logics. Let's say we want to show some options only if some other property is chosen. In this article I show how to append a group of properties based on some logics. Let's say we want to show some information of a company's members. We want to choose a department, then a group of members that belong to that department and choose some of them's location. We can build a Property Pane Group that dynamically changes it's content. In this example, there is a function that returns an IPropertyPaneGroup object. That object contains an array of IPropertyPaneField objects. Inside the function we can implement all the logics to decide which fields we want to show and it's behaviours. In a helloworld project, we create the following function: private getConditionalGroup() : IPropertyPaneGroup{ let groupFields : Array<IPropertyPaneField<any>> = n