Kind: Class
Source: Pams/Web/Pams.WebApp/Client/app/core/models/dashboard-data-fields.ts (line 316)
Part of: Pams
Delta represents a dashboard data field and stores its field name, persisted name, display caption, and DeltaTypeEnum type. It also tracks whether the field should be hidden when dashboard data is displayed or processed.
Methods
| Method | Signature | Returns |
|---|---|---|
isHidden | isHidden() | boolean |
setHidden | setHidden(flag: boolean) | void |
GetStoredName | GetStoredName() | string |
SetStoredName | SetStoredName(name: string) | void |
GetFieldName | GetFieldName() | string |
SetFieldName | SetFieldName(name: string) | void |
GetType | GetType() | DeltaTypeEnum |
SetType | SetType(type: DeltaTypeEnum) | void |
GetCaption | GetCaption() | string |
SetCaption | SetCaption(input: string) | void |
SetDataType | SetDataType(ty: DataTypeEnum) | void |
GetDataType | GetDataType() | DataTypeEnum |
GetFieldNameTarget | GetFieldNameTarget() | string |
SetFieldNameTarget | SetFieldNameTarget(name: string) | void |
GetStoredNameTarget | GetStoredNameTarget() | string |
SetStoredNameTarget | SetStoredNameTarget(name: string) | void |
Where it refuses work
Deltastops the work with an early return whenthis.FieldName.
Diagram
mermaidgraph LR Delta[Delta] StoredName[Stored Name] FieldName[Field Name] Caption[Caption] Type[DeltaTypeEnum] Hidden[Hidden State] Delta --> StoredName Delta --> FieldName Delta --> Caption Delta --> Type Delta --> Hidden
Usage
tsimport { Delta, DeltaTypeEnum } from "./dashboard-data-fields";
function createDashboardField(type: DeltaTypeEnum): Delta {
const delta = new Delta();
delta.SetStoredName("totalAmount");
delta.SetFieldName("TotalAmount");
delta.SetCaption("Total Amount");
delta.SetType(type);
delta.setHidden(false);
return delta;
}
const field = createDashboardField(existingField.GetType());
if (!field.isHidden()) {
console.log(field.GetCaption(), field.GetFieldName());
}
AI Coding Instructions
- Keep dashboard field metadata in
Deltathrough its getter and setter methods rather than duplicating field-name mappings elsewhere. - Use
GetStoredName()for persisted or backend-facing field identifiers andGetFieldName()for the dashboard field identifier. - Check
isHidden()before rendering or exposing a field in dashboard UI code. - Pass a valid
DeltaTypeEnumvalue toSetType()so consumers can handle the field according to its configured type.
Was this page helpful?