Skip to content
This repository has been archived by the owner on Nov 30, 2017. It is now read-only.

Commit

Permalink
[Grid] Docs improvements accoring to upcoming changes
Browse files Browse the repository at this point in the history
- ``sortable`` column option fix
- sort column by multiple keys
- general improvements
  • Loading branch information
Zales0123 committed Nov 13, 2015
1 parent 736fc56 commit e589c1d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
28 changes: 28 additions & 0 deletions bundles/SyliusGridBundle/column_configuration.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Column configuration
====================

Each column can be configured with several configuration fields, to make it more suitable to your grid requirements.

+------------+------------+------------------------------------------------------------------------------------------------------------------------+
| Name | Type | Description |
+============+============+========================================================================================================================+
| type | string | Type of column. Default column types are described `here </en/latest/bundles/SyliusGridBundle/column_types.html>`_. |
+------------+------------+------------------------------------------------------------------------------------------------------------------------+
| label | string | Label displayed in column header. By default, it is column name. |
+------------+------------+------------------------------------------------------------------------------------------------------------------------+
| sortable | bool | Whether column should be sortable or not. True by default. |
+------------+------------+------------------------------------------------------------------------------------------------------------------------+
| options | array | Array of column options (see below). |
+------------+------------+------------------------------------------------------------------------------------------------------------------------+

``options`` field can contains following fields:

+------------+--------------+---------------------------------------------------------------------------------------------------------------------------+-------------+
| Name | Type | Description | Default |
+============+==============+===========================================================================================================================+=============+
| template | string | Available (and required) for *twig* column type. Path to template that is used to render column value. | |
+------------+--------------+---------------------------------------------------------------------------------------------------------------------------+-------------+
| path | string | Path to property displayed in column (can be property of resource or one of its referenced object). | column name |
+------------+--------------+---------------------------------------------------------------------------------------------------------------------------+-------------+
| sort | string|array | One or more properties that will be used to column sorting (can be property of resource or one of its referenced object). | column name |
+------------+--------------+---------------------------------------------------------------------------------------------------------------------------+-------------+
5 changes: 4 additions & 1 deletion bundles/SyliusGridBundle/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ Configuration Reference
name:
type: twig # Type of column.
label: Name # Label.
sortable: true
options:
template: :Grid/Column:_name.html.twig # Options specific for column type.
template: :Grid/Column:_name.html.twig # Only twig column
path: name
sort: name
filters:
group:
type: entity
Expand Down
1 change: 1 addition & 0 deletions bundles/SyliusGridBundle/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Some of the features worth mentioning:
installation
your_first_grid
column_types
column_configuration
filters
custom_column_type
custom_filter
Expand Down

0 comments on commit e589c1d

Please sign in to comment.