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.


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

| improve this answer | |
  • 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 Apr 4 '18 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. – Waldek Mastykarz - MVP Apr 6 '18 at 6:44
  • If I use a global variable, For 2 webparts it overrides the settings of first – Student Apr 6 '18 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. – Waldek Mastykarz - MVP Apr 9 '18 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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