Home Reference Source
import BaseCellConfigurator from 'prg-editor/src/cells/BaseCellConfigurator.js'
public class | source

BaseCellConfigurator

Direct Subclass:

ActionCellConfigurator, src/cells/RelationCellConfigurator.js~RelationCellConfigurator, TextCellConfigurator

Common interface of {TableBuilder} cell configurator

Constructor Summary

Public Constructor
public

constructor(attr: string, name: string, translator: function(text: string): string)

Creates an instance of BaseCellConfigurator.

Method Summary

Public Methods
public

map(fn: function(value: string, data: object): any): BaseCellConfigurator

Set Filter function for column

public

orderBy(defaultDirection: number, fieldName: string): BaseCellConfigurator

Set field to order by

public

Use this field as default orderer

Public Constructors

public constructor(attr: string, name: string, translator: function(text: string): string) source

Creates an instance of BaseCellConfigurator.

Params:

NameTypeAttributeDescription
attr string

Object attribute key

name string

Column name

translator function(text: string): string
  • optional
  • default: null

Text translator

Public Methods

public map(fn: function(value: string, data: object): any): BaseCellConfigurator source

Set Filter function for column

Params:

NameTypeAttributeDescription
fn function(value: string, data: object): any

Preprocessor function

Return:

BaseCellConfigurator

this

public orderBy(defaultDirection: number, fieldName: string): BaseCellConfigurator source

Set field to order by

Params:

NameTypeAttributeDescription
defaultDirection number
  • optional
  • default: 0

-1=desc, 1=asc, 0=without direction

fieldName string
  • optional

override name of field which will be sent to API

Return:

BaseCellConfigurator

this

public orderByDefault(): BaseCellConfigurator source

Use this field as default orderer

Return:

BaseCellConfigurator

this