Default Calendar to Show only Me in New UI

Posted by jsniemi79 on 23-Oct-2015 10:57

I had custom code in the classic UI to switch the calendar view to show only tasks and appointments for the logged in user.  With the new UI, the elements have changed.  Can anyone point me in the right direction to accomplish the same task as the classic UI?

Here is my code from the classic UI.

calendarSectionName = 'Calendar';

function setCalendarFilters() {
/*
Description: Use to set 'Show' filter
Possible values for objectFilter variable:
1. -1 => All Tasks & Events
2. -10 => All Tasks
3. -20 => All Events
4. <Object Definition ID> => Specific Object(e.g 110006390)
*/
var objectFilter = '-1';
$("#rbe_objectsFilter").val(objectFilter);

/*
Description: Use to set 'Assigned To' filer
Possible values for assignedToFilter variable:
1. Me => Only Me
2. ALL_USERS => Any Users
3. R<Role ID> => Specific role(e.g R90)
4. G<Group ID> => Specific group(e.g G110007529)
*/

var assignedToFilter = 'ME';
$("#rbe_assignedToFilter").val(assignedToFilter);


}
function delayedRefresh() {
delayInMilliseconds = 3000;
setTimeout(function() {
rbf_refreshData();
$("div[name='"+calendarSectionName+"']").show();
}, delayInMilliseconds);
}
$("div[name='"+calendarSectionName+"']").hide();
rbf_addOnLoadMethod(setCalendarFilters);
rbf_addOnLoadMethod(delayedRefresh);

All Replies

Posted by Thierry Ciot on 23-Oct-2015 16:09
We haven’t had time to look at a solution but just want to understand your requirement a little bit more and see if we should implement something in next release as potentially it would be relatively easy to do.
 
Are you saying you would like the toolbar for the calendar hidden and showing all tasks and events for only me as if this was selected in the current ui:
 
Thanks.
 
Posted by Thierry Ciot on 23-Oct-2015 22:17

So had a bit of time to look at this and if I understood your requirement well here is what you can do:

$('#rb-assigned-dd').data('kendoDropDownList').select(1);  // Will select Only Me from the View Assigned To Drop Down

Now if you are on a small device such that the drop down is in the overflow menu you will need:

$('#rb-assigned-dd'-2).data('kendoDropDownList').select(1);  

Let us know if that works.  But still interested about understanding the general requirement and seeing if we can bake something into product.

Cheers, Thierry

Posted by Thierry Ciot on 24-Oct-2015 17:22

Additionally, by using the following code, you can hide the entire toolbar and get the calendar to resize to fit all the available space:

$(".rbs-header3").hide();

$.event.trigger( { type: rb.newui.util.customEvents.rbs_forceRelayout } );

As you can notice we have some custom events that we have not documented yet but certainly, the intention is to expose this new event model to facilitate customizations.

Thierry.

Posted by jsniemi79 on 26-Oct-2015 08:47

Thank you for the sample code.  I'll give that a shot.

As for our business case, we are trying to just default the calendar to the current user's only as showing everybody's meetings by default is busy and usually not necessary.  If you are going to make a change to how the drop down works, it would be better for us if there was some security around what options were visible.  Perhaps something that took into account the user hierarchy permissions.  In general, our users would need to see their own calendar and if they were a manager, their subordinates.  They may have a need to see others, but it would be nice to be able to restrict that as well.  If you have any other questions, please let me know.

Posted by Thierry Ciot on 27-Oct-2015 13:23
Thanks.  Your requirements make sense.
 
I have forwarded them to product management.
 
This thread is closed