Class Index | File Index

Classes


Class LABKEY.ext4.Util

Ext4 utilities, contains functions to return an Ext config object to create an Ext field based on the supplied metadata.
Defined in: Util.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
<static>  
LABKEY.ext4.Util.getDefaultEditorConfig()
This is designed to be called through either .getFormEditorConfig or .getFormEditor.
<static>  
LABKEY.ext4.Util.getFormEditor(meta, config)
Constructs an ext field component based on the supplied metadata.
<static>  
LABKEY.ext4.Util.getFormEditorConfig(meta, config)
Return an Ext config object to create an Ext field based on the supplied metadata.
<static>  
LABKEY.ext4.Util.resizeToViewport(extContainer, width, height, paddingX, paddingY, offsetX, offsetY)
This method takes an object that is/extends an Ext4.Container (e.g.
Class Detail
LABKEY.ext4.Util()
Method Detail
<static> LABKEY.ext4.Util.getDefaultEditorConfig()
This is designed to be called through either .getFormEditorConfig or .getFormEditor. Uses the given meta-data to generate a field config object. This function accepts a collection of config parameters to be easily adapted to various different metadata formats. Note: you can provide any Ext config options using the editorConfig or formEditorConfig objects These config options can also be used to pass arbitrary config options used by your specific Ext component
Parameters:
{string} config.type Optional
e.g. 'string','int','boolean','float', or 'date'. for consistency this will be translated into the property jsonType
{object} config.editable Optional
{object} config.required Optional
{string} config.label Optional
used to generate fieldLabel
{string} config.name Optional
used to generate fieldLabel (if header is null)
{string} config.caption Optional
used to generate fieldLabel (if label is null)
{integer} config.cols Optional
if input is a textarea, sets the width (style:width is better)
{integer} config.rows Optional
if input is a textarea, sets the height (style:height is better)
{string} config.lookup.schemaName Optional
the schema used for the lookup. schemaName also supported
{string} config.lookup.queryName Optional
the query used for the lookup. queryName also supported
{Array} config.lookup.columns Optional
The columns used by the lookup store. If not set, the [keyColumn, displayColumn] will be used.
{string} config.lookup.keyColumn Optional
{string} config.lookup.displayColumn Optional
{string} config.lookup.sort Optional
The sort used by the lookup store.
{boolean} config.lookups Optional
use lookups=false to prevent creating default combobox for lookup columns
{object} config.editorConfig Optional
is a standard Ext config object (although it can contain any properties) that will be merged with the computed field config e.g. editorConfig:{width:120, tpl:new Ext.Template(...), arbitraryOtherProperty: 'this will be applied to the editor'} this will be merged will all form or grid editors
{object} config.formEditorConfig Optional
Similar to editorConfig; however, it will only be merged when getFormEditor() or getFormEditorConfig() are called. The intention is to provide a mechanism so the same metadata object can be used to generate editors in both a form or a grid (or other contexts).
{object} config.gridEditorConfig Optional
similar to formEditorConfig; however, it will only be merged when getGridEditor() or getGridEditorConfig() are called.
{object} config.columnConfig Optional
similar to formEditorConfig; however, it will only be merged when getColumnConfig() is getColumnsConfig() called.
{object} config.lookup.store Optional
advanced! Pass in your own custom store for a lookup field
{boolean} config.lazyCreateStore Optional
If false, the store will be created immediately. If true, the store will be created when the component is created. (default true)
{boolean} config.createIfDoesNotExist Optional
If true, this field will be created in the store, even if it does not otherwise exist on the server. Can be used to force custom fields to appear in a grid or form or to pass additional information to the server at time of import
{function} config.buildQtip Optional
This function will be used to generate the qTip for the field when it appears in a grid instead of the default function. It will be passed a single object as an argument. This object has the following properties: qtip, data, cellMetaData, meta, record, store. Qtip is an array which will be merged to form the contents of the tooltip. Your code should modify the array to alter the tooltip. For example: buildQtip: function(config){ qtip.push('I have a tooltip!'); qtip.push('This is my value: ' + config.value); }
{function} config.buildDisplayString Optional
This function will be used to generate the display string for the field when it appears in a grid instead of the default function. It will be passed the same argument as buildQtip()
{function} config.buildUrl Optional
This function will be used to generate the URL encapsulating the field
{string} config.urlTarget Optional
If the value is rendered in a LABKEY.ext4.EditorGridPanel (or any other component using this pathway), and it contains a URL, this will be used as the target of tag. For example, use _blank for a new window.
{boolean} config.setValueOnLoad Optional
If true, the store will attempt to set a value for this field on load. This is determined by the defaultValue or getInitialValue function, if either is defined
{function} config.getInitialValue Optional
When a new record is added to this store, this function will be called on that field. If setValueOnLoad is true, this will also occur on load. It will be passed the record and metadata. The advantage of using a function over defaultValue is that more complex and dynamic initial values can be created. For example: //sets the value to the current date getInitialValue(val, rec, meta){ return val || new Date() }
{boolean} config.wordWrap Optional
If true, when displayed in an Ext grid the contents of the cell will use word wrapping, as opposed to being forced to a single line Note: the follow Ext params are automatically defined based on the specified Labkey metadata property: dataIndex -> name editable -> userEditable && readOnly header -> caption xtype -> set within getDefaultEditorConfig() based on jsonType, unless otherwise provided

<static> {Object} LABKEY.ext4.Util.getFormEditor(meta, config)
Constructs an ext field component based on the supplied metadata. Same as getFormEditorConfig, but actually constructs the editor. The resulting editor is tailored for usage in a form, as opposed to a grid. Unlike getEditorConfig, if the metadata contains a formEditorConfig property, this config object will be applied to the resulting field. See getDefaultEditorConfig for config options.
Parameters:
{Object} meta
as returned by LABKEY.Query.selectRows. See LABKEY.Query.SelectRowsResults.
{Object} config
as returned by LABKEY.Query.selectRows. See LABKEY.Query.SelectRowsResults.
Returns:
{Object} An Ext field component

<static> {Object} LABKEY.ext4.Util.getFormEditorConfig(meta, config)
Return an Ext config object to create an Ext field based on the supplied metadata. The resulting config object is tailored for usage in a form, as opposed to a grid. Unlike getEditorConfig, if the metadata contains a gridEditorConfig property, this config object will be applied to the resulting field. See getDefaultEditorConfig for config options.
Parameters:
{Object} meta
as returned by LABKEY.Query.selectRows. See LABKEY.Query.SelectRowsResults.
{Object} config Optional
as returned by LABKEY.Query.selectRows. See LABKEY.Query.SelectRowsResults.
Returns:
{Object} An Ext 4.x config object

<static> LABKEY.ext4.Util.resizeToViewport(extContainer, width, height, paddingX, paddingY, offsetX, offsetY)
This method takes an object that is/extends an Ext4.Container (e.g. Panels, Toolbars, Viewports, Menus) and resizes it so the Container fits inside the viewable region of the window. This is generally used in the case where the Container is not rendered to a webpart but rather displayed on the page itself (e.g. SchemaBrowser, manageFolders, etc).
Parameters:
extContainer
- (Required) outer container which is the target to be resized
width
- (Required) width of the viewport. In many cases, the window width. If a negative width is passed than the width will not be set.
height
- (Required) height of the viewport. In many cases, the window height. If a negative height is passed than the height will not be set.
paddingX
- distance from the right edge of the viewport. Defaults to 35.
paddingY
- distance from the bottom edge of the viewport. Defaults to 35.
offsetX
offsetY

Documentation generated by JsDoc Toolkit 2.3.2 on Thu Jun 11 2020 17:30:56 GMT-0000 (UTC)