Enable to change the route for update/create/..

Table Actions: manualTableActionsFn

This method defines the actions available in a project table (e.g., update, delete). It is used to customize the actions for each row of the table.

override manualTableActionsFn: (
  item?: Project | undefined
) => Partial<BaseTableColumnAction>[] = (item: Project | undefined) => [
  {
    key: CmsActionEnum.update,
    label: 'update',
    icon: 'pi pi-pencil',
  },
  {
    key: CmsActionEnum.delete,
    label: 'delete',
    icon: 'pi pi-trash',
    severity: 'danger',
  },
];

Explanation

  • Purpose: Returns an array of table actions based on the project row (item).

  • Actions:

    • Update: Allows the user to edit a project.

    • Delete: Allows the user to delete a project (with a danger severity style).

  • Integration: The key corresponds to enum values that are likely mapped to route or modal logic in your UI logic layer

Path
Component
Description

/project

ProjectComponent

Base component with child routing

/project/

ProjectsListComponent

List of all projects

/project/new-create

ProjectCreateComponent

Form to create a new project

/project/new-update/:id

ProjectUpdateComponent

Form to update an existing project

/project/view/:id

ProjectDetailsComponent

View detailed info for a project

what is the relations between the routes and the manualTableActionsFn is

  • It defines which actions (e.g., update, delete) appear in your UI (e.g., buttons in a table row).

  • But it does not define what happens when the button is clicked.

2. Routing Handles Navigation

Your route config:

This defines which URL goes to which screen (/project/new-update/123 goes to ProjectUpdateComponent).

Last updated