    import Example from 'react-crud-admin/src/example.js'

public class | source

# Example

#### Extends:

react~React.Component → Admin → Example

## Constructor Summary

Public Constructor
public | constructor() |

## Member Summary

Public Members
public | extra_fields: {"now": *} |
public | field_transforms: {"name": *} |
public | is_object_equal: * |
public | list_display_links: string[] |
public | name: string |

## Method Summary

Public Methods
public | get_form(object: undefined): * |
public | get_list_display(): string[] |
public | get_queryset(): undefined[] |
public | search(term: *): * |
public | sort_by(sort_fields: *): * |
public | submit(form: *) |

## Inherited Summary

From class Admin
public | actions: {"delete": *} |
public | extra_fields: {} |
public | field_transforms: {} |
public | header_transforms: {} |
public | is_object_equal: * |
public | list_display: *[] |
public | list_display_links: *[] |
public | list_per_page: number |
public | live_search: boolean |
public | name: string |
public | name_plural: string |
public | sort_fields: *[] |
public | state: {"displayType": *, "total": *, "page_number": number, "object": *, "queryset": *, "selected_objects": *} |
private | _all_selected: boolean |
public | action_selected(action: string): * An event listener that listens to actions selected. |
public | get_actions(): object Gets an actions object whose properties are action names and values are action methods. |
public | get_form(object: object): * This functions returns a JSON Schema Form for editing the objects in the array returned by get_queryset(). |
public | get_list_display(): string[] Gets the list/array of properties/field names of the objects in the queryset to be displayed on the list display page. |
public | get_list_display_links(): string[] Gets the list/array of properties of the objects in the queryset that are clickable when displayed on the list display page. |
public | get_live_search(): boolean 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 | has_add_permission(): boolean Grants permission to add an object. |
public | has_change_permission(object: undefined): boolean Grants permission to change an object. |
public | has_delete_permission(object: object): boolean Grants permission to delete object. |
public | has_module_permission(): boolean Grants permission to access this admin interface. |
public | hide_progress() Changes the state property "loading" to false. |
public | nextPage() An event listener that listens when the next page is selected. |
public | prevPage() An event listener that listens when the previous page is selected. |
public | render(): * Renders the admin interface component |
public | render_progress(): * 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 | show_progress() 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 | _get_ordered_queryset(): object[] Returns an ordered queryset. |
private | _get_prop_label(label: *): * |
private | _get_table_body(): * Generate the table body for the list display page |
private | _get_table_header(): * |
private | _handle_search(event: object) 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 | _render_actions(): * Renders the actions select component |
private | _render_add_button(): * Renders the add object button. |
private | _render_back_button(): * Renders the back button component in the add/change view |
private | _render_pagination(): * Renders the pagination UI |
private | _render_search_field(): * Renders the search component |
private | _render_table(): * Renders the table in the display page. |
private | _sort_handler(field: *): * |

## Public Constructors

### public constructor() source

#### Override:

Admin#constructor

## Public Members

### public extra_fields: {"now": *} source

#### Override:

Admin#extra_fields

### public field_transforms: {"name": *} source

#### Override:

Admin#field_transforms

### public is_object_equal: * source

#### Override:

Admin#is_object_equal

### public list_display_links: string[] source

#### Override:

Admin#list_display_links

### public name: string source

#### Override:

Admin#name

## Public Methods

### public get_form(object: undefined): * source

This functions returns a JSON Schema Form for editing the objects in the array returned by get_queryset(). This method needs to be overridden to so as to return a Form Component for the object. Learn more on JSON schema forms from https://github.com/mozilla-services/react-jsonschema-form and JSON Schema from https://spacetelescope.github.io/understanding-json-schema/

#### Override:

Admin#get_form

#### Params:

Name | Type | Attribute | Description
object | undefined | optional default: undefined |

#### Return:

*

### 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[]

### public search(term: *): * source

Implements search. This method should be overridden to implement a custom search

#### Override:

Admin#search

#### Params:

Name | Type | Attribute | Description
term | * |  |

#### Return:

*

### public sort_by(sort_fields: *): * source

#### Override:

Admin#sort_by

#### Params:

Name | Type | Attribute | Description
sort_fields | * |  |

#### Return:

*

### public submit(form: *) source

#### Params:

Name | Type | Attribute | Description
form | * |  |