I'm trying to have my events list display as a calendar view in a Sharepoint-hosted app written using JavaScript and the Client Side Object Model.
Here's the code I'm using.
From Default.aspx:
<WebPartPages:WebPartZone runat="server" FrameType="None" ID="CalendarWebPart" />
From the Elements.xml associated with Default.aspx:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="Pages">
<File Path="Pages\ClientWebPart.aspx" Url="Pages/ClientWebPart.aspx" ReplaceContent="TRUE" />
<File Path="Pages\Default.aspx" Url="Pages/Default.aspx" ReplaceContent="TRUE">
<View
List="Lists/Paid Time Off List"
BaseViewID="2"
WebPartZoneID="CalendarWebPart"
WebPartOrder="1"
Type="CALENDAR"
Scope="Recursive"
RecurrenceRowset="TRUE">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart,Microsoft.SharePoint,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">My Calendar</property>
<property name="InplaceSearchEnabled" type="bool">False</property>
<property name="ShowToolbarWithRibbon" type="bool">False</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</View>
</File>
I see this even though BaseViewID="2"
definitely is my calendar view:
I expected a calendar view like this (this is the calendar for my events list, from /Lists/Paid Time Off List/Calendar.aspx):
'
Any idea why the Calendar view isn't working inside of my webpart, but works fine when I go to the page for the calendar view?
Note: My code is based on the code found here: http://www.greggalipeau.com/2013/12/25/adding-list-views-to-sharepoint-2013-apps/
Maybe this is a potential solution, but I don't understand the process this author is proposing: http://cameron-verhelst.be/blog/2013/03/24/sharepoint-2010-calendar-view-on-xsltlistviewwebpart/