gregnb / gregnb/mui-datatables

Sorting/Filtering 1 Column Resulting in Wrong Indices

Open
#709 3 comments 0 reactions 0 assignees View on GitHub
needs verification
Dominant language
JavaScript
Stars
2.7k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

## Expected Behavior
Filtering the table using a specific string for a result or sorting a column based on alphabetical order should result in the correct indices being selected.

## Current Behavior
When I had filtered for a specific result or sorted a column based on ascending/descending alphabetical order, I would click on the delete button to have that column removed.

The index that is being captured belongs to that of the filtered/sorted list, and when the deletion is being processed, it will result in the item with the index in the original table (before filtering/sorting) being deleted.

For example, let's say the list is B, A, D right now. After searching for A, it turns up as the only result from the search. I select A and press delete (the index detected is 0). However, B is actually the one being deleted because it is index 0 in the original B, A, D list.

## Steps to Reproduce (for bugs)
See above example.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.