My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 2315: beforeViewRender hook
1 person starred this issue and may be notified of changes. Back to list
Status:  ExportedToGithub
Owner:  ----
Closed:  Aug 2015


Sign in to add a comment
 
Reported by asknight...@gmail.com, Oct 10, 2014
(feature request)

Useful in my current project is to have a custom overall width per view, eg 'agendaDay'.

We've required full width month and agendaWeek views and then reduced width agendaDay, creating space in the page for further event details not in an overlay/modal.

Here's how I accomplished this with one line of code in fullcalendar.js

[code]

    function setSize() { // assumes elementVisible

        if (suggestedViewHeight === undefined) {
            calcSize(); // for first time
                // NOTE: we don't want to recalculate on every renderView because
                // it could result in oscillating heights due to scrollbars.
        }

        currentView.opt('setCalendarContainerWidth') && 
currentView.opt('setCalendarContainerWidth')(element, currentView);

        ignoreWindowResize++;
        currentView.setHeight(suggestedViewHeight);
        currentView.setWidth(content.width());
        ignoreWindowResize--;

        elementOuterWidth = element.outerWidth();
    }
[/code]

The setCalendarContainerWidth callback then sets a width per-view on the element (could have a parent of element)

A more general name of the option might be onBeforeViewLayout.  

Oct 30, 2014
Project Member #1 adamrs...@gmail.com
as your last sentence suggests, I think this should be done in a general "beforeViewRender" handler, where you would set the width of the container element before the view's rendering happens. I think that offers more robustness.
Summary: beforeViewRender hook (was: Enable custom elementOuterWidth (or other attributes) per view render)
Status: Accepted
Labels: Type-Feature
Aug 21, 2015
Project Member #2 adamrs...@gmail.com
Discussion for this issue has moved to the following URL:
https://github.com/fullcalendar/fullcalendar/issues/2580

This is because Google Code is shutting down. Apologies if you are being pestered with these notifications. This is a one-time event.

Happy coding,
Adam
Status: ExportedToGithub
Sign in to add a comment

Powered by Google Project Hosting