Example
Extends:
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
extra_fields: {"now": *} |
|
public |
field_transforms: {"name": *} |
|
public |
|
|
public |
|
|
public |
|
Method Summary
Public Methods | ||
public |
|
|
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 |
|
|
public |
|
|
public |
list_display: *[] |
|
public |
list_display_links: *[] |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
sort_fields: *[] |
|
public |
state: {"displayType": *, "total": *, "page_number": number, "object": *, "queryset": *, "selected_objects": *} |
|
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 |
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 |
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 |
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 |
Grants permission to access this admin interface. |
|
public |
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 |
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 |
Changes the state property "loading" to true. |
|
public |
sort_by(sort_fields: *): * |
|
private |
_create_object_link(object: object, label: string): * |
|
private |
_display_field(object: *, item: *): * |
|
private |
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 Members
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_formParams:
Name | Type | Attribute | Description |
object | 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_displaypublic 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_querysetpublic search(term: *): * source
Implements search. This method should be overridden to implement a custom search
Override:
Admin#searchParams:
Name | Type | Attribute | Description |
term | * |
Return:
* |
public sort_by(sort_fields: *): * source
Override:
Admin#sort_byParams:
Name | Type | Attribute | Description |
sort_fields | * |
Return:
* |
public submit(form: *) source
Params:
Name | Type | Attribute | Description |
form | * |