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

DataTable: Incorrect passthrough types #5588

Open
slavco86 opened this issue Apr 15, 2024 · 0 comments
Open

DataTable: Incorrect passthrough types #5588

slavco86 opened this issue Apr 15, 2024 · 0 comments
Labels
Component: Documentation Issue or pull request is related to Documentation

Comments

@slavco86
Copy link

slavco86 commented Apr 15, 2024

Describe the bug

There are 2 issues at hand:

  1. TS definitions for DataTablePassThroughOptions are not in sync with documentation. Specifically, in TS file we have this column?: ColumnPassThroughOptionType; , but in documentation it's DataTablePassThroughOptionType
  2. Neither of the definitions are actually what is being passed to the passthrough method, in terms of arguments. Instead of being passed either ColumnPassThroughOptionType or DataTablePassThroughOptionType - the callback method for the column is being passed this:
    Screenshot 2024-04-15 at 19 16 16

On a practical level, I'm unable to style the DataTable based on the loading prop value because either parentInstance property doesn't exist on ColumnPassThroughOptionType where I can get hold of loading value or if I go via parent property through to $parentInstance where I can see loading property - the value is not representing what is currently being passed to the component via a loading prop (which is being correctly presented via parentInstance property, which is missing from TS definitions).

Hope this is quick to fix and not too much to ask 🙏

Reproducer

https://stackblitz.com/edit/primevue-create-vue-typescript-issue-template-yu6yrx?file=src%2Fmain.ts

PrimeVue version

3.51.0

Vue version

3.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

Chrome 123.0.6312.123

Steps to reproduce the behavior

Go to repro link, open console, inspect the object being outputted into the console

Expected behavior

I should be able to obtain loading prop via pass through options callback without TS errors

@slavco86 slavco86 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 15, 2024
@tugcekucukoglu tugcekucukoglu added Component: Documentation Issue or pull request is related to Documentation and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Documentation Issue or pull request is related to Documentation
Projects
None yet
Development

No branches or pull requests

2 participants