0

How do we permanently store this data? For eg. I've a carousel component and I gave the autoPlay enable option in property pane, so user can configure the carousel. How I save this autoPlay property value (true/false), without loosing it when user is refresh the page.

1 Answer 1

1

If the page is in edit mode, assuming the setting has been implemented as a web part property, it should be automatically persisted.

4
  • How to persist if the page is not n the edit mode? How to force it manually ? I tried this.onPropertyPaneFieldChanged(targetProperty, oldValue, newValue); but it doesnot work
    – Student
    Commented Apr 4, 2018 at 20:33
  • 1
    If the page is not in edit mode, the properties won't be persisted, at least not in web part properties. You could store them in a cookie or local storage, but not in web part properties. Commented Apr 6, 2018 at 6:44
  • If I use a global variable, For 2 webparts it overrides the settings of first
    – Student
    Commented Apr 6, 2018 at 8:11
  • Users can put multiple instances of the same web part on the page, so you'd have to store them in key-value pairs, where the key is the instanceId of the particular web part. Commented Apr 9, 2018 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.