This version is compatible with Rollerworks Datagrid v0.11 and Twig v1.26.
The following functions are renamed:
rollerworks_datagrid_widget
renamed torollerworks_datagrid
rollerworks_datagrid_column_header_widget
renamed torollerworks_datagrid_column_header
rollerworks_datagrid_cell_widget
renamed torollerworks_datagrid_column_cell
rollerworks_datagrid_attributes_widget
renamed torollerworks_datagrid_attributes
The following functions are removed, you need to pull there content
back into the main block (eg. datagrid_container
):
rollerworks_datagrid_header_widget
rollerworks_datagrid_rowset_widget
Themes no longer allow to pass variables to a theme when loading. You can still define variables before loading the theme, which will accessible within in the theme (through context inheritance).
The conventions of block-names changed to be more in-inline with the Symfony Form Component (which served as the main inspiration for the Datagrid's architecture).
A column with type custom
and parent type text
which intern is a child of
type column
will now search for the following block-prefixes (in order):
- The unique-prefix of element eg.
_my_datagrid_id
for a column named 'id' in datagrid '_my_datagrid'. This block can be changed the 'unique_prefix' option. custom
text
column
To define a header theme for type custom
define block custom_header
.
Or _my_datagrid_id_header
for the id
element only.
If the custom_header
block doesn't exist, it falls back to text_header
and column_header
as last.
Note: The sub-cells of a compound column include there name of
holder, eg. _my_datagrid_actions_modify
for a compound column named actions
.
The "datagrid" block is suffixed with container
, eg. datagrid_container
or _my_datagrid_container
.
To reduce memory usage the Twig extension now uses a RuntimeLoader for loading the rendering engine.
You need to register the DatagridRuntimeLoader
with Twig:
$renderEngine = new \Rollerworks\Component\Datagrid\Twig\Renderer\TwigRendererEngine($twig, $themes);
$twig->addRuntimeLoader(new Rollerworks\Component\Datagrid\Twig\DatagridRuntimeLoader($renderEngine));
Alternatively you can use a compatible RuntimeLoader for the Datagrid, like the one provided with the Framework integration libraries.
Note: The performance works best when the runtime-class is loaded lazily, which is not the case with default provided implementation.