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

[Propose] [WIP] - SimpleReorderOperation, when you need a simple way to order items #5766

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

susanu
Copy link
Contributor

@susanu susanu commented Jan 31, 2025

WHY

I have some items that need to be sorted in a specific way, this is controlled by a single column in the database called order.
I tried the classic ReorderOperation but it works only with multiple columns.
I just want a dumb, simple ordering, no levels, no trees.

Works similar to ReorderOperation, have the same configuration with a small change.
NOTE: Use either ReorderOperation or SimpleReorderOperation

Example:

protected function setupReorderOperation(): void
{
    CRUD::set('reorder.label', 'product.name');
    CRUD::set('reorder.column', 'order');
}

What is different:
Removed following settings:

  • max_level
  • reorderColumnNames

Added following settings:

  • column -> the db column that is used to sort the items

Let me know your thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants