Class Index | File Index

Classes


Class LABKEY.ext4.data.Store


Extends Ext.data.Store.
LabKey extension to the Ext.data.Store class, which can retrieve data from a LabKey server, track changes, and update the server upon demand. This is most typically used with data-bound user interface widgets, such as the Ext.grid.Panel.

If you use any of the LabKey APIs that extend Ext APIs, you must either make your code open source or purchase an Ext license.

Additional Documentation:


Defined in: Store.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Constructs an extended ExtJS 4.2.1 Ext.data.Store configured for use in LabKey client-side applications.
Config Summary
Config Attributes Config Name and Description
 
A comma-delimited list of column names to fetch from the specified query.
 
The container filter to use for this query (defaults to null).
 
The container path from which to get the data.
 
An array of LABKEY.Filter.FilterDefinition objects to use as the base filters.
 
True will ignore any filters applied as part of the view (defaults to false).
 
The maximum number of rows returned by this query (defaults to showing all rows).
 
A metadata object that will be applied to the default metadata returned by the server.
 
A metadata object that will be applied to every field of the default metadata returned by the server.
 
The query name within the schema to fetch.
 
The LabKey schema to query.
 
A base sort specification in the form of '[-]column,[-]column' ('-' is used for descending sort).
 
A LabKey SQL statement to execute to fetch the data.
 
If true, no dialog will appear if there is an exception.
 
Defaults to true.
 
A saved custom view of the specified query to use if desired.
Method Summary
Method Attributes Method Name and Description
 
findFieldMetadata(fieldName)
Returns a field metadata object of the specified field
 
Returns the case-normalized fieldName.
 
Returns an array of the raw column objects returned from the server along with the query metadata
 
Returns an Ext.util.MixedCollection containing the fields associated with this store
Event Summary
Event Attributes Event Name and Description
 
beforemetachange(store, metadata)
Fired when the initial query metadata is returned from the server.
 
exception(store, message, response, operation)
Fired when there is an exception loading or saving data.
 
synccomplete(store)
Fired when a sync operation is complete, which can include insert/update/delete events
Class Detail
LABKEY.ext4.data.Store(config)
Constructs an extended ExtJS 4.2.1 Ext.data.Store configured for use in LabKey client-side applications.
<script type="text/javascript">
    var _store;

    Ext4.onReady(function(){

        // create a Store bound to the 'Users' list in the 'core' schema
        _store = Ext4.create('LABKEY.ext4.data.Store', {
            schemaName: 'core',
            queryName: 'users',
            autoLoad: true
        });
    });

</script>
<div id='grid'/>
Parameters:
config
Configuration properties.
Config Detail
{String} config.columns
A comma-delimited list of column names to fetch from the specified query. Note that the names may refer to columns in related tables using the form 'column/column/column' (e.g., 'RelatedPeptide/TrimmedPeptide').

{String} config.containerFilter
The container filter to use for this query (defaults to null). Supported values include:

{String} config.containerPath
The container path from which to get the data. If not specified, the current container is used.

{Array} config.filterArray
An array of LABKEY.Filter.FilterDefinition objects to use as the base filters.

{Boolean} config.ignoreFilter
True will ignore any filters applied as part of the view (defaults to false).

{Integer} config.maxRows
The maximum number of rows returned by this query (defaults to showing all rows).

{Object} config.metadata
A metadata object that will be applied to the default metadata returned by the server. See example below for usage.

{Object} config.metadataDefaults
A metadata object that will be applied to every field of the default metadata returned by the server. Will be superceeded by the metadata object in case of conflicts. See example below for usage.

{String} config.queryName
The query name within the schema to fetch.

{String} config.schemaName
The LabKey schema to query.

{String} config.sort
A base sort specification in the form of '[-]column,[-]column' ('-' is used for descending sort).

{String} config.sql
A LabKey SQL statement to execute to fetch the data. You may specify either a queryName or sql, but not both. Note that when using sql, the store becomes read-only, as it has no way to know how to update/insert/delete the rows.

{boolean} config.supressErrorAlert
If true, no dialog will appear if there is an exception. Defaults to false.

{Boolean} config.updatable
Defaults to true. Set to false to prohibit updates to this store.

{String} config.viewName
A saved custom view of the specified query to use if desired.
Method Detail
{Object} findFieldMetadata(fieldName)
Returns a field metadata object of the specified field
Parameters:
{String} fieldName
The name of the field
Returns:
{Object} Metatdata for this field

{String} getCanonicalFieldName(fieldName)
Returns the case-normalized fieldName. The fact that field names are not normally case-sensitive, but javascript is case-sensitive can cause prolems. This method is designed to allow you to convert a string into the casing used by the store.
Parameters:
{String} fieldName
The name of the field to test
Returns:
{String} The normalized field name or null if not found

{Array} getColumns()
Returns an array of the raw column objects returned from the server along with the query metadata
Returns:
{Array} The columns associated with this store

{Ext.util.MixedCollection} getFields()
Returns an Ext.util.MixedCollection containing the fields associated with this store
Returns:
{Ext.util.MixedCollection} The fields associated with this store
Event Detail
beforemetachange(store, metadata)
Fired when the initial query metadata is returned from the server. Provides an opportunity to manipulate it.
Parameters:
{Object} store
A reference to the LABKEY store
{Object} metadata
The metadata object that will be supplied to the Ext.data.Model.

exception(store, message, response, operation)
Fired when there is an exception loading or saving data.
Parameters:
{Object} store
A reference to the LABKEY store
{String} message
The error message
{Object} response
The response object
{Object} operation
The Ext.data.Operation object

synccomplete(store)
Fired when a sync operation is complete, which can include insert/update/delete events
Parameters:
{Object} store
A reference to the LABKEY store

Documentation generated by JsDoc Toolkit 2.3.2 on Thu Mar 14 2019 22:39:26 GMT-0000 (UTC)