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

Fixed "dataKey" prop type in all components that use it #770

Closed
wants to merge 1 commit into from

Conversation

nestorrente
Copy link
Contributor

As done with "sortField" property in #743, this PR fixes the "dataKey" property type in the following components and its corresponding type definition files:

  • DataTable
  • TableBody
  • Dropdown
  • Listbox
  • MultiSelect
  • OrderList
  • PickList
  • SelectButton
  • Timeline

@tugcekucukoglu
Copy link
Member

dataKey is not a function type. Thanks for the PR.

@nestorrente
Copy link
Contributor Author

Hi @tugcekucukoglu!

I think that's not right, as the dataKey prop can actually be a function. If you take a look at the code of the DataTable component, you can see that the value of the dataKey prop is passed to the ObjectUtils.resolveFieldData(), in which the field can be a function.

In fact, I'm using the dataKey prop as a function in one of my projects (where I had to fork PrimeVue in order to apply this fix for the type) and it's working like a charm. I'd like this to be solved in PrimeVue, so I can use the official version again instead of my patched fork.

Thank you for your time and consideration.

@rubasace
Copy link

Hi @tugcekucukoglu ,

I'm facing the exact same limitation. As @nestorrente showed, dataKey can actually be a function and PrimeVue code is already taking that into consideration in several places.

I think this PR should be reopen and properly reviewed.

Thank you for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants