Hello Peter , you are getting started with javascript now? Without problems.
EventRenderCallback it's a callback function , that used in object
properties "FULLCALENDAR" , that means in the element that to used the
first parameter will be the general event and second will be the current
element (with yours properties ( like type ) ) .
1. The EventRenderCallback it's a function that just need asign in property
eventRender , likely this property ( eventRender ) run a function each
element of calendar ( don't see very much at documentation them. )
2. You have two scopes :
- Jquery object with FullCalendar.
- Function EventRenderCallback.
They be need declared separated , a function to jquery ( normal ) and other
function to EventRenderballBack.
Put the css of my previous answer in your css and the function that verify
type of element and add a class below of your jquery declaration of
fullcalendar.
3. At EventRender property of calendar you need call EventRenderCallback ,
just do this into jquery object fullcalendar :
eventRender : EventRenderCallback
4. and declare out of jquery object the function responsible by verify
elements.
Em domingo, 2 de outubro de 2016 23:16:12 UTC-3, Peter escreveu:
>
>
> Thanks again Marlysson!
>
>
> Okay, I've tried a few configurations (a lot actually) and came up with
> this which doesn't work (but it doesn't crash either - it breaks the view
> by showing no calendar entries)
>
> It's probably too influenced by my python formatting and flow*!
> Regardless, I can't figure out what I should be passing to 'element'*
> anyway (see ?????????)....
>
> <script type='text/javascript'>
>
> $(document).ready(function() {
>
> var date = new Date();
> var d = date.getDate();
> var m = date.getMonth();
> var y = date.getFullYear();
>
> $('#calendar').fullCalendar({
> eventRender: eventRenderCallback,
>
> function eventRenderCallback(event, element){
> if (event.type == "TRAINING"){
> element.classList.add('training');
> }else if (event.type == "MEETING"){
> element.classList.add('meeting');
> }else if (event.type == 'PROJECT_WORK'){
> element.classList.add('project_work');
> }
> }
>
> editable: false,
> events: [
> {{for row in rows:}}
> event = { type: '{{row.task.task_type.lower()}}',
> title: '{{=row.task.task_status}}
> {{=row.task.task_type}} {{=row.person.fullname.replace("'","\\'")}} ',
> allDay: false,
> start: new
> Date('{{=row.task.start_time.strftime('%B %d, %Y %H:%M:%S')}}'),
> url: '{{=URL('view_task',args=row.task.id)}}'
> },
> eventRenderCallback(event, ???????????)
> {{pass}}
> ]
> });
> });
>
>
>
> </script>
>
>
> *Should I even be wrapping up the attributes of each event (in the rows
> loop) assigning them to a variable 'event' and passing that to
> eventRenderCallback? *
>
>
> I am really in the dark here!
>
> Peter
>
>
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.