Create Gui table filter types

Edit on GitHub

This document describes how to create a new Gui table filter type.


To install the Marketplace Merchant Portal Core feature providing the GuiTable module, follow the Marketplace Merchant Portal Core feature integration guide.

Adjust GuiTableConfigurationBuilder

Add a new addFilter***() method to Spryker\Shared\GuiTable\Configuration\Builder\GuiTableConfigurationBuilder, where you pass all the required data for a new filter configuration. Define a structure as it will be used by the frontend component (the data will be transformed to arrays and then passed to a frontend as JSON).

     * @param string $id
     * @param string $title
     * @return $this
    public function addFilterExample(
        string $id,
        string $title
    ) {
        $typeOptionTransfers = (new SelectGuiTableFilterTypeOptionsTransfer());

                (new OptionSelectGuiTableFilterTypeOptionsTransfer())
                 (new OptionSelectGuiTableFilterTypeOptionsTransfer())

        $this->filters[] = (new GuiTableFilterTransfer())

        return $this;

See the Table Filter extension to learn more about the Table Filters feature.