Skip to content

add new property startOrder and fix readme #30

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

den11100
Copy link

@den11100 den11100 commented Nov 9, 2022

Сейчас если перетаскивать строки в gridview сортировка начинается с 0.
Предлагаю добавить свойство startOrder чтобы менять это поведение.

Add new property 'startOrder' if need change number of first element for order column.

@chuprik
Copy link
Owner

chuprik commented Nov 9, 2022

привет ) а юзкейс какой?

@den11100
Copy link
Author

den11100 commented Nov 9, 2022

Например мне нужно чтобы моё поле, где я храню номер сортировки начиналось с 1
Сейчас это сделать не получится.

После моей доработки можно будет вот так делать.

public function actions()
    {
        return [
            'sorting' => [
                'class' => \kotchuprik\sortable\actions\Sorting::className(),
                'query' => \vendor\namespace\Model::find(),
                'orderAttribute' => 'sort',
                'startOrder' => 1,
            ],
        ];
    }

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.

2 participants