Constructors
| Name | Type | Description |
|---|---|---|
options |
object |
The options for the grid. |
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.0d
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 clientFunctionfunction 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 buttonConfigobject button config object
Name Type Default Description idstring button id
labelstring button label
clickFunctionstring name of the client function to execute on click
disabledboolean 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 configobject optional config object
Name Type Default Description filenamestring content.pdf optional filename of the pdf for download
buttonStylestring 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; }); -
addProperty(name, jsonType, editorType, label, options)
-
Adds a property definition
Name Type Description namestring | object name of the property
jsonTypestring json type
string,numberorbooleanand the array version of this typesstring[],number[]orboolean[]editorTypestring editor type
labelstring optional property label
optionsobject optional additional options
Name Type Description descriptionstring optional description for the property (used for a tooltip for example)
heightnumber optional set a custom height (in pixel) for the grid row
selectOptionsArray.<string> | Array.<object> optional used as options if the editorType is
SELECT. Simple array with values or array of objects (key, label, description)Name Type Description keystring key of the select option
labelstring optional optional label
descriptionstring optional optional description
defaultstring | number | boolean optional default value
-
inherited addSettings(option)
-
Adds a setting (an option that can be defined by the user) to the gadget.
Name Type Description optionGadgetSetting | Array.<GadgetSetting> the setting(s) to add to the gadget.
- Since:
- Documents 5.0a
-
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 onloadHandlerfunction | string the handler to be executed (must be either a javascript function or a string representing a function)
-
setAutoHeight(autoHeight)
-
Configure the auto height mechanism
Name Type Description autoHeightboolean | object auto height configuration or
booleanas an enable/disable shortcutName Type Default Description enabledboolean true optional enable/disable auto height mechanism
enabledboolean 300 optional maxHeight for auto height mechanism
Example
// Disable auto heigt propertyGrid.setAutoHeight(false); // Configure auto height propertyGrid.setAutoHeight({enabled: true, maxHeight: 400 }); -
setColumnOptions(options)
-
Adjust the columns
Name Type Description optionsobject column options
Name Type Default Description keyLabelstring optional label for the key column
valueLabelstring optional label for the value column
keyWidthnumber 200 optional width of the key column in pixel
valueWidthnumber 300 optional width of the value column in pixel
keySelectionTypestring text optional selection type for the property keys (possible values:
textorselect)keyAutoCompleteobject optional autocomplete configuration (only works with keySelectionType
text)Name Type Description gadgetActionobject gadget action which returns the suggested values
minQueryCharsnumber optional Number of characters that must be entered for the autocompletion script to run.*
queryDelaynumber optional Delay script execution in milliseconds after user input
maxResultsnumber optional Maximum number of suggestions displayed.
autoFocusResultboolean optional Automatically select the first hit
keyReadonlyboolean false optional if set to true the key column is readonly
checkboxColumnboolean true optional Show or hide the checkbox column
-
inherited setContainerButtons(containerButtonConfigs)
-
Set the container buttons.
Please note that existing default buttons are removed by this operation.Name Type Description containerButtonConfigsArray.<object> array of button config objects
Name Type Default Description idstring button id
labelstring button label
clickFunctionstring name of the client function to execute on click
disabledboolean 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 theGadgetContextName Type Description contextDataany 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); -
inherited setDefinitionName(name)
-
Sets the definitionName for the gentable definition. This name is used to cache the
definition. It is NOT used for the gentable registry. The registry only uses the name
defined in the XML definition (<table_def name="nameUsedForRegistry">...).Name Type Description namestring definition name used as a cache key
-
inherited setEditable(editable)
-
Enable/disable the edit mode of the grid
Name Type Description editableboolean set the grid editable or readonly
-
setGridButtons(buttons)
-
Configure grid buttons
Name Type Description buttonsArray.<object> optional buttons (by default all buttons are enabled)
Name Type Description idstring optional button id (available
add,remove,up,down)Example
// Show add and remove button propertyGrid.setGridButtons([{id: 'add'}, {id: 'remove'}]); -
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 gadgetConfigobject gadgetConfig
labelstring optional label for the navibar entry (defaults to the gadget title)
- Since:
- Documents 5.0e
-
inherited setStore(store)
-
Define which store type the grid should use.
Name Type Description storeobject store configuration
Name Type Description typestring sort type
fieldorscriptfieldNamestring optional field name for the store type
fieldscriptNamestring optional script name for the store type
script(Script parametergentableDatacontains the grid data)scriptParamsobject optional optional script parameter
Example
// Using a file field to store the grid data gadgetGrid.setStore({ type : "field", fieldName: gadgetContext.fieldName + "Data" }); // Using a script to store the grid data gadgetGrid.setStore({ type : "script", scriptName: "propertyGridSaveScript", scriptParams: { myCustomParam : "myParamValue" } }); // The script is called with a parameter `gentableData` which contains the grid data -
inherited setStyle(name, value)
-
Sets a style attribute of the html container
Name Type Description namestring the name of the style parameter (i.e. "height")
valuestring the value of the style parameter (i.e. "100px")
-
inherited setTitle(title)
-
Sets the Title of the Form
Name Type Description titlestring 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.
UsesetContextDatato store data for this gadget instance.Name Type Description keystring the key to store the data
valueany the value, or object that should be stored
-
inherited transfer()
-
Creates the Transfer object to send to the client