@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
55 lines (54 loc) • 1.81 kB
TypeScript
import { GridFilter, NamedQuery } from '../types';
/**
* Provides run-time access to Grid Filter section of Adaptable State.
*/
export interface GridFilterApi {
/**
* Retrieves the Grid Filter from the current Layout
* @returns Grid Filter
*/
getCurrentGridFilter(): GridFilter | undefined;
/**
* Re-applies the Grid Filter
*/
reApplyGridFilter(): void;
/**
* Retrieves the Grid Filter's Expression from the current layout
* @returns Grid Filter Expression
*/
getCurrentGridFilterExpression(): string | undefined;
/**
* Sets the Grid Filter (for the current layout)
*
* If `expression` is `null`, `undefined` or a blank string the Grid Filter
* is cleared (equivalent to calling {@link clearGridFilter}). This makes
* it safe to drive the Grid Filter from form-style controls that emit
* empty values when the user deselects everything, without having to
* branch in the caller.
*
* @param expression filter string, or a falsy value to clear the filter
*/
setGridFilterExpression(expression: string | null | undefined): void;
/**
* Sets the Grid Filter (for the current layout)
* @param namedQuery: NamedQuery to use
*/
setGridFilterExpressionUsingNamedQuery(namedQuery: NamedQuery): void;
/**
* Clears the Grid Filter (for the current Layout)
*/
clearGridFilter(): void;
/**
* Opens the AdapTableQL UI Components (Expression Editor & Query Builder)
* @param expression current Grid Filter expression
*/
openUIEditorForGridFilter(expression?: string): void;
/**
* Suspends the Grid Filter
*/
suspendGridFilter(): void;
/**
* Unsuspends the Grid Filter
*/
unSuspendGridFilter(): void;
}