Class ListControllerBase

Componente che si occupa di mostrare un elenco di Risorse ottenute dalle API, e di fornire gli strumenti di gestione per la modifica, l'eliminazione e principalmente la navigazione.

Hierarchy

  • Component<Props, State>
    • ListControllerBase

Index

Constructors

constructor

Properties

context

context: any

props

props: Readonly<object> & Readonly<Props>

refs

refs: object

Type declaration

  • [key: string]: ReactInstance

Accessors

columns

pagination

  • get pagination(): any
  • Calcola i dati di paginazione in base allo stato corrente. Può essere disabilitato rimuovendo la proprietà Model.pagination o impostandola a null.

    Returns any

title

  • get title(): __type

Methods

componentWillMount

  • componentWillMount(): Promise<void>

forceUpdate

  • forceUpdate(callBack?: undefined | function): void
  • Parameters

    • Optional callBack: undefined | function

    Returns void

handleDelete

handleFilterChange

  • handleFilterChange(filter: any): Promise<void>

handleTableChange

  • handleTableChange(pagination: any, filters: any, sorters: any): void
  • Gestisce la modifica delle opzioni di visualizzazioni presenti nella Table, in modo da aggiornare i dati con le richieste alle API.

    Parameters

    • pagination: any
    • filters: any
    • sorters: any

    Returns void

load

  • load(): Promise<void>
  • Si occupa di scaricare i record in base alle API, e di registrarli nello State per la visualizzazione.

    todo

    Aggiungere retry.

    Returns Promise<void>

render

  • render(): Element

setState

  • setState<K>(f: function, callback?: undefined | function): void
  • setState<K>(state: Pick<State, K>, callback?: undefined | function): void
  • Type parameters

    • K: keyof S

    Parameters

    • f: function
        • (prevState: Readonly<State>, props: Props): Pick<State, K>
        • Parameters

          • prevState: Readonly<State>
          • props: Props

          Returns Pick<State, K>

    • Optional callback: undefined | function

    Returns void

  • Type parameters

    • K: keyof S

    Parameters

    • state: Pick<State, K>
    • Optional callback: undefined | function

    Returns void

Static Optional componentDidCatch

  • componentDidCatch(error: Error, errorInfo: ErrorInfo): void
  • Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.

    Parameters

    • error: Error
    • errorInfo: ErrorInfo

    Returns void

Static Optional componentDidMount

  • componentDidMount(): void
  • Called immediately after a compoment is mounted. Setting state here will trigger re-rendering.

    Returns void

Static Optional componentDidUpdate

  • componentDidUpdate(prevProps: Readonly<Props>, prevState: Readonly<State>, prevContext: any): void
  • Called immediately after updating occurs. Not called for the initial render.

    Parameters

    • prevProps: Readonly<Props>
    • prevState: Readonly<State>
    • prevContext: any

    Returns void

Static Optional componentWillMount

  • componentWillMount(): void
  • Called immediately before mounting occurs, and before Component#render. Avoid introducing any side-effects or subscriptions in this method.

    Returns void

Static Optional componentWillReceiveProps

  • componentWillReceiveProps(nextProps: Readonly<Props>, nextContext: any): void
  • Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.

    Calling Component#setState generally does not trigger this method.

    Parameters

    • nextProps: Readonly<Props>
    • nextContext: any

    Returns void

Static Optional componentWillUnmount

  • componentWillUnmount(): void
  • Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as cancelled network requests, or cleaning up any DOM elements created in componentDidMount.

    Returns void

Static Optional componentWillUpdate

  • componentWillUpdate(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): void
  • Called immediately before rendering when new props or state is received. Not called for the initial render.

    Note: You cannot call Component#setState here.

    Parameters

    • nextProps: Readonly<Props>
    • nextState: Readonly<State>
    • nextContext: any

    Returns void

Static Optional shouldComponentUpdate

  • shouldComponentUpdate(nextProps: Readonly<Props>, nextState: Readonly<State>, nextContext: any): boolean
  • Called to determine whether the change in props and state should trigger a re-render.

    Component always returns true. PureComponent implements a shallow comparison on props and state and returns true if any props or states have changed.

    If false is returned, Component#render, componentWillUpdate and componentDidUpdate will not be called.

    Parameters

    • nextProps: Readonly<Props>
    • nextState: Readonly<State>
    • nextContext: any

    Returns boolean

Object literals

state

state: object

loading

loading: boolean = true

pagination

pagination: object

Type declaration

query

query: object

Type declaration

records

records: never[] = []

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc