Skip to content

Commit

Permalink
allow customizing reorder column names
Browse files Browse the repository at this point in the history
  • Loading branch information
pxpm committed Sep 24, 2024
1 parent 03431ea commit a973539
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion 6.x/crud-operation-reorder.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@ This operation allows your admins to reorder & nest entries.
<a name="requirements"></a>
## Requirements

Your model should have the following integer fields, with a default value of 0: ```parent_id```, ```lft```, ```rgt```, ```depth```.
Your model should have the following integer fields, with a default value of 0: ```parent_id```, ```lft```, ```rgt```, ```depth```. The names are optional, you can change them in the ```setupReorderOperation()``` method.

```php

protected function setupReorderOperation()
{
CRUD::setOperationSetting('reorderColumnNames', [
'parent_id' => 'custom_parent_id',
'lft' => 'left',
'rgt' => 'right',
'depth' => 'deep',
]);
}
```

Additionally, the `parent_id` field has to be nullable.

Expand Down

0 comments on commit a973539

Please sign in to comment.