| [ Web Proxy ] |
| Viewing: https://adminforth.dev/docs/api/Back/interfaces/AdminForthResourceColumn/ | [Back] [Original] |
Omit<AdminForthResourceColumnCommon, "showIn" | "backendOnly">
optional_underlineType?:string
Internal type which indicates original type of column in database.
AdminForthResourceColumnCommon._underlineType
optionalallowMinMaxQuery?:boolean
Allow AdminForth to execute SELECT min(column) and SELECT max(column) queries to get min and max values for this column. This would improve UX of filters by adding sliders for numeric columns.
NOTE: By default is option is false to prevent performance issues on large tables.
If you are going to set it to true, make sure you have a one-item index on this column (one index for each column which has it) or ensure your table will not have a large number of records.
AdminForthResourceColumnInputCommon.allowMinMaxQuery
optionalallowModifyWhenNotShowInCreate?:boolean
Allows setting this column on Create requests even when showIn.create resolves to false.
Default is false.
This is useful for custom create components which update hidden/technical fields via
update:recordFieldValue.
AdminForthResourceColumnInputCommon.allowModifyWhenNotShowInCreate
optionalallowModifyWhenNotShowInEdit?:boolean
Allows updating this column on Edit requests even when showIn.edit resolves to false.
Default is false.
This is useful for custom edit components which update hidden/technical fields via
update:recordFieldValue.
AdminForthResourceColumnInputCommon.allowModifyWhenNotShowInEdit
optionalbackendOnly?:BackendOnlyInput
optionalcomponents?:AdminForthFieldComponents
Custom components which will be used to render this field in the admin panel.
AdminForthResourceColumnInputCommon.components
optionaleditingNote?:object
Whether AdminForth will show editing note near the field in edit/create form.
optionalcreate?:string
optionaledit?:string
AdminForthResourceColumnCommon.editingNote
optionaleditReadonly?:boolean
Whether AdminForth will allow to edit this field in editing mode.
AdminForthResourceColumnInputCommon.editReadonly
optionalenforceLowerCase?:boolean
Will automatically convert any capital letters to lowercase in input during editing
AdminForthResourceColumnInputCommon.enforceLowerCase
optionalenum?:AdminForthColumnEnumItem[]
Enum of possible values for this field.
AdminForthResourceColumnInputCommon.enum
optionalextra?:object
An optional configuration object for extra settings.
optionaljsonCollapsedLevel?:number
How many levels of JSON should be collapsed.
0 means - root level will be already collapsed e.g. {a:1} will show {...} where '...' is clickable
1 means - root level will be shown, but next sub-level will be collapsed e.g. {a: {b: 1}} will show {a: ...} where '...' is clickable
Default is 1.
AdminForthResourceColumnInputCommon.extra
optionalfillOnCreate?:FillOnCreateFunction
Called on the backend when the record is saved to a database. Value returned by fillOnCreate will be saved to the database.
AdminForthResourceColumnInputCommon.fillOnCreate
optionalfilterOptions?:object
optionaldebounceTimeMs?:number
Decrease number of requests by adding debounce time to filter requests.
optionalmultiselect?:boolean
Boolean value that determines what select input type to display on filter page.
optionalsubstringSearch?:boolean
If false - will force EQ operator for filter instead of ILIKE.
AdminForthResourceColumnInputCommon.filterOptions
optionalforeignResource?:AdminForthForeignResource
Foreign resource which has pk column with values same that written in this column.
AdminForthResourceColumnInputCommon.foreignResource
optionalinputPrefix?:string
Prefix and suffix for input field on create and edit pages.
AdminForthResourceColumnInputCommon.inputPrefix
optionalinputSuffix?:string
AdminForthResourceColumnInputCommon.inputSuffix
optionalisArray?:object
Defines whether column is array and what type of items it contains. AdminForth will use this information to render proper input fields in the admin panel with control buttons to add and remove items. If enabled, requires column type to be JSON. Cannot be used with masked columns, columns with foreignResource or primary key columns.
optionalallowDuplicateItems?:boolean
If enabled, AdminForth will allow to add items with the same value.
enabled:
boolean
itemType:
AdminForthDataTypes
Type of items in array. Cannot be JSON or RICHTEXT.
AdminForthResourceColumnInputCommon.isArray
optionalisUnique?:boolean
Whether AdminForth will request user to enter unique value during creating or editing record. This option causes AdminForth to make a request to database to check if value is unique. (Constraints are not used, so for large-tables performance make sure you have unique index in database if you set this option to true)
AdminForthResourceColumnInputCommon.isUnique
optionallabel?:string
How column can be labled in the admin panel. Use it for renaming columns. Defaulted to column name with Uppercased first letter.
AdminForthResourceColumnInputCommon.label
optionallistCssClass?:string
Custom CSS class applied to the column in list view header and cells.
AdminForthResourceColumnInputCommon.listCssClass
optionallistSticky?:boolean
Sticky position for column
AdminForthResourceColumnInputCommon.listSticky
optionalmasked?:boolean
Masked fields will be displayed as ***** on Edit and Create pages.
AdminForthResourceColumnInputCommon.masked
optionalmax?:number
Maximum value stored in this field.
AdminForthResourceColumnCommon.max
optionalmaxLength?:number
Maximum length of string that can be entered in this field.
AdminForthResourceColumnInputCommon.maxLength
optionalmaxValue?:number
Maximum value that can be entered in this field.
AdminForthResourceColumnInputCommon.maxValue
optionalmin?:number
Minimal value stored in this field.
AdminForthResourceColumnCommon.min
optionalminLength?:number
Minimum length of string that can be entered in this field.
AdminForthResourceColumnInputCommon.minLength
optionalminValue?:number
Minimum value that can be entered in this field.
AdminForthResourceColumnInputCommon.minValue
name:
string
Column name in database.
AdminForthResourceColumnInputCommon.name
optionalnormalize?: (value) =>any
Normalizes a column value before AdminForth CRUD create and update operations and, when this column
is configured as auth.usernameField, before the password-login lookup.
Does not normalize filter values or existing stored records.
| Parameter | Type |
|---|---|
value | any |
any
normalize: (value: string) => value.trim().toLowerCase(),
AdminForthResourceColumnInputCommon.normalize
optionalprimaryKey?:boolean
Whether to use this column as record identifier. Only one column can be primary key. AdminForth tries to guess primary key automatically first.
AdminForthResourceColumnInputCommon.primaryKey
optionalrequired?:object
Whether AdminForth will require this field to be filled in create and edit forms. Can be set to boolean or object with create and edit properties. If boolean, it will be used for both create and edit forms.
optionalcreate?:boolean
optionaledit?:boolean
AdminForthResourceColumnCommon.required
optionalshowIf?:Predicate
Show field only if certain conditions are met.
AdminForthResourceColumnInputCommon.showIf
optionalshowIn?:ShowIn
optionalsortable?:boolean
Whether to allow this column to be sortable in list view. If true, AdminForth will add sorting buttons to the column header in list view and clicking on it will change sorting state of the column.
AdminForthResourceColumnInputCommon.sortable
optionalsuggestOnCreate?:string|number|boolean|object|suggestOnCreateFunction
Single value that will be substituted in create form. User can change it before saving the record.
AdminForthResourceColumnInputCommon.suggestOnCreate
optionaltype?:AdminForthDataTypes
Type of data in column. AdminForth will use this information to render proper input fields in the admin panel. AdminForth tries to guess type of data from database column type automatically for typed databases like SQL-based. However you can explicitly set it to any value. E.g. set AdminForthDataTypes.DATETIME for your string column in SQLite, which stores ISO date strings.
AdminForthResourceColumnInputCommon.type
optionalvalidation?:ValidationObject[]
Runtime validation Regexp rules for this field.
AdminForthResourceColumnInputCommon.validation
optionalvirtual?:boolean
Allows to make the field which does not exist in database table. Examples: add custom show field with user country flag:
{
label: 'Country Flag',
type: AdminForthDataTypes.STRING,
virtual: true,
showIn: {
[AdminForthResourcePages.edit]: false,
[AdminForthResourcePages.create]: false,
[AdminForthResourcePages.filter]: false,
},
components: {
show: '@@/CountryFlag.vue',
list: '@@/CountryFlag.vue',
},
}
This field will be displayed in show and list views with custom component CountryFlag.vue. CountryFlag.vue should be placed in custom folder and can be next:
<template>
{{ getFlagEmojiFromIso(record.ipCountry) }}
</template>
<script setup>
const props = defineProps(['record']);
function getFlagEmojiFromIso(iso) {
return iso.toUpperCase().replace(/./g, (char) => String.fromCodePoint(char.charCodeAt(0) + 127397));
}
</script>
| Web Proxy Viewer | New URL | Original Page |