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: Can not get table data for Column sortFunction and sortFunction calls only by click in header #3019

Closed
PetrivskyiTaras opened this issue Jun 30, 2022 · 2 comments · Fixed by #3027
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@PetrivskyiTaras
Copy link

Describe the bug

image

I'm using filtering and ordering for Data Table.
For one column I want to add a custom sortFunction but for it, I need table data and I can't get it anywhere, it is underhood of DataTable.

image

Could you provide data as an argument for this function?
Or provide a method to get this data. onValueChange calls after my custom sortFunction and I can't use this data.

Another problem is this function doesn't call when sortField and sortOrder are set. In my case, I get it from the back end on did mount. By default, these data are not set.

Reproducer

No response

PrimeReact version

8.0.0

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

Chrome

Steps to reproduce the behavior

No response

Expected behavior

No response

@PetrivskyiTaras PetrivskyiTaras added Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible Type: Bug Issue contains a defect related to a specific component. labels Jun 30, 2022
@melloware melloware added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Type: Bug Issue contains a defect related to a specific component. labels Jun 30, 2022
@melloware melloware changed the title Can not get table data for Column sortFunction and sortFunction calls only by click in header Datatable: Can not get table data for Column sortFunction and sortFunction calls only by click in header Jun 30, 2022
@melloware melloware removed the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jul 4, 2022
@melloware
Copy link
Member

I agree when I look at the source code I have no idea how sortFunction would ever actually work without passing you the data

melloware added a commit to melloware/primereact that referenced this issue Jul 4, 2022
melloware added a commit to melloware/primereact that referenced this issue Jul 4, 2022
@melloware melloware added this to the 8.2.0 milestone Jul 4, 2022
@melloware melloware assigned melloware and unassigned mertsincan Jul 4, 2022
@melloware
Copy link
Member

I submitted a PR for review.

melloware added a commit to melloware/primereact that referenced this issue Jul 5, 2022
melloware added a commit to melloware/primereact that referenced this issue Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants