Class Index | File Index

Classes


Namespace LABKEY.Filter

Filter static class to describe and create filters.

Additional Documentation:


Defined in: Filter.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<static>  
LABKEY.Filter.Types
Types static class to describe different types of filters.
<static>  
LABKEY.Filter.Types.BETWEEN
Finds rows where the column value is between the two filter values, inclusive.
<static>  
LABKEY.Filter.Types.CONTAINS
Finds rows where the column value contains the filter value.
<static>  
LABKEY.Filter.Types.CONTAINS_NONE_OF
Finds rows where the column value does not contain any of the supplied filter values.
<static>  
LABKEY.Filter.Types.CONTAINS_ONE_OF
Finds rows where the column value contains any of the supplied filter values.
<static>  
LABKEY.Filter.Types.DATE_EQUAL
Finds rows where the date portion of a datetime column matches the filter value (ignoring the time portion).
<static>  
LABKEY.Filter.Types.DATE_NOT_EQUAL
Finds rows where the date portion of a datetime column does not match the filter value (ignoring the time portion).
<static>  
LABKEY.Filter.Types.DOES_NOT_CONTAIN
Finds rows where the column value does not contain the filter value.
<static>  
Finds rows where the column value does not start with the filter value.
<static>  
LABKEY.Filter.Types.EQUAL
Finds rows where the column value matches the given filter value.
<static>  
LABKEY.Filter.Types.GREATER_THAN
Finds rows where the column value is greater than the filter value.
<static>  
Finds rows where the column value is greater than or equal to the filter value.
<static>  
LABKEY.Filter.Types.IN
Finds rows where the column value equals one of the supplied filter values.
<static>  
LABKEY.Filter.Types.LESS_THAN
Finds rows where the column value is less than the filter value.
<static>  
LABKEY.Filter.Types.LESS_THAN_OR_EQUAL
Finds rows where the column value is less than or equal to the filter value.
<static>  
LABKEY.Filter.Types.MEMBER_OF
Finds rows where the column value contains a user id that is a member of the group id of the supplied filter value.
<static>  
LABKEY.Filter.Types.MISSING
Finds rows where the column value is missing (null).
<static>  
LABKEY.Filter.Types.NOT_BETWEEN
Finds rows where the column value is not between the two filter values, exclusive.
<static>  
LABKEY.Filter.Types.NOT_EQUAL
Finds rows where the column value does not equal the filter value.
<static>  
Finds rows where the column value does not equal the filter value, or is missing (null).
<static>  
LABKEY.Filter.Types.NOT_IN
Finds rows where the column value is not in any of the supplied filter values.
<static>  
LABKEY.Filter.Types.NOT_MISSING
Finds rows where the column value is not missing (is not null).
<static>  
LABKEY.Filter.Types.STARTS_WITH
Finds rows where the column value starts with the filter value.
Method Summary
Method Attributes Method Name and Description
<static>  
LABKEY.Filter.create(columnName, value, filterType)
Creates a filter
<static>  
LABKEY.Filter.getFilterDescription(url, dataRegionName, columnName)
Convert from URL syntax filters to a human readable description, like "Is Greater Than 10 AND Is Less Than 100"
<static>  
LABKEY.Filter.merge(baseFilters, columnName, columnFilters)
Given an array of filter objects, return a new filterArray with old filters from a column removed and new filters for the column added If new filters are null, simply remove all old filters from baseFilters that refer to this column
<inner>  
validate(type, value, colName)
Note: this is an experimental API that may change unexpectedly in future releases.
Namespace Detail
LABKEY.Filter
Field Detail
<static> {Object} LABKEY.Filter.Types
Types static class to describe different types of filters.

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.BETWEEN
Finds rows where the column value is between the two filter values, inclusive. The values should be supplied as a comma-delimited list (example usage: -4,4).

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.CONTAINS
Finds rows where the column value contains the filter value. Note that this may result in a slow query as this cannot use indexes.

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.CONTAINS_NONE_OF
Finds rows where the column value does not contain any of the supplied filter values. The values should be supplied as a semi-colon-delimited list (example usage: a;b;c).

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.CONTAINS_ONE_OF
Finds rows where the column value contains any of the supplied filter values. The values should be supplied as a semi-colon-delimited list (example usage: a;b;c).

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.DATE_EQUAL
Finds rows where the date portion of a datetime column matches the filter value (ignoring the time portion).

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.DATE_NOT_EQUAL
Finds rows where the date portion of a datetime column does not match the filter value (ignoring the time portion).

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.DOES_NOT_CONTAIN
Finds rows where the column value does not contain the filter value. Note that this may result in a slow query as this cannot use indexes.

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.DOES_NOT_START_WITH
Finds rows where the column value does not start with the filter value.

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.EQUAL
Finds rows where the column value matches the given filter value. Case-sensitivity depends upon how your underlying relational database was configured.

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.GREATER_THAN
Finds rows where the column value is greater than the filter value.

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.GREATER_THAN_OR_EQUAL
Finds rows where the column value is greater than or equal to the filter value.

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.IN
Finds rows where the column value equals one of the supplied filter values. The values should be supplied as a semi-colon-delimited list (example usage: a;b;c).

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.LESS_THAN
Finds rows where the column value is less than the filter value.

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.LESS_THAN_OR_EQUAL
Finds rows where the column value is less than or equal to the filter value.

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.MEMBER_OF
Finds rows where the column value contains a user id that is a member of the group id of the supplied filter value.

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.MISSING
Finds rows where the column value is missing (null). Note that no filter value is required with this operator.

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.NOT_BETWEEN
Finds rows where the column value is not between the two filter values, exclusive. The values should be supplied as a comma-delimited list (example usage: -4,4).

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.NOT_EQUAL
Finds rows where the column value does not equal the filter value.

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.NOT_EQUAL_OR_MISSING
Finds rows where the column value does not equal the filter value, or is missing (null).

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.NOT_IN
Finds rows where the column value is not in any of the supplied filter values. The values should be supplied as a semi-colon-delimited list (example usage: a;b;c).

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.NOT_MISSING
Finds rows where the column value is not missing (is not null). Note that no filter value is required with this operator.

<static> {LABKEY.Filter.FilterDefinition} LABKEY.Filter.Types.STARTS_WITH
Finds rows where the column value starts with the filter value.
Method Detail
<static> LABKEY.Filter.create(columnName, value, filterType)
Creates a filter
Example: 
<script type="text/javascript">
	function onFailure(errorInfo, options, responseObj)
	{
	    if(errorInfo && errorInfo.exception)
	        alert("Failure: " + errorInfo.exception);
	    else
	        alert("Failure: " + responseObj.statusText);
	}

	function onSuccess(data)
	{
	    alert("Success! " + data.rowCount + " rows returned.");
	}

	LABKEY.Query.selectRows({
		schemaName: 'lists',
		queryName: 'People',
		success: onSuccess,
		failure: onFailure,
		filterArray: [
			LABKEY.Filter.create('FirstName', 'Johnny'),
			LABKEY.Filter.create('Age', 15, LABKEY.Filter.Types.LESS_THAN_OR_EQUAL)
            LABKEY.Filter.create('LastName', ['A', 'B'], LABKEY.Filter.Types.DOES_NOT_START_WITH)
		]
    });
</script> 
Parameters:
{String} columnName
String name of the column to filter
value
Value used as the filter criterion or an Array of values.
{LABKEY.Filter#Types} filterType Optional
Type of filter to apply to the 'column' using the 'value'

<static> {String} LABKEY.Filter.getFilterDescription(url, dataRegionName, columnName)
Convert from URL syntax filters to a human readable description, like "Is Greater Than 10 AND Is Less Than 100"
Parameters:
{String} url
URL containing the filter parameters
{String} dataRegionName
String name of the data region the column is a part of
{String} columnName
String name of the column to filter
Returns:
{String} human readable version of the filter

<static> LABKEY.Filter.merge(baseFilters, columnName, columnFilters)
Given an array of filter objects, return a new filterArray with old filters from a column removed and new filters for the column added If new filters are null, simply remove all old filters from baseFilters that refer to this column
Parameters:
{Array} baseFilters
Array of existing filters created by LABKEY.Filter.create
{String} columnName
Column name of filters to replace
{Array} columnFilters
Array of new filters created by LABKEY.Filter.create. Will replace any filters referring to columnName

<inner> validate(type, value, colName)
Note: this is an experimental API that may change unexpectedly in future releases. Validate a form value against the json type. Error alerts will be displayed.
Parameters:
type
The json type ("int", "float", "date", or "boolean")
value
The value to test.
colName
The column name to use in error messages.
Returns:
undefined if not valid otherwise a normalized string value for the type.

Documentation generated by JsDoc Toolkit 2.3.2 on Thu Mar 16 2017 20:36:35 GMT-0000 (UTC)