IAttributeElementLoader
Handles the loading of the attribute elements.
export interface IAttributeElementLoader
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
Registers a callback that will be fired when the initialization of total count was canceled. Returns unsubscribe function, that will unregister it. | |||
Registers a callback that will be fired when error is thrown during the total count initialization. Returns unsubscribe function, that will unregister it. | |||
Registers a callback that will be fired when the initialization of total count starts. Returns unsubscribe function, that will unregister it, once called. | |||
CallbackRegistration<OnInitTotalCountSuccessCallbackPayload> | Registers a callback that will be fired when the initialization of total count is successfully completed. Returns unsubscribe function, that will unregister it. | ||
CallbackRegistration<OnLoadCustomElementsCancelCallbackPayload> | Registers a callback that will be fired when the custom elements load was canceled. Returns unsubscribe function, that will unregister it. | ||
CallbackRegistration<OnLoadCustomElementsErrorCallbackPayload> | Registers a callback that will be fired when error is thrown during the custom elements load. Returns unsubscribe function, that will unregister it. | ||
CallbackRegistration<OnLoadCustomElementsStartCallbackPayload> | Registers a callback that will be fired when the custom elements load starts. Returns unsubscribe function, that will unregister it, once called. Multiple callbacks can be registered by this function. | ||
CallbackRegistration<OnLoadCustomElementsSuccessCallbackPayload> | Registers a callback that will be fired when the custom elements load is successfuly completed. Returns unsubscribe function, that will unregister it. | ||
CallbackRegistration<OnLoadInitialElementsPageCancelCallbackPayload> | Registers a callback that will be fired when the initial elements page load was canceled. Returns unsubscribe function, that will unregister it. | ||
CallbackRegistration<OnLoadInitialElementsPageErrorCallbackPayload> | Registers a callback that will be fired when error is thrown during the initial elements page load. Returns unsubscribe function, that will unregister it. | ||
CallbackRegistration<OnLoadInitialElementsPageStartCallbackPayload> | Registers a callback that will be fired when the initial elements page load starts. Returns unsubscribe function, that will unregister it, once called. Multiple callbacks can be registered by this function. | ||
CallbackRegistration<OnLoadInitialElementsPageSuccessCallbackPayload> | Registers a callback that will be fired when the initial elements page load is successfuly completed. Returns unsubscribe function, that will unregister it. | ||
CallbackRegistration<OnLoadIrrelevantElementsCancelCallbackPayload> | Registers a callback that will be fired when the irrelevant elements load was canceled. Returns unsubscribe function, that will unregister it. | ||
CallbackRegistration<OnLoadIrrelevantElementsErrorCallbackPayload> | Registers a callback that will be fired when error is thrown during the irrelevant elements load. Returns unsubscribe function, that will unregister it. | ||
CallbackRegistration<OnLoadIrrelevantElementsStartCallbackPayload> | Registers a callback that will be fired when the irrelevant elements load starts. Returns unsubscribe function, that will unregister it, once called. Multiple callbacks can be registered by this function. | ||
CallbackRegistration<OnLoadIrrelevantElementsSuccessCallbackPayload> | Registers a callback that will be fired when the irrelevant elements load is successfuly completed. Returns unsubscribe function, that will unregister it. | ||
CallbackRegistration<OnLoadNextElementsPageCancelCallbackPayload> | Registers a callback that will be fired when the next elements page load was canceled. Returns unsubscribe function, that will unregister it. | ||
CallbackRegistration<OnLoadNextElementsPageErrorCallbackPayload> | Registers a callback that will be fired when error is thrown during the next elements page load. Returns unsubscribe function, that will unregister it. | ||
CallbackRegistration<OnLoadNextElementsPageStartCallbackPayload> | Registers a callback that will be fired when the next elements page load starts. Returns unsubscribe function, that will unregister it, once called. Multiple callbacks can be registered by this function. | ||
CallbackRegistration<OnLoadNextElementsPageSuccessCallbackPayload> | Registers a callback that will be fired when the next elements page load is successfuly completed. Returns unsubscribe function, that will unregister it. |
Methods
Method | Description |
|---|---|
Cancels the running custom elements load, if it matches the specified correlation. | |
Cancels the running initial elements page load, if any. | |
Cancels the running irrelevant elements load, if it matches the specified correlation. | |
Cancels the running next elements page load, if any. | |
Returns all attribute elements loaded by initialElementsPageLoad and nextElementsPageLoad methods. | |
Get the label used for representing the attribute filter elements visually if defined. | |
Returns the attribute elements for the specified keys. | |
Returns error, if it was thrown during the initial elements page load, undefined otherwise. | |
Returns the current status of the initial elements page load. | |
Returns error, if it was thrown during the total count initialization, undefined otherwise. | |
Returns the current status of the total count initialization. | |
Returns the current limit used for the attribute element loads. | |
Returns the current attribute filters used to filter the attribute element loads. | |
Returns metadata of the attributes set by IAttributeElementLoader.setLimitingAttributeFilters(). Note that these attributes will be available only after successful initialization, or after successful IAttributeElementLoader.loadInitialElementsPage() load. | |
Returns the current date filters used to filter the attribute element loads. | |
Returns the current measures used to filter the attribute element loads. | |
Return the current validation items used to filter the attribute element loads. | |
Returns error, if it was thrown during the next elements page load, undefined otherwise. | |
Returns the current status of the next elements page load. | |
Returns the current offset used for the attribute element loads. | |
Returns the current order used for the attribute element loads. | |
Returns the current search string used to filter the attribute element loads. | |
Returns the total count of the attribute elements. Total elements count is loaded by default only for child filters. | |
Returns the total count of the attribute elements with currently set options. | |
Starts load of total count | |
Loads the attribute elements with the provided options. | |
Resets the paging and loads the attribute elements with the current options. | |
Loads the irrelevant subset of currently selected elements. Irrelevant elements are the selected elements that may be filtered out by limiting filters. | |
Loads next page of the attribute elements with the current options. | |
Set the label used for representing the attribute filter elements visually. | |
Set attribute’s display form | |
Set the limit for the upcoming attribute element loads. | |
Set the attribute filters to filter the upcoming attribute element loads. | |
Set the date filters to filter the upcoming attribute element loads. | |
Set the measures to filter the upcoming attribute element loads. | |
Set the validation items to filter the upcoming attribute element loads. | |
Set the order for the upcoming attribute element loads. | |
Set the search to filter the upcoming attribute element loads. |
Property details
IAttributeElementLoader.onInitTotalCountCancelproperty
Registers a callback that will be fired when the initialization of total count was canceled. Returns unsubscribe function, that will unregister it.
onInitTotalCountCancel: CallbackRegistration<OnInitTotalCountCancelCallbackPayload>;
IAttributeElementLoader.onInitTotalCountErrorproperty
Registers a callback that will be fired when error is thrown during the total count initialization. Returns unsubscribe function, that will unregister it.
onInitTotalCountError: CallbackRegistration<OnInitTotalCountErrorCallbackPayload>;
IAttributeElementLoader.onInitTotalCountStartproperty
Registers a callback that will be fired when the initialization of total count starts. Returns unsubscribe function, that will unregister it, once called.
onInitTotalCountStart: CallbackRegistration<OnInitTotalCountStartCallbackPayload>;
IAttributeElementLoader.onInitTotalCountSuccessproperty
Registers a callback that will be fired when the initialization of total count is successfully completed. Returns unsubscribe function, that will unregister it.
onInitTotalCountSuccess: CallbackRegistration<OnInitTotalCountSuccessCallbackPayload>;
IAttributeElementLoader.onLoadCustomElementsCancelproperty
Registers a callback that will be fired when the custom elements load was canceled. Returns unsubscribe function, that will unregister it.
onLoadCustomElementsCancel: CallbackRegistration<OnLoadCustomElementsCancelCallbackPayload>;
Remarks
Multiple callbacks can be registered by this function.
IAttributeElementLoader.onLoadCustomElementsErrorproperty
Registers a callback that will be fired when error is thrown during the custom elements load. Returns unsubscribe function, that will unregister it.
onLoadCustomElementsError: CallbackRegistration<OnLoadCustomElementsErrorCallbackPayload>;
Remarks
Multiple callbacks can be registered by this function.
IAttributeElementLoader.onLoadCustomElementsStartproperty
Registers a callback that will be fired when the custom elements load starts. Returns unsubscribe function, that will unregister it, once called.
Multiple callbacks can be registered by this function.
onLoadCustomElementsStart: CallbackRegistration<OnLoadCustomElementsStartCallbackPayload>;
IAttributeElementLoader.onLoadCustomElementsSuccessproperty
Registers a callback that will be fired when the custom elements load is successfuly completed. Returns unsubscribe function, that will unregister it.
onLoadCustomElementsSuccess: CallbackRegistration<OnLoadCustomElementsSuccessCallbackPayload>;
Remarks
Multiple callbacks can be registered by this function.
IAttributeElementLoader.onLoadInitialElementsPageCancelproperty
Registers a callback that will be fired when the initial elements page load was canceled. Returns unsubscribe function, that will unregister it.
onLoadInitialElementsPageCancel: CallbackRegistration<OnLoadInitialElementsPageCancelCallbackPayload>;
Remarks
Multiple callbacks can be registered by this function.
IAttributeElementLoader.onLoadInitialElementsPageErrorproperty
Registers a callback that will be fired when error is thrown during the initial elements page load. Returns unsubscribe function, that will unregister it.
onLoadInitialElementsPageError: CallbackRegistration<OnLoadInitialElementsPageErrorCallbackPayload>;
Remarks
Multiple callbacks can be registered by this function.
IAttributeElementLoader.onLoadInitialElementsPageStartproperty
Registers a callback that will be fired when the initial elements page load starts. Returns unsubscribe function, that will unregister it, once called.
Multiple callbacks can be registered by this function.
onLoadInitialElementsPageStart: CallbackRegistration<OnLoadInitialElementsPageStartCallbackPayload>;
IAttributeElementLoader.onLoadInitialElementsPageSuccessproperty
Registers a callback that will be fired when the initial elements page load is successfuly completed. Returns unsubscribe function, that will unregister it.
onLoadInitialElementsPageSuccess: CallbackRegistration<OnLoadInitialElementsPageSuccessCallbackPayload>;
Remarks
Multiple callbacks can be registered by this function.
IAttributeElementLoader.onLoadIrrelevantElementsCancelproperty
Registers a callback that will be fired when the irrelevant elements load was canceled. Returns unsubscribe function, that will unregister it.
onLoadIrrelevantElementsCancel: CallbackRegistration<OnLoadIrrelevantElementsCancelCallbackPayload>;
Remarks
Multiple callbacks can be registered by this function.
IAttributeElementLoader.onLoadIrrelevantElementsErrorproperty
Registers a callback that will be fired when error is thrown during the irrelevant elements load. Returns unsubscribe function, that will unregister it.
onLoadIrrelevantElementsError: CallbackRegistration<OnLoadIrrelevantElementsErrorCallbackPayload>;
Remarks
Multiple callbacks can be registered by this function.
IAttributeElementLoader.onLoadIrrelevantElementsStartproperty
Registers a callback that will be fired when the irrelevant elements load starts. Returns unsubscribe function, that will unregister it, once called.
Multiple callbacks can be registered by this function.
onLoadIrrelevantElementsStart: CallbackRegistration<OnLoadIrrelevantElementsStartCallbackPayload>;
IAttributeElementLoader.onLoadIrrelevantElementsSuccessproperty
Registers a callback that will be fired when the irrelevant elements load is successfuly completed. Returns unsubscribe function, that will unregister it.
onLoadIrrelevantElementsSuccess: CallbackRegistration<OnLoadIrrelevantElementsSuccessCallbackPayload>;
Remarks
Multiple callbacks can be registered by this function.
IAttributeElementLoader.onLoadNextElementsPageCancelproperty
Registers a callback that will be fired when the next elements page load was canceled. Returns unsubscribe function, that will unregister it.
onLoadNextElementsPageCancel: CallbackRegistration<OnLoadNextElementsPageCancelCallbackPayload>;
Remarks
Multiple callbacks can be registered by this function.
IAttributeElementLoader.onLoadNextElementsPageErrorproperty
Registers a callback that will be fired when error is thrown during the next elements page load. Returns unsubscribe function, that will unregister it.
onLoadNextElementsPageError: CallbackRegistration<OnLoadNextElementsPageErrorCallbackPayload>;
Remarks
Multiple callbacks can be registered by this function.
IAttributeElementLoader.onLoadNextElementsPageStartproperty
Registers a callback that will be fired when the next elements page load starts. Returns unsubscribe function, that will unregister it, once called.
Multiple callbacks can be registered by this function.
onLoadNextElementsPageStart: CallbackRegistration<OnLoadNextElementsPageStartCallbackPayload>;
IAttributeElementLoader.onLoadNextElementsPageSuccessproperty
Registers a callback that will be fired when the next elements page load is successfuly completed. Returns unsubscribe function, that will unregister it.
onLoadNextElementsPageSuccess: CallbackRegistration<OnLoadNextElementsPageSuccessCallbackPayload>;
Remarks
Multiple callbacks can be registered by this function.
Method details
IAttributeElementLoader.cancelCustomElementsLoad()method
Cancels the running custom elements load, if it matches the specified correlation.
cancelCustomElementsLoad(correlation?: Correlation): void;
Parameters
Parameter | Type | Description |
|---|---|---|
correlation | (Optional) |
Returns
void
IAttributeElementLoader.cancelInitialElementsPageLoad()method
Cancels the running initial elements page load, if any.
cancelInitialElementsPageLoad(): void;
Returns
void
IAttributeElementLoader.cancelIrrelevantElementsLoad()method
Cancels the running irrelevant elements load, if it matches the specified correlation.
cancelIrrelevantElementsLoad(correlation?: Correlation): void;
Parameters
Parameter | Type | Description |
|---|---|---|
correlation | (Optional) |
Returns
void
IAttributeElementLoader.cancelNextElementsPageLoad()method
Cancels the running next elements page load, if any.
cancelNextElementsPageLoad(): void;
Returns
void
IAttributeElementLoader.getAllElements()method
Returns all attribute elements loaded by initialElementsPageLoad and nextElementsPageLoad methods.
getAllElements(): IAttributeElement[];
Returns
Remarks
It does not return attribute elements loaded by loadCustomElements method. To get them, you should use callbacks or getElementsByKey method.
IAttributeElementLoader.getDisplayAsLabel()method
Get the label used for representing the attribute filter elements visually if defined.
getDisplayAsLabel(): ObjRef | undefined;
Returns
ObjRef | undefined
IAttributeElementLoader.getElementsByKey()method
Returns the attribute elements for the specified keys.
getElementsByKey(keys: AttributeElementKey[]): IAttributeElement[];
Parameters
Parameter | Type | Description |
|---|---|---|
keys |
Returns
Remarks
If the attribute elements for the specified keys are not loaded, error is thrown.
IAttributeElementLoader.getInitialElementsPageError()method
Returns error, if it was thrown during the initial elements page load, undefined otherwise.
getInitialElementsPageError(): GoodDataSdkError | undefined;
Returns
GoodDataSdkError | undefined
IAttributeElementLoader.getInitialElementsPageStatus()method
Returns the current status of the initial elements page load.
getInitialElementsPageStatus(): AsyncOperationStatus;
Returns
IAttributeElementLoader.getInitTotalCountError()method
Returns error, if it was thrown during the total count initialization, undefined otherwise.
getInitTotalCountError(): GoodDataSdkError | undefined;
Returns
GoodDataSdkError | undefined
IAttributeElementLoader.getInitTotalCountStatus()method
Returns the current status of the total count initialization.
getInitTotalCountStatus(): AsyncOperationStatus;
Returns
IAttributeElementLoader.getLimit()method
Returns the current limit used for the attribute element loads.
getLimit(): number;
Returns
number
IAttributeElementLoader.getLimitingAttributeFilters()method
Returns the current attribute filters used to filter the attribute element loads.
getLimitingAttributeFilters(): IElementsQueryAttributeFilter[];
Returns
IAttributeElementLoader.getLimitingAttributeFiltersAttributes()method
Returns metadata of the attributes set by IAttributeElementLoader.setLimitingAttributeFilters().
Note that these attributes will be available only after successful initialization, or after successful IAttributeElementLoader.loadInitialElementsPage() load.
getLimitingAttributeFiltersAttributes(): IAttributeMetadataObject[];
Returns
IAttributeElementLoader.getLimitingDateFilters()method
Returns the current date filters used to filter the attribute element loads.
getLimitingDateFilters(): (IRelativeDateFilter | IAbsoluteDateFilter)[];
Returns
IAttributeElementLoader.getLimitingMeasures()method
Returns the current measures used to filter the attribute element loads.
getLimitingMeasures(): IMeasure[];
Returns
IMeasure[]
IAttributeElementLoader.getLimitingValidationItems()method
Return the current validation items used to filter the attribute element loads.
getLimitingValidationItems(): ObjRef[];
Returns
ObjRef[]
IAttributeElementLoader.getNextElementsPageError()method
Returns error, if it was thrown during the next elements page load, undefined otherwise.
getNextElementsPageError(): GoodDataSdkError | undefined;
Returns
GoodDataSdkError | undefined
IAttributeElementLoader.getNextElementsPageStatus()method
Returns the current status of the next elements page load.
getNextElementsPageStatus(): AsyncOperationStatus;
Returns
IAttributeElementLoader.getOffset()method
Returns the current offset used for the attribute element loads.
getOffset(): number;
Returns
number
IAttributeElementLoader.getOrder()method
Returns the current order used for the attribute element loads.
getOrder(): SortDirection | undefined;
Returns
SortDirection | undefined
IAttributeElementLoader.getSearch()method
Returns the current search string used to filter the attribute element loads.
getSearch(): string;
Returns
string
IAttributeElementLoader.getTotalElementsCount()method
Returns the total count of the attribute elements. Total elements count is loaded by default only for child filters.
getTotalElementsCount(): number | undefined;
Returns
number | undefined
IAttributeElementLoader.getTotalElementsCountWithCurrentSettings()method
Returns the total count of the attribute elements with currently set options.
getTotalElementsCountWithCurrentSettings(): number | undefined;
Returns
number | undefined
IAttributeElementLoader.initTotalCount()method
Starts load of total count
initTotalCount(correlation?: Correlation): void;
Parameters
Parameter | Type | Description |
|---|---|---|
correlation | (Optional) correlation that will be included in all callbacks fired by this method |
Returns
void
IAttributeElementLoader.loadCustomElements()method
Loads the attribute elements with the provided options.
loadCustomElements(options: ILoadElementsOptions, correlation?: Correlation): void;
Parameters
Parameter | Type | Description |
|---|---|---|
options | options to apply for the custom elements load | |
correlation | (Optional) correlation that will be included in all callbacks fired by this method |
Returns
void
Remarks
This is useful, if you want to load additional attribute elements with different options than the currently set.
Multiple custom elements loads will run in parallel.
Cancels the running custom elements load, if it matches the specified correlation, and starts it again.
You can provide a correlation that will be included in the payload of all callbacks fired as a result of calling this method.
IAttributeElementLoader.loadInitialElementsPage()method
Resets the paging and loads the attribute elements with the current options.
loadInitialElementsPage(correlation?: Correlation): void;
Parameters
Parameter | Type | Description |
|---|---|---|
correlation | (Optional) correlation that will be included in all callbacks fired by this method |
Returns
void
Remarks
You should call this every time you change the load options (eg search, limit, limitingAttribute filters, etc).
Throws error if you call it before the initialization.
Throws error if you combine staticElements with unsupported elements load options (limitingAttributeFilters, limitingMeasures or limitingDateFilters).
Cancels the running initial elements page load, if any, and starts it again.
Cancels the running next elements page load, if any.
You can provide a correlation that will be included in the payload of all callbacks fired as a result of calling this method.
IAttributeElementLoader.loadIrrelevantElements()method
Loads the irrelevant subset of currently selected elements.
Irrelevant elements are the selected elements that may be filtered out by limiting filters.
loadIrrelevantElements(correlation?: Correlation): void;
Parameters
Parameter | Type | Description |
|---|---|---|
correlation | (Optional) correlation that will be included in all callbacks fired by this method |
Returns
void
Remarks
This is useful, if you want to load additional irrelevant elements with different options than the currently set.
Multiple loads will run in parallel.
Cancels the running irrelevant elements load, if it matches the specified correlation, and starts it again.
You can provide a correlation that will be included in the payload of all callbacks fired as a result of calling this method.
IAttributeElementLoader.loadNextElementsPage()method
Loads next page of the attribute elements with the current options.
loadNextElementsPage(correlation?: Correlation): void;
Parameters
Parameter | Type | Description |
|---|---|---|
correlation | (Optional) correlation that will be included in all callbacks fired by this method |
Returns
void
Remarks
Throws error if you call it before the initialization.
Throws error if you changed the load options and did not called loadInitialElementsPage before.
Cancels the running next elements page load, if any, and starts it again.
You can provide a correlation that will be included in the payload of all callbacks fired as a result of calling this method.
IAttributeElementLoader.setDisplayAsLabel()method
Set the label used for representing the attribute filter elements visually.
setDisplayAsLabel(displayAsLabel: ObjRef | undefined): void;
Parameters
Parameter | Type | Description |
|---|---|---|
displayAsLabel | ObjRef | undefined |
Returns
void
IAttributeElementLoader.setDisplayForm()method
Set attribute’s display form
setDisplayForm(displayForm: ObjRef): void;
Parameters
Parameter | Type | Description |
|---|---|---|
displayForm |
Returns
void
IAttributeElementLoader.setLimit()method
Set the limit for the upcoming attribute element loads.
setLimit(limit: number): void;
Parameters
Parameter | Type | Description |
|---|---|---|
limit | number | the limit to use. |
Returns
void
Remarks
When you change the options for the attribute element loads, you should call initial elements page load.
IAttributeElementLoader.setLimitingAttributeFilters()method
Set the attribute filters to filter the upcoming attribute element loads.
setLimitingAttributeFilters(filters: IElementsQueryAttributeFilter[]): void;
Parameters
Parameter | Type | Description |
|---|---|---|
filters | filters to use. |
Returns
void
Remarks
When you change the options for the attribute element loads, you should call initial elements page load.
Throws error when the backend implementation does not support parent filtering.
IAttributeElementLoader.setLimitingDateFilters()method
Set the date filters to filter the upcoming attribute element loads.
setLimitingDateFilters(filters: (IRelativeDateFilter | IAbsoluteDateFilter)[]): void;
Parameters
Parameter | Type | Description |
|---|---|---|
filters | filters to use. |
Returns
void
Remarks
When you change the options for the attribute element loads, you should call initial elements page load.
IAttributeElementLoader.setLimitingMeasures()method
Set the measures to filter the upcoming attribute element loads.
setLimitingMeasures(measures: IMeasure[]): void;
Parameters
Parameter | Type | Description |
|---|---|---|
measures | IMeasure[] | measures to use. |
Returns
void
Remarks
When you change the options for the attribute element loads, you should call initial elements page load.
IAttributeElementLoader.setLimitingValidationItems()method
Set the validation items to filter the upcoming attribute element loads.
setLimitingValidationItems(validateBy: ObjRef[]): void;
Parameters
Parameter | Type | Description |
|---|---|---|
validateBy | ObjRef[] | measures to use. |
Returns
void
Remarks
When you change the options for the attribute element loads, you should call initial elements page load.
Throws error when the backend implementation does not support elements validation filtering.
IAttributeElementLoader.setOrder()method
Set the order for the upcoming attribute element loads.
setOrder(order: SortDirection): void;
Parameters
Parameter | Type | Description |
|---|---|---|
order | the order to use. |
Returns
void
Remarks
When you change the options for the attribute element loads, you should call initial elements page load.
IAttributeElementLoader.setSearch()method
Set the search to filter the upcoming attribute element loads.
setSearch(search: string): void;
Parameters
Parameter | Type | Description |
|---|---|---|
search | string | the search string to use. Use empty string to reset search. |
Returns
void
Remarks
When you change the options for the attribute element loads, you should call initial elements page load.