简体   繁体   中英

“Personalize this Page” changes on Personal View not saving - sharepoint

Edited heavily - Original question below.

I have a custom list (installed from a feature) that is basically a calendar. The default month, week, and day views take advantage of a custom web part that injects javascript into the page for the purpose of adding background colors.

Users who wish to add a Personal View can do so, however the new personal views will not have the custom coloring web part on the page by default. The user can select "Personalize this Page" from the welcome menu and add the web part, but upon clicking "Exit Edit Mode" the web part disappears.

Why is this happening and how do I make it work?


I have a custom web part that injects some script tags onto the page. This web part is intended to be used on custom Calendar list to give some background colors to events of various Categories (a custom field). This works great on Shared Views, not at all on Personal Views.

If I create a Personal View and base it off of the default Calendar.aspx view, and then select "Edit this page" from the Site Actions menu, the calendar disappears. If I add the custom web part to the page and select "Modify this web part" I get the "A web part you attempted to change is either invalid or has been removed by another user."

Is it possible to add web parts to personal views? Is there a better way to achieve this custom background coloring?

UPDATE: The url of a personal view is something like this: .../Lists/CalendarName/PersonalViews.aspx?ShowWebPart={GUID}. If I remove the querystring then no calendar displays, but if I inspect the page contents the web part is actually rendering content! It does not render if the ShowWebPart={GUID} is present. Using the debugger, I see that it does not load at all as far as i can tell.

UPDATE 2: More weirdness. If I customize this page by selecting "Personalize this page" from the welcome menu, it lets me add my custom web part, and it looks great, but only until I click "Exit Edit Mode" and my custom web part disappears again.

Create your view, make it personal.

Personalize the page, adding your web part.

Then exit edit mode. In the query string, delete the &ShowWebPart=GUID part. Your personal web part should show up.

Personal views each have a GUID. The selector in a list view uses the querystring to show which view to display, hence the ShowWebPart parameter. I don't believe there is any way to override the behavior in the list selector to not use that ShowWebPart parameter, without great effort.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM