Click here to Skip to main content
15,884,917 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Friends,

I am looking forward to develop a Full Calendar which should fetch data like event title, message, description from database and display it in Calendar, (Example: if there are 3 events on same day then in calendar it should look like this " eventicon- 3 " ) any body can suggest me any API or working code to achieve this will be much appreciated.

Thanks a lot in advance.

JavaScript
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();

var calendar = $('#calendar').fullCalendar({
        theme: true,
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
        },
        eventClick: updateEvent,
        selectable: true,
        selectHelper: true,
        select: selectDate,
        editable: true,
        events: "JsonResponse.ashx",
        eventDrop: eventDropped,
        eventResize: eventResized,
        eventRender: function(event, element,calEvent) {

            //here i am adding icon next to title

            element.find(".fc-event-title").after($("<span class=\"fc-event-icons\"></span>").html("<img src=\"images/msg.png\" />"));


            // here description position

            element.qtip({
                content: event.description,
                position: { corner: { tooltip: 'bottomLeft', target: 'topRight'} },
                style: {
                    border: {
                        width: 1,
                        radius: 3,
                        color: '#2779AA'

                    },
                    padding: 10,
                    textAlign: 'center',
                    tip: true, // Give it a speech bubble tip with automatic corner detection
                    name: 'cream' // Style it according to the preset 'cream' style
                }
            });

        }
    });

});
Posted
Updated 2-Mar-14 23:54pm
v6
Comments
ZurdoDev 26-Feb-14 7:53am    
What do you want? Are you going to build the UI for the calendar? Or you could search online for existing calendar controls.
[no name] 27-Feb-14 3:08am    
Actually i searched for exiting calendar with this features .. but i did not get it ...
Now i need to implement please help!
[no name] 27-Feb-14 3:21am    
i want to retrieve messages from database and display in calendar.
lets imagine there are 4 meassages in database on same day 27/02/2014, then in calendar it should be like
[ message icon - 4 ] so when we click on this we should get that 4 messages in popup or window
ZurdoDev 27-Feb-14 7:19am    
Every calendar control will likely support it. But you'll have to write the code to get the values from the database and then the calendar control will likely have a method to add events.
[no name] 27-Feb-14 7:29am    
i have already a calendar which is displaying events name in the calendar .. but i need notification with icon instead of name

1 solution

C#
var date = new Date();
    var d = date.getDate();
    var m = date.getMonth();
    var y = date.getFullYear();

    var calendar = $('#calendar').fullCalendar({
        theme: true,
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
        },
        eventClick: updateEvent,
        selectable: true,
        selectHelper: true,
        select: selectDate,
        editable: true,
        events: "/JsonResponse.ashx",
        eventDrop: eventDropped,
        eventResize: eventResized,
        eventRender: function (event, element) {
            debugger;
            if ((event.description).toString() == "Message")
            {
            element.find(".fc-event-time").after($("<span class=\"fc-event-icons\"></span>").html("<img src=\"/images/msg.png\" width='20px'/>" ));
        }
        if ((event.description).toString() == "Attendance") {
            element.find(".fc-event-time").after($("<span class=\"fc-event-icons\"></span>").html("<img src=\"/images/attendance.png\" width='20px'/>"));
        }
        if ((event.description).toString() == "Event") {
            element.find(".fc-event-time").after($("<span class=\"fc-event-icons\"></span>").html("<img src=\"/images/event.png\" width='20px'/>"));
        }
        if ((event.description).toString() == "Joined") {
            element.find(".fc-event-time").after($("<span class=\"fc-event-icons\"></span>").html("<img src=\"/images/joined.png\" width='20px'/>"));
        }
        if ((event.description).toString() == "Result") {
            element.find(".fc-event-time").after($("<span class=\"fc-event-icons\"></span>").html("<img src=\"/images/Results.png\" width='20px'/>"));
        }
            element.qtip({
                content: event.description,
                position: { corner: { tooltip: 'bottomLeft', target: 'topRight'} },
                style: {
                    border: {
                        width: 1,
                        radius: 3,
                        color: '#2779AA'

                    },
                    padding: 10,
                    textAlign: 'center',
                    tip: true, // Give it a speech bubble tip with automatic corner detection
                    name: 'cream' // Style it according to the preset 'cream' style
                }

            });

        }

    });

});
 
Share this answer
 
Comments
Ahmed Bensaid 5-Mar-14 7:45am    
You should use a "switch ... case" statement instead of multiple "if" ones.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900