Skip to content

Commit

Permalink
Complete Grid reference documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mickaelandrieu committed Jan 18, 2019
1 parent 62fc9ac commit 3a70e7f
Show file tree
Hide file tree
Showing 3 changed files with 256 additions and 12 deletions.
Expand Up @@ -4,4 +4,126 @@ menuTitle: Actions reference
weight: 11
---

> You're aware of the existing ones? Please feel free to contribute to the docs!
## Grid Actions reference

Grid Actions are tasks available for your grid for common actions.

### SimpleGridAction

This action allow to add a label to the Grid Actions block. Then you can manage the behavior when
clicking on this label using Javascript for exemple.

{{% notice note %}}
"Refresh list", "Show SQL query" and "Export to SQL Manager" actions are created using `SimpleGridAction` actions.
{{% /notice %}}

| Properties | Expected value |
|--------------------| ---------------|
| **Id** | A string |
| **Type** | `simple` |
| **Name** | A string |
| **Icon** | A string |

### LinkGridAction

This action will create a labelized link into the Grid actions block.

| Properties | Expected value(s) |
|--------------------| -----------------------|
| **Id** | A string |
| **Type** | `link` |
| **Name** | A string |
| **Icon** | A string |
| **Options** | `route` |
| | `route_params` |
| **Requirements** | `route` |
| **Defaults** | `route_params` => [] |
| **Allowed Types** | `route` (string) |
| | `route_params` (array) |

### SubmitGridAction

This action will create a submittable label into the Grid actions block.

| Properties | Expected value(s) |
|--------------------| -------------------------------------|
| **Id** | A string |
| **Type** | `submit` |
| **Name** | A string |
| **Icon** | A string |
| **Options** | `submit_route` |
| | `submit_method` |
| | `confirm_message` |
| **Requirements** | `submit_route` |
| **Defaults** | `submit_method` => 'POST' |
| | `confirm_message` => null |
| **Allowed Types** | `submit_route` (string) |
| | `confirm_message` (string or null) |
| **Allowed Values** | `submit_method` => ('POST' or 'GET') |

## Row Actions reference

Grid Row Actions are tasks available in a Grid row **when defining a column** that supports tasks.

### LinkRowAction

Very similar to the *LinkGridAction*, but capable to manage User accesses on the content.

| Properties | Expected value(s) |
|--------------------| --------------------------------|
| **Id** | A string |
| **Type** | `link` |
| **Name** | A string |
| **Icon** | A string |
| **Options** | `route` |
| | `route_param_name` |
| | `route_param_field` |
| | `confirm_message` |
| | `accessibility_checker` |
| **Requirements** | `route` |
| | `route_param_name` |
| | `route_param_field` |
| **Defaults** | `confirm_message` => '' |
| | `accessibility_checker` => null |
| **Allowed Types** | `route` (string) |
| | `route_param_name` (string) |
| | `route_param_field` (string) |
| | `confirm_message` (string) |
| | `accessibility_checker` (callable or null or instance of AccessibilityCheckerInterface) |

### SubmitRowAction

Very similar to the *SubmitGridAction*, but capable to manage User accesses on the content.

| Properties | Expected value(s) |
|--------------------| --------------------------------|
| **Id** | A string |
| **Type** | `submit` |
| **Name** | A string |
| **Icon** | A string |
| **Options** | `route` |
| | `route_param_name` |
| | `route_param_field` |
| | `confirm_message` |
| | `accessibility_checker` |
| | `method` |
| **Requirements** | `route` |
| | `route_param_name` |
| | `route_param_field` |
| **Defaults** | `confirm_message` => '' |
| | `accessibility_checker` => null |
| | `method` => 'POST' |
| **Allowed Types** | `route` (string) |
| | `route_param_name` (string) |
| | `route_param_field` (string) |
| | `method` (string) |
| | `confirm_message` (string) |
| | `accessibility_checker` (callable or null or instance of AccessibilityCheckerInterface) |

### DeleteCustomerRowAction

This row action will delete the Customer in Sell > Customers page.



### DeleteCategoryRowAction
Expand Up @@ -12,15 +12,15 @@ You can define actions for every selected rows of your grid. PrestaShop already

This action will submit the data of your rows into a specific route.

| Properties | Expected value(s) |
|--------------------| ----------------------------------|
| **Type** | `submit` |
| **Requirements** | `submit_route` |
| **Defaults** | `confirm_message` => null |
| | `submit_method` => "POST" |
| **Allowed Types** | `submit_route` (string) |
| | `confirm_message` (string|null) |
| **Allowed Values** | `submit_method` ("POST" or "GET") |
| Properties | Expected value(s) |
|--------------------| -----------------------------------|
| **Type** | `submit` |
| **Requirements** | `submit_route` |
| **Defaults** | `confirm_message` => null |
| | `submit_method` => "POST" |
| **Allowed Types** | `submit_route` (string) |
| | `confirm_message` (string or null) |
| **Allowed Values** | `submit_method` ("POST" or "GET") |

### DeleteCategoriesBulkAction

Expand All @@ -34,7 +34,7 @@ This action will delete the selected Categories in Catalog > Categories page.

### DeleteCustomersBulkAction

This action will delete the selected Customers in Sell > Customers page.
This bulk action will delete the selected Customers in Sell > Customers page.

| Properties | Expected value(s) |
|--------------------| ---------------------------------------|
Expand Down
Expand Up @@ -4,4 +4,126 @@ menuTitle: Actions reference
weight: 11
---

> You're aware of the existing ones? Please feel free to contribute to the docs!
## Grid Actions reference

Grid Actions are tasks available for your grid for common actions.

### SimpleGridAction

This action allow to add a label to the Grid Actions block. Then you can manage the behavior when
clicking on this label using Javascript for exemple.

{{% notice note %}}
"Refresh list", "Show SQL query" and "Export to SQL Manager" actions are created using `SimpleGridAction` actions.
{{% /notice %}}

| Properties | Expected value |
|--------------------| ---------------|
| **Id** | A string |
| **Type** | `simple` |
| **Name** | A string |
| **Icon** | A string |

### LinkGridAction

This action will create a labelized link into the Grid actions block.

| Properties | Expected value(s) |
|--------------------| -----------------------|
| **Id** | A string |
| **Type** | `link` |
| **Name** | A string |
| **Icon** | A string |
| **Options** | `route` |
| | `route_params` |
| **Requirements** | `route` |
| **Defaults** | `route_params` => [] |
| **Allowed Types** | `route` (string) |
| | `route_params` (array) |

### SubmitGridAction

This action will create a submittable label into the Grid actions block.

| Properties | Expected value(s) |
|--------------------| -------------------------------------|
| **Id** | A string |
| **Type** | `submit` |
| **Name** | A string |
| **Icon** | A string |
| **Options** | `submit_route` |
| | `submit_method` |
| | `confirm_message` |
| **Requirements** | `submit_route` |
| **Defaults** | `submit_method` => 'POST' |
| | `confirm_message` => null |
| **Allowed Types** | `submit_route` (string) |
| | `confirm_message` (string or null) |
| **Allowed Values** | `submit_method` => ('POST' or 'GET') |

## Row Actions reference

Grid Row Actions are tasks available in a Grid row **when defining a column** that supports tasks.

### LinkRowAction

Very similar to the *LinkGridAction*, but capable to manage User accesses on the content.

| Properties | Expected value(s) |
|--------------------| --------------------------------|
| **Id** | A string |
| **Type** | `link` |
| **Name** | A string |
| **Icon** | A string |
| **Options** | `route` |
| | `route_param_name` |
| | `route_param_field` |
| | `confirm_message` |
| | `accessibility_checker` |
| **Requirements** | `route` |
| | `route_param_name` |
| | `route_param_field` |
| **Defaults** | `confirm_message` => '' |
| | `accessibility_checker` => null |
| **Allowed Types** | `route` (string) |
| | `route_param_name` (string) |
| | `route_param_field` (string) |
| | `confirm_message` (string) |
| | `accessibility_checker` (callable or null or instance of AccessibilityCheckerInterface) |

### SubmitRowAction

Very similar to the *SubmitGridAction*, but capable to manage User accesses on the content.

| Properties | Expected value(s) |
|--------------------| --------------------------------|
| **Id** | A string |
| **Type** | `submit` |
| **Name** | A string |
| **Icon** | A string |
| **Options** | `route` |
| | `route_param_name` |
| | `route_param_field` |
| | `confirm_message` |
| | `accessibility_checker` |
| | `method` |
| **Requirements** | `route` |
| | `route_param_name` |
| | `route_param_field` |
| **Defaults** | `confirm_message` => '' |
| | `accessibility_checker` => null |
| | `method` => 'POST' |
| **Allowed Types** | `route` (string) |
| | `route_param_name` (string) |
| | `route_param_field` (string) |
| | `method` (string) |
| | `confirm_message` (string) |
| | `accessibility_checker` (callable or null or instance of AccessibilityCheckerInterface) |

### DeleteCustomerRowAction

This row action will delete the Customer in Sell > Customers page.



### DeleteCategoryRowAction

0 comments on commit 3a70e7f

Please sign in to comment.