File

projects/aoc-client/components/aoc-grid/aoc-grid-field/aoc-grid-field.component.ts

Description

parent form. These models can be manipulated with sub-forms that will not save the model to the database until parent form is saved or via form groups edited inline directly on the cells.

Implements

OnInit OnDestroy AfterContentInit ControlValueAccessor

Metadata

Index

Properties
Methods
Inputs
Outputs
HostBindings
Accessors

Constructor

constructor(ngControl: NgControl, aocRestService: AocRestService, aocFormWindowService: AocFormWindowService, aocGridEditableTemplateNamePipe: AocGridEditableTemplateNamePipe, aocIoService: AocIoService, aocMisc: AocMisc, aocUiWindowDynRef: AocUiWindowDynRef, aocFormController: AocFormController, l: AocUiLoggerDirective)
Parameters :
Name Type Optional
ngControl NgControl No
aocRestService AocRestService No
aocFormWindowService AocFormWindowService No
aocGridEditableTemplateNamePipe AocGridEditableTemplateNamePipe No
aocIoService AocIoService No
aocMisc AocMisc No
aocUiWindowDynRef AocUiWindowDynRef No
aocFormController AocFormController No
l AocUiLoggerDirective No

Inputs

addAddButton
Type : boolean
Default value : true

Whether add or not the add button (optional): if true (default) will show the add button if model config allows adding objects. if false will remove the add button overriding model configuration allow capability.

addCloneButton
Type : boolean
Default value : true

Whether add or not the clone button (optional): if true (default) will show the clone button if model config allows cloning objects. if false will remove the clone button overriding model configuration allow capability.

addEditButton
Type : boolean
Default value : true

Whether add or not the edit button (optional): if true (default) will show the edit button if model config allows editing objects. if false will remove the edit button overriding model configuration allow capability.

autoExpand
Type : boolean

Expand automatically the contents of the expansion template, defaults to false.

buttonConfig
Type : AocGridToolbarButtonConfig

Custom toolbar button config (optional).

cloneFilter
Type : AocGridFieldCloneFilter<T>
Default value : {}

Clone filter, fields in the object will be assigned, not cloned

columns
Type : AocGridColumn[]

The columns of the grid (mandatory).

customSort
Type : function

Custom sort, has top priority

dragAndDropHandler
Type : | AocDropHandler<T>

Function that will optionally be called when an element is dropped

dynamicFormGroupConfig
Type : AocDynFormGroup
Default value : {}
emptyGroupDescriptor
Type : any
Default value : $localize`:@@AOC_GRID_FIELD_NO_GROUP:No group`
enableDragAndDrop
Type : boolean
Default value : false

Enables drag and drop of an element within the list (useful for reordering)

formGroupTemplate
Type : AocGridFieldFormGroupTemplate

This template defines the form group of a row, a copy will be created for each model of the grid (optional).

groupConfig
Type : AocGridGroupConfig<any>
modelChangeEventFiring
Type : "real time" | "on edit complete"
Default value : 'on edit complete'

Defines when model change events will be triggered while editing a field (default is 'on edit complete')

modelChangeFireInvalidValues
Type : boolean
Default value : false

Defines whether model change events will be sent for invalid values (default is false)

modelConfig
Type : AocModelConfig<T>

The associated model configuration (mandatory).

relationField
Type : string
Default value : 'id'

Indicates the field that relates to parent to correctly handle the states

relationMode
Type : "direct" | "pivot"
Default value : 'direct'

Indicates if we check the already existing relation on the model, or we need to check it out on the database. If we have a pure N-N relation where target models are not deleted, just related, and should have its own id, pivot mode should be set. Example: user <- user_group -> group with user_group as non-existing model as pivot. We don't have a model of user_group, so we have to check if a row is already related using relationModel with optimized database calls.

relationModel
Type : AocModel

If relation mode is 'pivot' we need to check the already existing relation against a relation model. If no relation model is provided, main form model will be taken via aoc form controller.

rowNgClass
Type : AocGridRowNgClass<AocModel>
rowNgStyle
Type : AocGridRowNgStyle<AocModel>
sortDir
Type : "asc" | "desc"

The sort direction, defaults to "asc"

sortField
Type : AocUiFieldPath

The sort field, local sort only

Outputs

modelChange
Type : EventEmitter

Output event emitter for model events (@see AocGridFieldModelEventType). Any to be able to use typed AocModelEvent

selectedChange
Type : EventEmitter

HostBindings

class
Type : any
style
Type : literal type

Methods

registerOnChange
registerOnChange(fn: any)
Parameters :
Name Type Optional
fn any No
Returns : void
registerOnTouched
registerOnTouched(fn: any)
Parameters :
Name Type Optional
fn any No
Returns : void
writeValue
writeValue(newModels: T[])
Parameters :
Name Type Optional
newModels T[] No
Returns : void

Properties

aocUiToolbarTemplates
Type : QueryList<AocUiToolbarDirective>
Decorators :
@ContentChildren(AocUiToolbarDirective)
cellTemplateDirectives
Type : QueryList<AocGridCellDirective>
Decorators :
@ContentChildren(AocGridCellDirective)
groupTemplateDirectives
Type : QueryList<AocGridGroupDirective>
Decorators :
@ContentChildren(AocGridGroupDirective)
Optional mobileResizedStyle
Type : literal type
Decorators :
@HostBinding('style')
rowExpansionTemplate
Type : AocUiTableTemplateDirective
Decorators :
@ContentChild(AocUiTableTemplateDirective)

Accessors

controlClasses
getcontrolClasses()
columns
getcolumns()
setcolumns(cols: AocGridColumn[])

The columns of the grid (mandatory).

Parameters :
Name Type Optional
cols AocGridColumn[] No
Returns : void
autoExpand
getautoExpand()
setautoExpand(e)

Expand automatically the contents of the expansion template, defaults to false.

Parameters :
Name Optional
e No
Returns : void
groupConfig
getgroupConfig()
setgroupConfig(groupConfig: AocGridGroupConfig<any>)
Parameters :
Name Type Optional
groupConfig AocGridGroupConfig<any> No
Returns : void

results matching ""

    No results matching ""