DataTables / DataTables/RowReorder

Reorder on Sort enhancement

Open
#2 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
23
Forks
27
PR merge metrics
No merged PRs in 30d

Description

In the following example:
http://www.datatables.net/extensions/rowreorder/examples/initialisation/simple.html
when a user sorts data on the table it does not alter the sequence numbers, so a user cannot use the sorts to reset the sequence numbers before customizing the sequence orders, so if a users has a particular sequence order right now they have to manually drag each item on the list into the right sequence.

Instead I think that when a user sorts the data by any of the columns other than the first column, there should be a setting to update the Seq. numbers with the newly sorted order. 'reorderOnSort: true or false' so that if i sort by names, then the first number in the sequence would be 'Airi Satou', and the sort numbers would proceed in alphabetical order.
If the new option is 'true', the table will create a event listener on sorting, or perhaps the fnDrawCallback, and then after a table has changed, it updates the sequence numbers to whatever new position they are in the table.

Secondly, when a row is manually reordered by a users, the sort should automatically be removed from whichever column has it, and if the Seq. column is visible, it will indicate that the rows are now sorted by the Seq. column. Thus if the table is sorted by names, and then I drag a name to a different spot on the list, with the 'reorderOnSort' as true, the sort indicator would switch to the seq. list when it updates the positions since the list is no longer sorted by names.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked RowReorder example and trace how sorting and manual row movement are currently handled. Define the behavior for the proposed reorderOnSort setting, including sequence updates and sort-indicator changes, then identify how it should be validated.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.