<script src="/Style%20Library/JQuery-1.5.1.min.js" type="text/javascript">
</script>
Sorry for the miscommunication.
It's been awhile since I've posted any ground-breaking new discoveries, so I thought I would pass on a bit of info about the Group Calendar and displaying default groups. Disclaimer: this is still in beta, and not running on a production site yet.
I've stumbled across a few blog posts about the group calendar, and the need to display a default set of resources on the calendar. The OOB functionality requires the user to select a resource/resource group before items show up on the calendar. Being the stubborn developer that I am, I decided that I would come up with a fix for this based on a specific requirement from one of our Business Units. This solution works for Resource Groups, but I'm sure it can be modified to easily display resources or people, depending on your requirements.
Looking at the calendar in action, you will quickly realize that the calendar uses the picker dialog for selecting resources, and AJAX to render selected items on the calendar. So, how does one go about calling the necessary functions to populate the calendar? Magic! ;-)
I started by viewing the source of the parent page to get an idea of what was actually taking place when the picker dialog closes. Here is the event you are looking for:
Great! But how does this help you? You may notice that the dialog result is xml, and that setting the result requires a call to SP.UI.ApplicationPages.CalendarSelector.instance().getSelector(type, id). After a bit of searching in the SP.UI.Calendar.debug.js file, I found some information around the ResourceSelector and retrieving the selector type. If you do a search of the source code in your view source window for "add_resource", you'll see that the "Add Resources" link attribute "evtid" is "add_resource". Searching through the SP.UI.Calendar.debug.js on "add_resource" yielded this handy bit of information:
$p0.$z('add_resource', Function.createDelegate(this, function ($p1_0) {
__spPickerDialogFunc(1, this.$w_1, true);
}));__spPickerDialogFunc(1, this.$w_1, true);
This shows that the type is 1, and add = true. Once I had that information, I just needed to track down the XML data being passed from the picker dialog. That's where Fiddler comes in. If you aren't familiar with Fiddler, you should be. I won't go into too much detail, but will give you the gist below.
First, I opened an instance of fiddler and launched IE, browsing to my home page (which contains my group calendar). I then clicked the "Add Resources" link, and added a Resource Group called "All Computers" and clicked "OK".
You'll see below that the events now display for each resource in the calendar.
I then went into fiddler, and took a look at the final request from Picker.aspx, and began scanning the TextView for any information that might be helpful.
And there it is, in an ecma encoded string. The full XML return value from the dialog window. I copied the ret variable and began scripting a new function for the home page.
NOTE: If you don't already know this, you can build your javascript into an html or txt file and upload it to a document library for reference in a Content Editor Web Part. I've found that if you just paste the javascript directly into the Content Editor, SharePoint has a nasty habit of correcting it for you, which can really break your code. I typically put my text/html files into a folder called "ctrl" in the Style Library. That way, if I reuse the code on multiple pages, I can update one single file and call it a day.
Here is my final script to populate the calendar:
<script type="text/javascript" src="/Style Library/Jquery.min.js"></script>
<script type="text/javascript">
function _setDefaultResources() {
var el = $(".ms-acal-rootdiv");
var xml = "\u003cEntities Append=\u0022True\u0022 Error=\u0022\u0022 DoEncodeErrorMessage=\u0022True\u0022 Separator=\u0022;\u0022 MaxHeight=\u00223\u0022\u003e\u003cEntity Key=\u0022All Computers\u0022 DisplayText=\u0022All Computers\u0022 IsResolved=\u0022True\u0022 Description=\u0022\u0022\u003e\u003cExtraData\u003e\u003cArrayOfDictionaryEntry xmlns:xsi=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema-instance\u0022 xmlns:xsd=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema\u0022\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003eResourceMembers\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003e1;#Computer 01;#2;#Computer 02;#3;#Computer 03;#4;#Computer 04;#5;#Computer 05;#6;#Computer 06;#7;#Computer 07;#8;#Computer 08;#9;#Computer 09;#10;#Computer 10;#11;#Computer 11;#12;#Computer 12;#13;#Computer 13;#14;#Computer 14;#15;#Computer 15\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003eSPResourceId\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003e30\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003ePrincipalType\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003eResourceGroup\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003c\u002fArrayOfDictionaryEntry\u003e\u003c\u002fExtraData\u003e\u003cMultipleMatches \u002f\u003e\u003c\u002fEntity\u003e\u003c\u002fEntities\u003e";
var sel = SP.UI.ApplicationPages.CalendarSelector.instance().getSelector(1, $(el).attr('ctxid'));
sel.selectEntities(xml, true);
}
<script type="text/javascript">
function _setDefaultResources() {
var el = $(".ms-acal-rootdiv");
var xml = "\u003cEntities Append=\u0022True\u0022 Error=\u0022\u0022 DoEncodeErrorMessage=\u0022True\u0022 Separator=\u0022;\u0022 MaxHeight=\u00223\u0022\u003e\u003cEntity Key=\u0022All Computers\u0022 DisplayText=\u0022All Computers\u0022 IsResolved=\u0022True\u0022 Description=\u0022\u0022\u003e\u003cExtraData\u003e\u003cArrayOfDictionaryEntry xmlns:xsi=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema-instance\u0022 xmlns:xsd=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema\u0022\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003eResourceMembers\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003e1;#Computer 01;#2;#Computer 02;#3;#Computer 03;#4;#Computer 04;#5;#Computer 05;#6;#Computer 06;#7;#Computer 07;#8;#Computer 08;#9;#Computer 09;#10;#Computer 10;#11;#Computer 11;#12;#Computer 12;#13;#Computer 13;#14;#Computer 14;#15;#Computer 15\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003eSPResourceId\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003e30\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003ePrincipalType\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003eResourceGroup\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003c\u002fArrayOfDictionaryEntry\u003e\u003c\u002fExtraData\u003e\u003cMultipleMatches \u002f\u003e\u003c\u002fEntity\u003e\u003c\u002fEntities\u003e";
var sel = SP.UI.ApplicationPages.CalendarSelector.instance().getSelector(1, $(el).attr('ctxid'));
sel.selectEntities(xml, true);
}
ExecuteOrDelayUntilScriptLoaded(_setDefaultResources, "sp.ribbon.js");
</script>
</script>
A few important items to note... if you have multiple calendars on a single page, you will need to find the id of the calendar you are populating. The ctxid is actually a dynamically populated id (via javascript) of the web part context, which in this case is WPQ2. Make sure that you are using the ExecuteOrDelayUntilScriptLoaded( function, "sp.ribbon.js") call. The context id of the web part is not assigned until sp.ribbon.js is fully loaded. Once you have all that, it will work like a charm.
As always, if you have any questions, feel free to ping me. Hopefully, this will save you some time and make you look like a rockstar!
This worked great. Thanks for the information. I would like to create a second calendar view for a different group of resources. I'm not quite sure how to identify the right calendar by ID and what code I would need to add to make this happen. Can you add information on how this could be accomplished?
ReplyDeleteThanks again.
That's a great question! What I typically do is view source on the web part page and do a search for the title of my web part, e.g. Group Calendar Computer Lab. What you'll need to do after that is look for the <td id="MSOZoneCell_WebPartWPQ[number]" that surrounds the web part. the WPQ[number] is the ID you are looking for when populating the selector using my script.
ReplyDeleteAs I mentioned in my post, WPQ2 was the context ID that I needed, but your web part may have another context ID. The context ID is always in the WPQ[number] format however.
Hi Thomas
DeleteThanks for you awesome workaround.
Where multiple calendar are placed on the page, would this be the correct format to use?
var sel = SP.UI.ApplicationPages.CalendarSelector.instance().getSelector(1, $(el).attr('WPQ3'));
I think you have to do it like this:
Deletevar sel = SP.UI.ApplicationPages.CalendarSelector.instance().getSelector(1, "WPQ3");
That’s brilliant! Thanks for sharing it. Can you think of a way of dynamically generating the list of items and pumping it back into your functions? I’m just thinking of the long term maintenance.
ReplyDeleteI could maybe do it with a back end powershell script that queried the resource list and generated a JavaScript file with a variable ‘items’ or something, but that seems overly complex.
Aaron,
ReplyDeleteResources are stored in a list in SharePoint. You can easily query list data via javascript/jQuery using Marc Anderson's SPServices jQuery library:
http://spservices.codeplex.com/
The trick would be to format the response into accepted XML format so you could pass it back in to the Calendar Selector. I'm sure you could do a javascript replace with a dynamic string, similar to .NET String.Format('{0}', variable). I'll play around with it when I have some free time, and let you know what I come up with, but it wouldn't be too difficult.
Hi Thomas, i’v got something that works but it’s very messy.
ReplyDeleteIv taken your code and added a variable items that is included when setting them xml variable.
Then built an empty data view in SharePoint designer after a lot of trail and error, filled it with (ID), (Name) from resources and formatted it so it pumped out the correctly formatted text:
“#5;#Canon EOS 5D Digital SLR;#6;#Laptop1: Macbook pro;#7;#temp1;#8;#temp2;#9;#time3”
Then played around with the XSL code so that it stored the text into a JavaScript variable items.
Then added both web parts to the page with the calendad and it worked.
Sorry I’m more of a network administrator than developer, so not really that easy to follow and not very clean but it works.
Ill give SPServices a go.
Hi Thomas!
ReplyDeleteI wanted to use this soution but i can't do what is suposed to be done. Like, where do i find the Style Library and how can i put there a doccument and make the rest..!
Keep in mind that i started today "playing" with Sharepoint!
Thank you ! :)
Anonymous,
ReplyDeleteFirst off, thanks for your interest. I would suggest a few basic links to help get you started in SharePoint. One of my favorite sites is http://channel9.msdn.com/. There is a tremendous amount of information on this site, and some really good videos.
The Style Library is located at your top-level SharePoint site, e.g. http://[siteurl]/Style Library/ or if you are in a site collection below the top-level site, http://[siteurl]/sites/[site name]/Style Library. You can also get to the Style Library using the Site Actions menu "Site Actions > View All Site Content > Style Library.
I typically use the Style Library for all of my SharePoint resources within a site such as: custom css, custom html, custom javascript, and global images. If you don't have access to the style library though, you can use a document library and upload your files there.
I would definitely suggest starting with a few training videos to see how SharePoint works. Focus on the content editor web part, as this is how you will include your script on the page where your calendar is being displayed.
Thomas
Thomas, i forgot to say my name! It´s André!
ReplyDeleteI would start to see some videos on content editor web part so i can understand a little better that part!
Thank you for your time and quickness :)
André
Hi Thomas!
ReplyDeleteI have found a way to do what you have told and created a Content Editor Web Part and made a link to the txt file that you have told.
Then in the Style Library linked the j.query to the file.
But it´s not working, the only diference is the ribon in the top it's missing.
What can i do?
Tks for the help :)
André
Hello,
ReplyDeletethanks for this great post, it works fine :)
By the way, do you have any clue on how to get it work to populate users ?
Thanks
Sylvain
Thank you so much for posting this, and to the commenters like Sylvain who provided additional info. You really saved my bacon. I blogged your solution here: http://amatterofdegree.typepad.com/a_matter_of_degree/2011/08/bacon-savers-1.html.
ReplyDeleteI'm following the procedures but I can't go any further beyond "Here is my final script to populate the calendar:"
ReplyDeleteI've created the javascript files and saved in /Style Library/ctrl/GroupCalendar.js
So what's next? Sorry this question sounds stupid but I have no experience on dev.
Outstanding, really did the trick for moving my project forward. Only question I have is, when I goto create an event all my resouces are added, is there a way to remove them other then select all\remove? Or maybe I'm missing some thing not sure, let me know if you have some time.
ReplyDeleteThanks again...
hello,
ReplyDeletei am Jim from Italy. This script is great. Is there a possibility to delete the link "add ressources" in the view. So that a normal user can`t ad ressources.
thank you
Hi
ReplyDeletethis worked great for me both for resources and people.
There is only 1 strange thing: in the group calendar page now i'm missing the "Calendar Tools" tab from the ribbon... I can only see the "Browse" tab.
How do you get this to show people?
DeleteThis comment has been removed by the author.
DeleteI guess it has something to do with having multiple web parts on a page... :(
ReplyDeletehttp://www.glynblogs.com/2011/02/list-view-selector-missing-with-multiple-web-parts-in-sharepoint-2010.html
I am encountering similar problem with Mr. Civilization... when I create an event, the system take all resources to next reservation form, is there anyway to book one particular resource instead of all?
ReplyDeleteA great post!
ReplyDeleteI have a small project need help. Please contact me if you feel interest, my email: itseraph@gmail.com, thanks.
how do you add the script to sharepoint where do yo put it and how does it execute.
ReplyDeleteDarren,
DeleteYou can add a script using the <script> tag in a content editor, or you can add it to the <head> tag using the <script> tag via SharePoint designer.
T
What would I change to add 3 users for example
ReplyDeleteand
Jquery.min.js is that file already in Sharepoint or do I need to download it from somewhere and upload it to the SharePoint Server?
and
do I create an HTML page and paste this script in the head of the html page and then copy the whole lot into the content editor?
thanks
You need to follow the steps to determine what you need to pass via fiddler. At that point, you would modify the "var xml = " with the new values you get from fiddler.
DeleteI got the values from fiddler, added the jquery.min.js to my top level site and did the var sel2 line. What am I missing? It's still not working.
DeleteCould someone post the entire code that works for people, not resources?
Hi Thomas,
ReplyDeleteFirst of all thanks for this lovely tip.
I' ve applied this to our SharePoint 2010 resources calendar but it works only on my user account, so it didn't work for other sharepoint users. Could you help me please, how can I populate the calendars for all users.
Cheers
Hi Thomas,
ReplyDeleteFirst of all thanks for this lovely tip.
I' ve applied this to our SharePoint 2010 resource calendar but it works only on my user account, so it didn't work for other sharepoint users. Could you help me please, how can I populate the calendars for all users.
Cheers
Hi
DeleteI had similar issue.
For me the problem was that the other user did not have access to the jquery file.
Hi Everybody..
ReplyDeleteI've got some issues with this "Workaround" can somebody help me please?
I've done everything like it was written in the manual.. but i don't see any calendar? I don't know where's the issue and i don't know javascript very well :-/
Thank you very much in advance!
plon33r
I was actually looking for this resource a few weeks back. Thanks for sharing with us your wisdom.This will absolutely going to help me in my projects .
ReplyDelete----------------------------------------------------------
Flower Girl Dresses|Empire Wedding Dresses|New Style Wedding Dresses
hi could you help me please? I won't work on my sharepoint...
ReplyDeletei need something to connect this script with exchange ... :/
ReplyDeleteThanks its working perfectly!!!
ReplyDeleteBut is there any way so that it can show resources dynamically...
also after adding script "Calendar Tools" tab disappeared and showing only Browse tab...
Please help...
I got it!! I was trying to call the script from the Content Editor with a < script> tag -- wrong!!
ReplyDeleteTo do it correctly:
http://sharepointadam.com/2010/08/31/insert-javascript-into-a-content-editor-web-part-cewp/
MikeN
Very creative solution! Nice work.
ReplyDeleteI can't seem to make this work. I have a group work site (http://indev/juv/JSiteProject) as a subsite of team site (http://indev/juv).
ReplyDeleteI have added the jquery.min.js file to http://indev/juv/JSiteProject/Style Library/jquery.min.js.
I have added
var sel2 = SP.UI.ApplicationPages.CalendarSelector.instance().getSelector(2, $(el).attr('ctxid'));
sel2.selectEntities(xml2, true);
I am trying to get this to work for two additional people besides me - glsumpter and soeagleton.
Here is my code:
DeleteHere is my code:
script type="text/javascript" src="http://indev/juv/JSiteProject/Style Library/jquery.min.js" /script
script type="text/javascript"
function _setDefaultResources() {
var el = $(".ms-acal-rootdiv");
var xml ='\u003cEntities Append=\u0022True\u0022 Error=\u0022\u0022
DoEncodeErrorMessage=\u0022True\u0022 Separator=\u0022;\u0022 MaxHeight=\u00223\u0022\u003e\u003cEntity
Key=\u0022TARRANTCOUNTY\\soeagleton\u0022 DisplayText=\u0022Sheryl O. Eagleton\u0022
IsResolved=\u0022True\u0022
Description=\u0022TARRANTCOUNTY\\soeagleton\u0022\u003e\u003cExtraData\u003e\u003cArrayOfDictionaryEntry
xmlns:xsi=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema-instance\u0022
xmlns:xsd=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema\u0022\u003e\u003cDictionaryEntry\u003
e\u003cKey xsi:type=\u0022xsd:string\u0022\u003eSPUserID\u003c\u002fKey\u003e\u003cValue
xsi:type=\u0022xsd:string\u0022\u003e17\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003cDicti
onaryEntry\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003eAccountName\u003c\u002fKey\u003e\u003cValue
xsi:type=\u0022xsd:string\u0022\u003eTARRANTCOUNTY\\soeagleton\u003c\u002fValue\u003e\u003c\u002fDictionar
yEntry\u003e\u003cDictionaryEntry\u003e\u003cKey
xsi:type=\u0022xsd:string\u0022\u003eEmail\u003c\u002fKey\u003e\u003cValue
xsi:type=\u0022xsd:string\u0022\u003eSOEagleton@tarrantcounty.com\u003c\u002fValue\u003e\u003c\u002fDictio
naryEntry\u003e\u003cDictionaryEntry\u003e\u003cKey
xsi:type=\u0022xsd:string\u0022\u003ePrincipalType\u003c\u002fKey\u003e\u003cValue
xsi:type=\u0022xsd:string\u0022\u003eUser\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003c\u0
02fArrayOfDictionaryEntry\u003e\u003c\u002fExtraData\u003e\u003cMultipleMatches
\u002f\u003e\u003c\u002fEntity\u003e\u003cEntity Key=\u0022TARRANTCOUNTY\\glsumpter\u0022
DisplayText=\u0022Greg L. Sumpter\u0022 IsResolved=\u0022True\u0022
Description=\u0022TARRANTCOUNTY\\glsumpter\u0022\u003e\u003cExtraData\u003e\u003cArrayOfDictionaryEntry
xmlns:xsi=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema-instance\u0022
xmlns:xsd=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema\u0022\u003e\u003cDictionaryEntry\u003
e\u003cKey xsi:type=\u0022xsd:string\u0022\u003eSPUserID\u003c\u002fKey\u003e\u003cValue
xsi:type=\u0022xsd:string\u0022\u003e16\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003cDicti
onaryEntry\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003eAccountName\u003c\u002fKey\u003e\u003cValue
xsi:type=\u0022xsd:string\u0022\u003eTARRANTCOUNTY\\glsumpter\u003c\u002fValue\u003e\u003c\u002fDictionary
Entry\u003e\u003cDictionaryEntry\u003e\u003cKey
xsi:type=\u0022xsd:string\u0022\u003eEmail\u003c\u002fKey\u003e\u003cValue
xsi:type=\u0022xsd:string\u0022\u003eGSumpter@TarrantCounty.com\u003c\u002fValue\u003e\u003c\u002fDictiona
ryEntry\u003e\u003cDictionaryEntry\u003e\u003cKey
xsi:type=\u0022xsd:string\u0022\u003ePrincipalType\u003c\u002fKey\u003e\u003cValue
xsi:type=\u0022xsd:string\u0022\u003eUser\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003c\u0
02fArrayOfDictionaryEntry\u003e\u003c\u002fExtraData\u003e\u003cMultipleMatches
\u002f\u003e\u003c\u002fEntity\u003e\u003c\u002fEntities\u003e";
var sel = SP.UI.ApplicationPages.CalendarSelector.instance().getSelector(1, $(el).attr('ctxid'));
sel.selectEntities(xml, true);
var sel2 = SP.UI.ApplicationPages.CalendarSelector.instance().getSelector(2, $(el).attr('ctxid'));
sel2.selectEntities(xml2, true);
}
ExecuteOrDelayUntilScriptLoaded(_setDefaultResources, "sp.ribbon.js");
/script
Hi Thomas,
ReplyDeleteI really need the solution that you discovered but I am not an experienced SharePoint developer. I have the need to display three exchange calendars on a calendar that I have already created and have it working. I have the same problem of losing the exchange users every time I refresh. I copied your code from above and placed it in a txt file.
However in SharePoint Designer (2010) I do not know how to add this code or the txt file. Is the code ultimately pasted into the html code in the default form? I also liked your tip about uploading the file to a specific style library but not sure how to do that either.
I understand if it is too much to train a novice, but I would certainly appreciate it as my company will probably not spring for a 3rd party web part.
Hi Thomas, thanks for the script......however, i am quite new to the SharePoint designing, I have uploaded the script file under the "Style Library" folder....where i should refer this file, to have users appear on my calender?
ReplyDeleteYou have done a great job, thanks.
ReplyDeleteThe only thing is that when i want to select one resource at a time, the list form display all Resources list so I have to Remove all resource first and keep the resource I need in the list.
Is there any way that this could be resolved;
Hi,
ReplyDeleteFirst of all, thank you for the tip. But is there any way I can display all booked resources in a month rather than a day or week?
Hi this was exactly what I needed thank you. I would if you could add to this. I have 2 calendars and I would to filter resources list (or at least set the default option) depending what calendar Is being used.
ReplyDeletehttps://picasaweb.google.com/105183582377932071609/January162013#5834086774468346802
Then added both web parts to the page with the calendad and it worked.
ReplyDelete_________________________________________________________________
WoW Gold|Diablo 3 Gold|Swtor Credits|Aion kinah kaufen
I would start to see some videos on content editor web part so i can understand a little better that part!
ReplyDeleteThank you for your time and quickness :)
____________________________
Cheap guild wars 2 gold
here
Hi,
ReplyDeleteIt worked but now ie doesnt't show the resources and my calendar anymore.
But is still works on Firefox and Chrome
When i press F12 and debug it it says
Unable to get property of undefined or null reference
on sel.selectEntities(xml, true)
Hi,
ReplyDeleteit works, Great job...Thanks..
I tried to set week or month calendar view but without success. It set me only month calendar view without resources or only week group view. How to exactly modify the jquery to set week view ? Thanks
The solution works... you can use Firebug in Firefox or the Development Tools in I.E. 9.0 pressing F12... this way will return exactly the appropiate names of your libraries and resources.
ReplyDeleteA couple issues that I found, in Sharepoint 2013 does hides the ribbon on execution. also only seem to work for Opera and Firefox. for Internet Explorer 8.0 and 9.0 does not return anything.
I really miss the webpart in MOSS where a simple calendar can take care of Double Booking without have to involve resources. for a simple meeting room just a calendar with double booking validation is enough. but that does not seem to exist on Sharepoint 2013.
Will keep looking for a way to activate teh ribbon and show the correct results in IE. but very nice attempt to make things work.
Hi Thomas,
ReplyDeleteThis is awesome post and It work fine,
but in my scenario I have to display resource name dynamically on Group calendar.
Means is there any resource added, deleted or updated same changes reflected on group calendar.
So please suggest me how to do this.
Thanks,
Digambar K
Thanks for the post. It works great.
ReplyDeleteDo you have any idea about using this trick with overlay? If I add an overlay view on my calendar it doesn't display its content because adding a resource only applies to the "base" view, and not the overlay view.
Thanks.
Hello, my name is Juan Pablo am from Argentina.
ReplyDeleteAchieve perform successfully the resources "rooms" are displayed correctly when loading the page.
But I have a problem, I need you can see all the users of the organization in the same way and not just me.
My code is as follows:
var xml = "\u003cEntities Append=\u0022False\u0022 Error=\u0022\u0022 DoEncodeErrorMessage=\u0022True\u0022 Separator=\u0022;\u0022 MaxHeight=\u00223\u0022\u003e\u003cEntity Key=\u0022Sala 1 - Piso 12\u0022 DisplayText=\u0022Sala 1 - Piso 12\u0022 IsResolved=\u0022True\u0022 Description=\u0022\u0022\u003e\u003cExtraData\u003e\u003cArrayOfDictionaryEntry xmlns:xsi=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema-instance\u0022 xmlns:xsd=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema\u0022\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003eSPResourceId\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003e7\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003ePrincipalType\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003eResource\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003c\u002fArrayOfDictionaryEntry\u003e\u003c\u002fExtraData\u003e\u003cMultipleMatches \u002f\u003e\u003c\u002fEntity\u003e\u003cEntity Key=\u0022Sala 2 - Piso 12\u0022 DisplayText=\u0022Sala 2 - Piso 12\u0022 IsResolved=\u0022True\u0022 Description=\u0022\u0022\u003e\u003cExtraData\u003e\u003cArrayOfDictionaryEntry xmlns:xsi=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema-instance\u0022 xmlns:xsd=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema\u0022\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003eSPResourceId\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003e8\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003ePrincipalType\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003eResource\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003c\u002fArrayOfDictionaryEntry\u003e\u003c\u002fExtraData\u003e\u003cMultipleMatches \u002f\u003e\u003c\u002fEntity\u003e\u003c\u002fEntities\u003e";
var sel = SP.UI.ApplicationPages.CalendarSelector.instance().getSelector(2, $(el).attr('ctxid'));
sel.selectEntities(xml, true);
}
ExecuteOrDelayUntilScriptLoaded(_setDefaultResources, "sp.ribbon.js");
We appreciate your help to accomplish this task.
Thanks Regards.
Juan Pablo
hi Thomas,
ReplyDeleteIt's very helpful. there's one problems that i would like to ask you, how can i added a function to filtering the category such as only Out of Office can be shown. Need your help. thank you before
Is this code work for SharePoint 2013 calendar.
ReplyDeleteI tried this solution, but now the problem is it sometime showing in chrome and sometime not.And it not at all showing in IE 8,9...
Please share your valuable ideas
Hi, Thanks for the great solution. I was implementing this and I am facing some issue while I am refreshing the page. For the first time when I refresh the page I am not getting WPQ2, so that sel is coming null. I tried a lot but not able to do this. Can you please help me on this. I am using in SharePoint 2013.
ReplyDeleteAnother neat solution:
ReplyDeletehttp://sharepointzilla.blogspot.com/2013/07/sharepoint-2010-calendar-static.html?showComment=1427001801533#c1709366040636827107
We offer these, which may be used and copied, free of charge and provided that the copyright notice be removed. We can offer them, which can be easily downloadable and available in hard copy from our side. The printable calendars 2021are the designed calendars from January to December, which are offered by us.
ReplyDeleteThank you so much for such information. In this age of busy lifestyle and hectic days, sometimes it's astonishing how we all stay organized and don't get mixed up all the performing activities. Why don’t you make use of January 2021 Calendar ? As you know calendar helps in managing your day and time promptly not only this by using calendar many tasks become quite easy and comfortable.
ReplyDeleteVery interesting article, I really appreciate it.
ReplyDeletePrintable Things is that the authentic platform that famous for providing the best design 2022 Calendar Printable One Page to any or all people. Today's, calendar becomes the most convenient tool for planning for any events, holidays, special days, and a few personal meetings. The general public is unable to work out calendars because of their busy schedule.
Nice article, I really appreciate it.
ReplyDeleteDownload Basketball Score Sheet Printable from the Printable Things. It can help record numbers without mistakes while watching the sport. You have got to go to the website and click on the beginning to make a blank score sheet basketball scorebook. By downloading this you'll be able to make your scorekeeper. You’ll keep things like date, score, and so on.
This article is very nice, thank you for sharing with us.
ReplyDeleteA rent/landlord verification form is used to verifying the tenant’s reliability. Visit the website of Printable Things to download the Sample Rental Verification Letter Pdf at freed from cost. A landlord who is going to give their home for renting then he would want proof that the applicant is ready both financially and socially to rent the house.
Many countries are with the land of diversity with different cultures, events, and festivals in January. Printable January 2022 Calendar with Holidays will reduce all stress and help to start a fresh start and mark dates to set new goals. Printable January 2022 Calendar with Holidays will organize the list of important days to celebrate holidays in the month of January.
ReplyDeleteThis is very nice blog Historical events are documented in a chronological order that can be determined using dates. You can preserve past and present occurrences in printable calendars for years using date and time, which can be used as proof in the future. Make your own printable calendar 2022 January for the month of January, complete with holidays and events in printable calendar 2021.
ReplyDelete