agentsclimarketplace

Init grid extensions

Skill jeffsenso/prestashop-skills/skills/prestashop-module-development/ps9-core-ai/Component/Javascript/skills/init-grid-extensions

Prestashop Developer Skills

Install
npx -y skills add jeffsenso/prestashop-skills --skill init-grid-extensions

Assembled 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

Enable JavaScript grid extensions for a listing page. Extensions add sorting, filtering, bulk actions, column toggling, position reordering, and other interactive behaviors to the grid. Trigger: "add grid extensions for {Domain}", "enable grid extensions for {Domain}", "initialize grid JS for {Domain}".

SKILL.md

4.1 KB, as published. Nobody here has run it

init-grid-extensions

Read @.ai/Component/Javascript/CONTEXT.md for the grid component and extension system.

Basic pattern

In the listing entry point (index.ts):

const grid = new window.prestashop.component.Grid('{domain}');

grid.addExtension(new window.prestashop.component.GridExtensions.SortingExtension());
grid.addExtension(new window.prestashop.component.GridExtensions.FiltersResetExtension());
grid.addExtension(new window.prestashop.component.GridExtensions.SubmitRowActionExtension());
grid.addExtension(new window.prestashop.component.GridExtensions.SubmitBulkActionExtension());
grid.addExtension(new window.prestashop.component.GridExtensions.BulkActionCheckboxExtension());
grid.addExtension(new window.prestashop.component.GridExtensions.ColumnTogglingExtension());

The grid ID must match the GRID_ID const from the PHP grid definition factory.

Available extensions

Core extensions (most grids need these)

ExtensionPurpose
SortingExtensionClickable column headers for sorting
FiltersResetExtensionReset button for grid filters
FiltersSubmitButtonEnablerExtensionEnable/disable filter submit button
BulkActionCheckboxExtensionSelect-all and per-row checkboxes
SubmitBulkActionExtensionSubmit bulk action form (enable/disable/delete)
SubmitRowActionExtensionHandle row action link clicks
LinkRowActionExtensionNavigate to row action URLs
ColumnTogglingExtensionShow/hide columns via dropdown

Specialized extensions (add only when needed)

ExtensionPurposeWhen to use
AsyncToggleColumnExtensionAJAX toggle for boolean columnsEntity has toggle status in grid
PositionExtensionDrag-and-drop row reorderingEntity has position column
AjaxBulkActionExtensionAJAX bulk actions (no page reload)Performance-sensitive bulk ops
ExportToSqlManagerExtensionExport grid data to SQL managerGrid needs SQL export
ReloadListExtensionReload grid data without page refreshAJAX-driven grid updates
PreviewExtensionInline row preview expansionEntity has preview/details panel
ModalFormSubmitExtensionSubmit forms in modal dialogsDelete confirmation modals
BulkOpenTabsExtensionOpen multiple items in new tabsBatch review workflows
SubmitGridActionExtensionGrid-level action buttonsGrid has toolbar actions (export, import)

Domain-specific extensions

Some domains have custom extensions in subdirectories:

  • column/catalog/ — catalog-specific column extensions
  • action/row/ — domain-specific row action extensions (e.g. customer delete with order check)

Check admin-dev/themes/new-theme/js/components/grid/extension/ for the full list.

Multiple grids on one page

For pages with multiple grids (e.g. Manufacturer with manufacturers + addresses):

const manufacturerGrid = new window.prestashop.component.Grid('manufacturer');
manufacturerGrid.addExtension(new SortingExtension());
// ...

const addressGrid = new window.prestashop.component.Grid('manufacturer_address');
addressGrid.addExtension(new SortingExtension());
// ...

Each grid instance gets its own set of extensions.

Rules

Conventions (multiple Grid instances pattern) are in Javascript/CONTEXT.md. Skill-specific reminders:

  • Grid ID must match the PHP GRID_ID constant — mismatch means extensions don't bind
  • Only add extensions that match the grid definition — don't add PositionExtension without a PositionColumn
  • AsyncToggleColumnExtension requires a matching AJAX toggle route in the controller

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.