i want add row below title (in header, not in events) without altering fullcalendar .css file
is there way add using eventafterrender, alter .css , add element?
i want add row text "only open events displayed" below month/year title. using basic view on following page:
http://fullcalendar.io/js/fullcalendar-2.3.1/demos/basic-views.html
unfortunately, cannot upload jsfiddle of calendar embedded within ios app has custom commands fetching data, works within app. struggling basics, in append , how. using base files (fullcalendar.css).
any guidance appreciated.
actually, solved myself. clearing title , re-rendering after event. have added line below heading html showing number of open activities in database (openactivities global variable).
you can add sub heading after toolbar using following:
eventafterallrender: function (view, element) { if (view.type === "agendaweek") { $("#calendar").find('.fc-toolbar > div > h2').empty().append("<div>"+ view.start.format('mmm dd') + " - " + view.end.format('mmm dd') + "<br/><h6 style=\"font-size:18px\">number of open activities: " + openactivities + "</div>"); } else if (view.type === "agendaday") { $("#calendar").find('.fc-toolbar > div > h2').empty().append("<div>"+ view.start.format('dd mmmm yyyy') + "<br/><h6 style=\"font-size:18px\" >number of open activities: " + openactivities + "</div>"); } else if (view.type === "month") { $("#calendar").find('.fc-toolbar > div > h2').empty().append("<div>"+ view.start.format('mmmm yyyy') + "<h6 style=\"font-size:18px\"> <br/>number of open activities: " + openactivities + "</div>"); } }
i needed use .empty first , enter entire format appending div without clearing first causing issues. didn't appear @ first heading duplicated when dragging events , dropping.
i tried other methods, afterrender appeared ok heading wasn't displayed first time calendar displayed.
my calendar working, embedded in ios app using drag / drop front end our application mysql database. unfortunately, experience html , javascript limited, i'm not programmer....
i hope have put bed now, following post: fullcalendar custom/override header title
i have solved in 2.0 using following code append h2 div title placed in, way work without appending every time switched weeks/views , adding multiple sub-headings.
the code use passes global variable (openactivities) list total number of open activities in database.
eventafterallrender: function (view) { $("#calendar").find('.fc-toolbar > div > h2').append("
"number of open": "+openactivities+""); },
Comments
Post a Comment