Create position column
Prestashop Developer Skills
npx -y skills add jeffsenso/prestashop-skills --skill create-position-columnAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Documents how to add drag-and-drop row reordering to a PrestaShop grid. Requires a PositionColumn in the definition, a dedicated update-position route, and position handling in the repository.
SKILL.md
1.4 KB, as published. Nobody here has run it
create-position-column
Instructions
- Add
PositionColumnas the second column (after BulkActionColumn) in the Grid Definition. - Configure the position update route:
->setOption('update_method', 'POST')->setOption('update_route', 'admin_{domain}s_update_position'). - Create the
admin_{domain}s_update_positionPOST route in the routing YAML (seecreate-admin-routingskill). - In the controller, handle the AJAX position update: receive
positions[]array, dispatchUpdatePosition{Domain}Command(or use QueryBuilder directly). - In the repository, update the
positioncolumn for the moved entities.
Rules
Column ordering conventions (PositionColumn as second column) are in Grid/CONTEXT.md. Skill-specific reminders:
- Position updates are always AJAX — return JSON response, not redirect
- Position values start at 0 or 1 — be consistent with existing PS convention