Class

ViewHelpers

ViewHelpers()

Collection of helper methods available in the views

Classes

ViewHelpers

Methods

# bulkActionUrl(options) → {string}

Returns bulkAction url
Parameters:
Name Type Attributes Description
options BulkActionParams
resourceId string
recordIds Array.<string> <optional>
actionName string

View Source adminjs/src/backend/utils/view-helpers/view-helpers.ts, line 365

string

# bulkDeleteUrl(resourceId, recordIds, searchopt) → {string}

Returns url for a `bulkDelete` action in given Resource. Uses bulkActionUrl
Parameters:
Name Type Attributes Description
resourceId string

id to the resource

recordIds Array.<string>

separated by comma records

search string <optional>

optional query string

View Source adminjs/src/backend/utils/view-helpers/view-helpers.ts, line 329

string

# dashboardUrl() → {string}

Returns URL for the dashboard

View Source adminjs/src/backend/utils/view-helpers/view-helpers.ts, line 263

string

# deleteUrl(resourceId, recordId, searchopt) → {string}

Returns url for a `delete` action in given Resource. Uses recordActionUrl
Parameters:
Name Type Attributes Description
resourceId string

id to the resource

recordId string

id to the record

search string <optional>

optional query string

View Source adminjs/src/backend/utils/view-helpers/view-helpers.ts, line 301

string

# editUrl(resourceId, recordId, searchopt) → {string}

Returns url for a `edit` action in given Resource. Uses recordActionUrl
Parameters:
Name Type Attributes Description
resourceId string

id to the resource

recordId string

id to the record

search string <optional>

optional query string

View Source adminjs/src/backend/utils/view-helpers/view-helpers.ts, line 281

string

# listUrl(resourceId, searchopt) → {string}

Returns url for a `list` action in given Resource. Uses resourceActionUrl
Parameters:
Name Type Attributes Description
resourceId string

id to the resource

search string <optional>

optional query string

View Source adminjs/src/backend/utils/view-helpers/view-helpers.ts, line 319

string

# loginUrl() → {string}

Returns login URL

View Source adminjs/src/backend/utils/view-helpers/view-helpers.ts, line 251

string

# logoutUrl() → {string}

Returns logout URL

View Source adminjs/src/backend/utils/view-helpers/view-helpers.ts, line 257

string

# newUrl(resourceId, searchopt) → {string}

Returns url for a `new` action in given Resource. Uses resourceActionUrl
Parameters:
Name Type Attributes Description
resourceId string

id to the resource

search string <optional>

optional query string

View Source adminjs/src/backend/utils/view-helpers/view-helpers.ts, line 310

string

# pageUrl(pageName) → {string}

Returns URL for given page name
Parameters:
Name Type Description
pageName string

page name which is a unique key specified in AdminJSOptions

View Source adminjs/src/backend/utils/view-helpers/view-helpers.ts, line 271

string

# recordActionUrl(options) → {string}

Returns recordAction url
Parameters:
Name Type Description
options RecordActionParams
resourceId string
recordId string
actionName string

View Source adminjs/src/backend/utils/view-helpers/view-helpers.ts, line 353

string

# resourceActionUrl(options) → {string}

Returns resourceAction url
Parameters:
Name Type Attributes Description
options ResourceActionParams
resourceId string
actionName string
search string <optional>

optional query string

View Source adminjs/src/backend/utils/view-helpers/view-helpers.ts, line 341

string

# showUrl(resourceId, recordId, searchopt) → {string}

Returns url for a `show` action in given Resource. Uses recordActionUrl
Parameters:
Name Type Attributes Description
resourceId string

id to the resource

recordId string

id to the record

search string <optional>

optional query string

View Source adminjs/src/backend/utils/view-helpers/view-helpers.ts, line 291

string

Type Definitions

object

# ActionParams

Base Params for a any function
Properties:
Name Type Attributes Description
resourceId string

Unique Resource ID

actionName string

Action name

search string <optional>

Optional query string: ?....

View Source adminjs/src/backend/utils/view-helpers/view-helpers.ts, line 208

object

# BulkActionParams

Params for a bulk action
Properties:
Name Type Attributes Description
recordIds Array.<string> <optional>

Array of Records ID

View Source adminjs/src/backend/utils/view-helpers/view-helpers.ts, line 225

object

# RecordActionParams

Params for a record action
Properties:
Name Type Description
recordId string

Record ID

View Source adminjs/src/backend/utils/view-helpers/view-helpers.ts, line 217