Public Methods

Since, ajax operations are typically asynchronous in nature, web2cal allows you to invoke certain functions whenever you are ready to do so.

Following is a list of functions that you can invoke. Feel free to download our free version to see how we have used the functions mentioned below.

 

addEvent
Summary
Parameters Event Object
Description After adding an event to DB, invoke this method to display the event on calendar.
Compatibility
updateEvent
Summary Adds an event to Web2Cal
Parameters Event Object / List of event objects
Description After updating an event to DB, invoke this method to update what is displayed on calendar.
Compatibility All Versions
deleteEvent
Summary Delete an Event from Web2Cal
Parameters Event Object
Description If an event is deleted, invoke tihs method to reflect it on the calendar.
Compatibility All Versions
refresh
Summary Re-Arranges all events in Web2Cal.
Parameters NA
Description This method simply re-arranges the events in the calendar from local cache.
Compatibility All Versions
showPreview
Summary Displays a HTML element next to an event
Parameters 1. Event Object
2. htmlstring or htmlelement
Description Invoke this method to show the HTML as preview.
Compatibility All Versions
showEditEventTemplate
Summary displays a form to edit an event
Parameters 1. edit Event Element (dom element or jQuery element)
2.  eventId
Description Displays the form to edit the event. It is displayed like a preview div.
Compatibility Premium 1.3.7 or greater
render
Summary Method to display data in Web2Cal
Parameters List of groups. See Data Input Structure for more information
Description Invoke this method to provide data and render it on calendar.
Compatibility All versions

Other public functions are

Event Name Input Description
closeAddEvent Call this function to cancel the add new event operation.
showStatusMsg String Message Call this method to show a message in the status window.
hideStatusMsg Call this method to hide the status window.
hidePreview String Message Call this function to hide the preview window.
getAllEvents
Works in Premium 1.3.7
Returns all events as array of JSON objects.
getAllGroups
Works in Premium 1.3.7
Returns all groups as array of JSON objects
getEventsForDay
Works in Premium 1.3.7
1. day (yyyy/mm/dd format ) Returns the events as array of JSON objects for any given day.