Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Context Actions in DataTable Component #208

Open
1 task done
alexdumea opened this issue Jun 4, 2024 · 0 comments
Open
1 task done

Custom Context Actions in DataTable Component #208

alexdumea opened this issue Jun 4, 2024 · 0 comments
Assignees
Labels
browser: chrome enhancement New feature or request good first issue 👋 Good for newcomers package: components @meteor/components status: in validation The team will validate this issue
Milestone

Comments

@alexdumea
Copy link

Package

@meteor/component-library

Browser

Chrome

Operating System

Windows

Package version

3.7.0

Assistive technology

No response

Description

Currently, the DataTable.vue component only supports enabling and disabling predefined context actions such as "Edit" and "Delete". However, there is a need to extend or overwrite these context actions with custom ones. For instance, instead of having "Edit" and "Delete", we need a custom label "View" that still triggers the same event (onOpenDetails).

Proposed Solution:
Introduce a new property rowContextActions to the DataTable.vue component. This property should accept an array of objects defining custom context actions. The proposed interface for these actions is as follows:

interface ContextActions {
	label: string
	onClick: (rowId: string) => void
	disabled?: boolean
	type?: "default" | "active" | "critical"
}

The rowContextActions property should be defined as:

rowContextActions: {
  type: Array as PropType<ContextActions[]>,
  required: false,
  default: () => [],
}

WCAG 2.1 Violation

No response

Steps to reproduce

Use mt-data-table component. You can't overwrite the context actions

Code of Conduct

@alexdumea alexdumea added enhancement New feature or request type: a11y ♿ Accessibility browser: chrome labels Jun 4, 2024
@Weltraumakustik Weltraumakustik added the good first issue 👋 Good for newcomers label Jun 6, 2024
@Weltraumakustik Weltraumakustik added the status: in validation The team will validate this issue label Jun 6, 2024
@Weltraumakustik Weltraumakustik added package: components @meteor/components and removed type: a11y ♿ Accessibility labels Dec 22, 2024
@Weltraumakustik Weltraumakustik added this to the 2025 Q1 milestone Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser: chrome enhancement New feature or request good first issue 👋 Good for newcomers package: components @meteor/components status: in validation The team will validate this issue
Projects
None yet
Development

No branches or pull requests

3 participants