Вопрос

I'm trying to create a custom property pane field to allow the user to configure a list and then a list view to be used by the web part.

I followed the instructions of this Custom field example section.

First, the interface of the example code seems to be different from my environment. In my environment, onRender only takes the HTMLElement to render the custom control in. There's no context nor onChanged parameters.

Secondly, if I ignore those differences, I can get my control to render on the page but I can't figure out how to tell SharePoint to save the selected value to a property. I was looking at how the TextField works and there's a get value property that I tried implementing in my control but didn't have any luck.

Does anyone have a working example of a custom property pane field?

Это было полезно?

Решение

I've updated the documentation (https://github.com/SharePoint/sp-dev-docs/wiki/Integrating-Property-Pane) so that it now works.

For now, it's the responsibility of the developer to know what properties are being affected by the control (it could be one or many), and write them back to the host webpart.

I'll add one more thing. If you are doing this to populate a dropdown with SharePoint data, take a look at this post - SharePoint Framework web parts - dynamic properties pane

Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top