Getting Started
Usages
Columns
API References
ngx-panemu-table / Class

PanemuTableService

Decorators:@Injectable

No documentation has been provided.

Constructor

No documentation has been provided.

Presentation
constructor(
	@Inject() protected locale: string
): PanemuTableService;
Parameters
NameTypeDescription
@Inject
p
locale
string

Properties

NameTypeDescription
DEFAULT_LABEL_TRANSLATION
LabelTranslation

Methods

buildColumns()

Build columns for the table. This method handle column initialization. The options argument is by default taken from PanemuTableService.getColumnOptions()

Presentation
buildColumns(columns: (NonGroupColumn<T> | GroupedColumn)[], options?: DefaultColumnOptions | undefined): ColumnDefinition<T>;
Parameters
NameTypeDescription
columns
(NonGroupColumn<T> | GroupedColumn)[]
options
DefaultColumnOptions | undefined

any specified value will override PanemuTableService.getColumnOptions().

Returns

ColumnDefinition<T>

deleteTableState()

Delete table state. If you override it, ensure to also override PanemuTableService.saveTableState() and PanemuTableService.getTableState().

Presentation
deleteTableState(stateKey: string): Observable<null>;
Parameters
NameTypeDescription
stateKey
string
Returns

Observable<null>

getColumnOptions()

Unspecified properties in BaseColumn use values returned by this method.

Presentation
getColumnOptions(): Required<DefaultColumnOptions>;
Returns

Required<DefaultColumnOptions>

getDateCellFormatter()

Get default formatter for ColumnType.DATE. Default is EEE, d MMM yyyy

Presentation
getDateCellFormatter(): CellFormatter;
Returns

CellFormatter

getDateFilterComponent()

Default ColumnType.DATE filter component used by PanemuQueryComponent.

Presentation
getDateFilterComponent(): Type<FilterEditor>;
Returns

Type<FilterEditor>

getDateTimeCellFormatter()

Get default formatter for ColumnType.DATETIME. Default is d MMM yyyy H:mm:ss

Presentation
getDateTimeCellFormatter(): CellFormatter;
Returns

CellFormatter

getDateTimeFilterComponent()

Default ColumnType.DATETIME filter component used by PanemuQueryComponent.

Presentation
getDateTimeFilterComponent(): Type<FilterEditor>;
Returns

Type<FilterEditor>

getDecimalCellFormatter()

Get default formatter for ColumnType.DECIMAL

Presentation
getDecimalCellFormatter(): CellFormatter;
Returns

CellFormatter

getDefaultCellFormatter()

Get default cell formatter. It does nothing beside changing null or undefined to empty string.

Presentation
getDefaultCellFormatter(): CellFormatter;
Returns

CellFormatter

getDefaultFilterComponent()

Default filter component used by PanemuQueryComponent.

Presentation
getDefaultFilterComponent(): Type<FilterEditor>;
Returns

Type<FilterEditor>

getGroupModifierFormatter()

Get group modifier formatter.

Presentation
getGroupModifierFormatter(modifier: string): CellFormatter;
Parameters
NameTypeDescription
modifier
string
Returns

CellFormatter

getIntCellFormatter()

Get default formatter for ColumnType.INT

Presentation
getIntCellFormatter(): CellFormatter;
Returns

CellFormatter

getLabelTranslation()

Get label translation. Intended for internationalization.

Presentation
getLabelTranslation(): LabelTranslation;
Returns

LabelTranslation

getMapFilterComponent()

Default ColumnType.MAP filter component used by PanemuQueryComponent.

Presentation
getMapFilterComponent(): Type<FilterEditor>;
Returns

Type<FilterEditor>

getMapFormatter()

No documentation has been provided.

Presentation
getMapFormatter(map: Signal<{ [key: string]: any; }>): CellFormatter;
Parameters
NameTypeDescription
map
Signal<{ [key: string]: any; }>
Returns

CellFormatter

getMonthCellFormatter()

Get default formatter for GroupBy functionality where the column type is ColumnType.DATE or ColumnType.DATETIME and the modifier is 'month'

Presentation
getMonthCellFormatter(): CellFormatter;
Returns

CellFormatter

getPaginationMaxRows()

Get default value for pagination maxRows. Override this method to apply default maxRows app-wide.

Presentation
getPaginationMaxRows(): number;
Returns

number

getPaginationMaxRowsLimit()

Limit for pagination maxRows to prevent user entering too big range in pagination input range for example 1-1000. In that case the maxRows is 1000 and it is bigger than the value returned by this method (500 by default). The pagination will fallback to 1-500.

Presentation
getPaginationMaxRowsLimit(): number;
Returns

number

getTableOptions()

Get default table options.

Presentation
getTableOptions(): Required<TableOptions<T>>;
Returns

Required<TableOptions<T>>

getTableState()

Get table state. The state is by default stored in local storage. This method returns an Observable so it can be overriden with http call in case developer save the state in server side. If you override it, ensure to also override PanemuTableService.saveTableState() and PanemuTableService.deleteTableState().

Presentation
getTableState(stateKey: string): Observable<TableState | null>;
Parameters
NameTypeDescription
stateKey
string
Returns

Observable<TableState | null>

getYearCellFormatter()

Get default formatter for GroupBy functionality where the column type is ColumnType.DATE or ColumnType.DATETIME and the modifier is 'year'

Presentation
getYearCellFormatter(): CellFormatter;
Returns

CellFormatter

handleError()

Function to handle error. Override this method to have your own error handler.

Presentation
handleError(err: any): (err: any) => void;
Parameters
NameTypeDescription
err
any
Returns

(err: any) => void

saveTableState()

By default TableState is saved to local storage. Override this method if you want to save it in a database server. If you override it, ensure to also override PanemuTableService.getTableState() and PanemuTableService.deleteTableState().

Presentation
saveTableState(stateKey: string, state: TableState): void;
Parameters
NameTypeDescription
stateKey
string
state
TableState
Returns

void