Constructors
Name | Type | Description |
---|---|---|
title |
string |
Set the title of the dialog if the module is displayed in a modal dialog |
viewId |
string |
optional
The viewId of the gadget object (The viewId specifies the destination in the DOM. This destination must exist otherwise the gadget is not rendered.) |
- Since:
- Documents 5.0b
Example
//#import "Gadget_API_Controller"
function gadgetCalendar() {
this.execute = function() {
// Create the gadget and set the title for the dialog
var calendarGadget = new otris.gadget.gui.FullCalendar();
//
// Add sources
//
return calendarGadget.transfer();
}
}
Extends
Methods
-
inherited addClientFunction(clientFunction)
-
Adds a JavaScript Function to this Transferable Object. When the Object is transfered to the client the functions added to this Object will be available on the client side.
Name Type Description clientFunction
function The function to be added to the clientFunctions of this Object. (Can be a JavaScript Function or an Object returned by otris.gadget.util.FunctionUtils.getFunctionObject)
-
inherited addContainerButton(buttonConfig){object}
-
Adds a container button.
If the gadget is displayed in a dialog the container buttons are rendered as dialog buttons (bottom right corner of the dialog).
Otherwise the container buttons are ignoredName Type Description buttonConfig
object button config object
Name Type Default Description id
string button id
label
string button label
clickFunction
string name of the client function to execute on click
disabled
boolean false optional - Since:
- Documents 5.0e
Returns:
Type Description object buttonConfig Example
// Alternative gadget action button gadgetForm.addContainerButton({ id: "myCustomSaveButton", label: "Speichern", clickFunction: "saveGadgetData" }); gadgetForm.addClientFunction(function saveGadgetData(event) { var gForm = documentsContext.getGadgetContext().getClientObject(); gForm.submitForm({ gadgetAction: "processForm" }, { showBusyPanel: true }); });
-
inherited addPdfButton(config)
-
Adds a button to download the displayed gadget as pdf. The button will show on hover in the left top corner of the gadget.
Name Type Description config
object optional config object
Name Type Default Description filename
string content.pdf optional filename of the pdf for download
buttonStyle
string left: 200px; optional style for the pdf button to be applied to
- Since:
- Documents 5.0d
Example
myGadget.addPdfButton({filename: "myCustomFilename.pdf", buttonStyle: "left: 200px; });
-
inherited addSettings(option)
-
Adds a setting (an option that can be defined by the user) to the gadget.
Name Type Description option
GadgetSetting | Array.<GadgetSetting> the setting(s) to add to the gadget.
- Since:
- Documents 5.0a
-
addSource(soure, eventLoader)
-
Add a event source to the calendar
Name Type Description soure
FullCalendarSource A fullcalendar source definition
eventLoader
function optional eventLoader function for this source. See details
setEventLoader
-
inherited onGadgetLoad(onloadHandler)
-
Sets an onLoad handler for the Gadget. The handler is executed when the gadget is displayed at the client.
Name Type Description onloadHandler
function | string the handler to be executed (must be either a javascript function or a string representing a function)
-
setConfig(calConfig)
-
Sets the calendar configuration. See fullcalendar documentation (http://fullcalendar.io) for details.
The calendar sources must be added with the addSource() functionName Type Description calConfig
object optional calendar config. See fullcalendar documentation for details
-
inherited setContainerButtons(containerButtonConfigs)
-
Set the container buttons.
Please note that existing default buttons are removed by this operation.Name Type Description containerButtonConfigs
Array.<object> array of button config objects
Name Type Default Description id
string button id
label
string button label
clickFunction
string name of the client function to execute on click
disabled
boolean false optional - Since:
- Documents 5.0e
-
inherited setContextData(contextData)
-
Set additional data which is serialized with
JSON.stringify()
and then transferred to the client
On the client side the the context data is accessible with theGadgetContext
Name Type Description contextData
any the context data
- Since:
- Documents 5.0c
Example
var htmlGadget = new otris.gadget.gui.HTML("<h1>Only a simple example</h1>"); var myGadgetData = { mySpecialId: 44137, myIndexArray: [1,7,6,3,2], myTitle: "A special GadgetTitle" }; htmlGadget.setContextData(myGadgetData);
-
setDoubleClickFunction(doubleClickFunction)
-
Set a double click function for the calendar. For example to create new entries on double click
Name Type Description doubleClickFunction
function The given function is executed if the caleandar is double clicked
function(Object event, String dateString, DocumentsContext documentsContext)
doubleClickFunction(event, dateString, documentsContext)
Double click function
Name Type Description event
object Event
dateString
string The date as string of the clicked item
documentsContext
documents.sdk.DocumentsContext The DocumentsContext instance
-
setEventLoader(Function)
-
Sets the global event loader function. The registered function is called
for every source with no custom event loader function. The function must
return the events for the given source in the specified time rangestart - end
The options object can contain a filter string (options.filter
) if the search context is used (see setSearchContext)
Required return format:Array of FullCalendarEvents
Name Type Description Function
function with the following signature:
function eventLoader(FullCalendarSource eventLoaderFunction source, Date start, Date end,(String|Boolean) timezone, (Object) options)
-
setLazyLoad(lazyLoad)
-
If set to false the events are all loaded on the first request. The eventLoader functions are called with empty time range params
Name Type Default Description lazyLoad
boolean true optional Lazy load the events?
-
inherited setNavibarEntry(gadgetConfig, label)
-
Add a navibar entry. Define a gadgetConfig that reloads the gadget.
Only works if the gadget ist displayed in main list view area.Name Type Description gadgetConfig
object gadgetConfig
label
string optional label for the navibar entry (defaults to the gadget title)
- Since:
- Documents 5.0e
-
setSearchContext(label, filterFunction)
-
Activates the search context for this calendar.
The parameterfilterFunction
is only necessary if lazyLoad is falseName Type Description label
string Label for the search box
filterFunction
function optional Function with the following signature:
function filterFunction(FullCalendarSource source, String searchExpression)
Expects the filtered event array as return value.source.events
always contains the initial array.- Since:
- Documents 5.0c
-
inherited setStyle(name, value)
-
Sets a style attribute of the html container
Name Type Description name
string the name of the style parameter (i.e. "height")
value
string the value of the style parameter (i.e. "100px")
-
inherited setTitle(title)
-
Sets the Title of the Form
Name Type Description title
string the title of the form (will be displayed as the window header on dashboards)
-
inherited store(key, value)
-
Stores data that can later be accessed on client side.
ATTENTION: The store used in this method is global.
UsesetContextData
to store data for this gadget instance.Name Type Description key
string the key to store the data
value
any the value, or object that should be stored
-
inherited transfer()
-
Creates the Transfer object to send to the client