Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Linking spfx webparts together.

$
0
0

Hi,

I have a requirement to add two list webparts on an SP page. The end user will then be able to click on an item within one web part, which will then filter the other list. It will be modern experience and SP-Online ONLY.

I've discovered this: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/dynamic-data

which I'm willing to try but wonder if it's as simple as this (taken from the above document):

In its simplest form, the UI could be defined as follows:

ts
protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {return {
    pages: [
      {
        groups: [
          {
            groupFields: [
              PropertyPaneDynamicFieldSet({
                label: 'Select event source',
                fields: [
                  PropertyPaneDynamicField('event', {
                    label: 'Event source'
                  })
                ]
              })
            ]
          }
        ]
      }
    ]
  };
}

For each set of dynamic properties, add a new group using the PropertyPaneDynamicFieldSet method. For each dynamic web part property, add a PropertyPaneDynamicField, which will allow users to select from which property, the web part property specified in the PropertyPaneDynamicField should retrieve its data.

If your dynamic data field set consists of multiple dynamic properties, you can specify how the connection data is shared using the sharedConfiguration.depth property:

ts
groupFields: [
  PropertyPaneDynamicFieldSet({
    label: 'Address',
    fields: [
      PropertyPaneDynamicField('address', {
        label: strings.AddressFieldLabel
      }),
      PropertyPaneDynamicField('city', {
        label: strings.CityFieldLabel
      })
    ],
    sharedConfiguration: {
      depth: DynamicDataSharedDepth.Property
    }
  })
]

Can someone either link me a good tutorial or provide some sample code I can work off?


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>