How can I save the state of the web part on the content page of the client web part?

I just set up and created the first time SharePoint development efforts: a project for the web part that will be hosted on a copy of SharePoint Online (my office 365).

I figured out how to use the list API to pull out the content that I have to present as a rotating list of banner images, but I have one more problem. I would like to keep track of where I am on the list and when was the last time I changed images. My other question gives me a pretty good attitude to local storage, but is there any SharePoint REST or JSOM API that can be used to save this state in the SharePoint service?

+6
source share
1 answer

I like the answer from local storage, but you can also write status information to another SharePoint list.

Keep track of the information based on each user (possibly against their user ID, as they are likely to be authenticated) and send an AJAX request or JSOM request with no visible callback behavior every time the view state changes (maybe even use a web artist for users, who support them).

Writing information to SharePoint lists is not the fastest operation in the world, so it’s possible that you could turn the banner, fire the request and the user close the browser before the request is completed, but in this case they will simply start on the same slide on which they were before (so just repeat the last step in the rare case when this happens).

+1
source

Source: https://habr.com/ru/post/979319/


All Articles