FullCalendar Example Question

149 views
Skip to first unread message

Doug Girard

unread,
May 6, 2013, 12:23:50 PM5/6/13
to web...@googlegroups.com
I am using some of the code from the AppointmentManager appliance to include FullCalendar in my application. I want to use 'onmouseover' from jquery to show some data associated with the events that are displayed on the calendar. Where would I add my code for that? Would it be in the view under " for i,row... "?

I hope I've made myself clear.

Thank you!

Loïc

unread,
May 6, 2013, 2:56:24 PM5/6/13
to web...@googlegroups.com

Maybe it would be more clear if you can provide some code...
But if I have understood your question, you can add a a text in "tip" property. This text will be shown when your mouse is over the event.
Here is an example

events: [
           
{{for i,row in enumerate(rows):}}{{if i!=0:}},{{pass}}
               
{
                    tip
: "THIS TEXT WILL BE SHOWN ON MOUSE OVER",
                    title
: '',
                    allDay
: false,
                   
{{if row.start_datetime:}}
                        start
: new Date('{{=row.start_datetime()}}'),
                   
{{pass}}
                   
{{if row.end_datetime:}}
                       
end: new Date('{{=row.end_datetime()}}'),
                   
{{pass}}
               
}
           
{{pass}}
           
],
Message has been deleted

Richard Vézina

unread,
May 7, 2013, 3:35:01 PM5/7/13
to web2py-users
Take care, there is a memory leak in the AppointmentManagement app... I solve it for my need by changing the way the data are provided to FullCalendar... I create a json dump function and I let FullCalender consume it througth it didicated API function... So, my guess is that the memory leak where coming from the interaction between web2py and FullCalendar and the way this interraction is made in the AppointementAPP...

The leak doesn't really show up with little data set, but if you have big data set the ram get saturated rapidly.

I can provide example of my workaround, just ask...

Richard


On Tue, May 7, 2013 at 11:40 AM, Doug Girard <united...@gmail.com> wrote:
Ok, I kinda got it working based on your suggestion, I had to add an 'eventRender' object to the script, then I was able to use the tip event object:

 $('#calendar').fullCalendar({
            editable: true,

            events: [
            {{for i,row in enumerate(rows):}}{{if i!=0:}},{{pass}}
                {
                    tip: '{{=db(db.tech.id==row.tech).select(db.tech.first_name, db.tech.last_name)}}',
                    title: '{{=row.name}}',
                    allDay: false,
                    start: new Date('{{=row.work_date.strftime('%B %d, %Y %H:%M:%S')}}'),
                    end: new Date('{{=row.work_date.strftime('%B %d, %Y %H:%M:%S')}}'),
                    url: '{{=URL('sites',args=row.id)}}'
                }
            {{pass}}
            ],
            eventRender: function(event, element) {
                element.attr('title', event.tip);
            }

        });


This code above is working for me but my tip:

=db(db.tech.id==row.tech).select(db.tech.first_name, db.tech.last_name)

Returns a full table like:

<table><thread><td><th>tech.first_name</th><th>tech.last_name</th>.... on and on with the names it returns...

is there a different way to do my query or tell web2py not to make it into a table?
--
 
---
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 web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages