Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for row actions, and clickable_row option #400

Merged
merged 2 commits into from Nov 12, 2019

Conversation

@jolelievre
Copy link
Contributor

jolelievre commented Nov 7, 2019

Add documentation for row actions, and clickable_row option

@@ -171,17 +171,13 @@ final class MySpecificAction extends AbstractBulkAction
Then you need to create template so it can render nicely in your grid.

```twig
{# mymodule/views/PrestaShop/Admin/Common/Grid/Actions/my_specific.html.twig #}
{# mymodule/views/PrestaShop/Admin/Common/Grid/Actions/Grid/my_specific.html.twig #}

This comment has been minimized.

Copy link
@PierreRambaud

PierreRambaud Nov 8, 2019

Contributor

Grid twice 🤔

This comment has been minimized.

Copy link
@jolelievre

jolelievre Nov 8, 2019

Author Contributor

Yes that's how the templates are stored in the code, there are three different folders the doc was just not up to date

data-form-url="{{ path(action.options.submit_route) }}"
data-form-method="GET"
>
<a id="{{ '%s_grid_bulk_action_%s'|format(grid.id, action.id) }}" href="{{ path(action.options.route, action.options.route_params) }}" class="dropdown-item">

This comment has been minimized.

Copy link
@PierreRambaud

PierreRambaud Nov 8, 2019

Contributor

Still bulk?

}
```

As you see, Grid stores Row actions using a `RowActionCollection` object. This means that every action needed for Grid must be added to `RowActionCollection` using `add()` method.

This comment has been minimized.

Copy link
@PierreRambaud

PierreRambaud Nov 8, 2019

Contributor
Suggested change
As you see, Grid stores Row actions using a `RowActionCollection` object. This means that every action needed for Grid must be added to `RowActionCollection` using `add()` method.
As shown above, Grid stores Row actions using a `RowActionCollection` object. This means that every actions needed for Grid must be added to `RowActionCollection` using `add()` method.

This comment has been minimized.

Copy link
@eternoendless

eternoendless Nov 8, 2019

Member

"every action" is correct.

This comment has been minimized.

Copy link
@jolelievre

jolelievre Nov 8, 2019

Author Contributor

But ok for shown above


## What is a Row action?

A Row action is an action (e.g. Edit, View & Delete) that is applicable to a specific row in the Grid.

This comment has been minimized.

Copy link
@eternoendless

eternoendless Nov 8, 2019

Member

You mean when clicking on a specific row?

This comment has been minimized.

Copy link
@jolelievre

jolelievre Nov 8, 2019

Author Contributor

No it's the list of actions available in the last column, the click action is only the one with the clickable_row option (and only on LinkAction for now)


# How to use Row actions

In addition to displaying data tables, Grid component also comes with a lot of additional features. One is the Row actions.

This comment has been minimized.

Copy link
@eternoendless

eternoendless Nov 8, 2019

Member
Suggested change
In addition to displaying data tables, Grid component also comes with a lot of additional features. One is the Row actions.
In addition to displaying data tables, Grid component also comes with a lot of additional features. One is Row actions.
@jolelievre jolelievre merged commit 954d1a1 into PrestaShop:master Nov 12, 2019
1 check passed
1 check passed
Travis CI - Pull Request Build Passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.