Home Reference Source
import Example from 'react-crud-admin/src/example1.js'
public class | source

Example

Extends:

react~React.ComponentAdmin → Example

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public

Method Summary

Public Methods
public
public

Inherited Summary

From class Admin
public

actions: {"delete": *}

public
public
public
public
public
public
public
public
public
public
public
public

state: {"displayType": *, "total": *, "page_number": number, "object": *, "queryset": *, "selected_objects": *}

Initialize the state of the component

private
public

action_selected(action: string): *

An event listener that listens to actions selected.

public

Gets an actions object whose properties are action names and values are action methods.

public

Returns an object whose properties are extra field names not corresponding to properties of any object in the queryset and whose values are display functions.

public

Returns an object whose properties are field names corresponding to properties of any object in the queryset and whose values are transform functions.

public

get_form(object: object): *

This functions returns a JSON Schema Form for editing the objects in the array returned by get_queryset().

public

Returns an object whose properties are field names corresponding to properties of any object in the queryset and whose values are transform functions.

public

Gets the list/array of properties/field names of the objects in the queryset to be displayed on the list display page.

public

Gets the list/array of properties of the objects in the queryset that are clickable when displayed on the list display page.

public

Returns a true/false value.

public

get_queryset(page_number: *, list_per_page: *): object[]

This function returns an array of objects that will serve as the queryset for the admin interface.

public

Grants permission to add an object.

public

Grants permission to change an object.

public

Grants permission to delete object.

public

Grants permission to the this admin interface.

public

Changes the state property "loading" to false.

public

An event listener that listens when the next page is selected.

public

An event listener that listens when the previous page is selected.

public

render(): *

Renders the admin interface component

public

The default progress indicator.

public

response_add(options: *): boolean

This method should be overriden and called after saving an object in the add/change view.

public

response_change(options: *): boolean

This method should be overriden and called after saving an object in the add/change view.

public

search(term: string): object[]

Implements search.

public

selectPage(page: number): *

An event listener that listens when a page is selected.

public

select_all(event: *)

This method is an event handler that listens to when all objects of the queryset displayed within a single display page are selected

public

select_one(object: *): *

This method is an event handler that listens when a single objects of the queryset displayed is selected

public

set_queryset(queryset: *)

public

Changes the state property "loading" to true.

public

sort_by(sort_fields: *): *

private

_create_object_link(object: object, label: string): *

A private method to wrap a table entry in an tag in the display page.

private

_display_field(object: *, item: *): *

private

Returns an ordered queryset.

private

_get_prop_label(label: *): *

private

Generate the table body for the list display page

private
private

An event listener that listens to the search event.

private

_object_link_clicked(object: *): *

private

_order_state_arrow(field: strin): *

This method adds up/down arrows to field headers on the list display page table

private

_refresh_queryset(queryset: *)

private

Renders the actions select component

private

Renders the add object button.

private

Renders the back button component in the add/change view

private

Renders the pagination UI

private

Renders the search component

private

Renders the table in the display page.

private

_sort_handler(field: *): *

Public Constructors

public constructor() source

Override:

Admin#constructor

Public Members

Override:

Admin#list_display_links

public name: string source

Override:

Admin#name

public name_plural: string source

Override:

Admin#name_plural

Public Methods

public get_list_display(): string[] source

Gets the list/array of properties/field names of the objects in the queryset to be displayed on the list display page. It can be overwritten by the member variable listdisplay. A property is any string that should exist in the objects within a queryset and works with lodash's .at function. See more at https://lodash.com/docs/4.17.4#at

Override:

Admin#get_list_display

Return:

string[]

public get_queryset(): undefined[] source

This function returns an array of objects that will serve as the queryset for the admin interface. Typically involves an HTTP request to a backend.

Override:

Admin#get_queryset

Return:

undefined[]