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

Fix grid caching data issue #230

Conversation

dragulceo
Copy link
Contributor

Fixes #223

The only question I had (which was also the reason I did not make this pull request before) was the reasoning behind the datagrid caching. The reasoning is unknown to me but thinking out loud right now I realize that this caching is useful only when you rerender the grid and the data (the collection) is fetched already. So it is safe to use the gridId instead of the gridName (which conflicts with other grids with the same name).

Thank you.

@alex-kuzmenko
Copy link
Contributor

To have more control over grid name, you can use oro_datagrid_build_fullname twig function. For example:

{% set gridName = oro_datagrid_build_fullname('entity-relation-grid', entity_name ~ '-' ~  field_name) %}

@Grygir
Copy link
Contributor

Grygir commented Aug 21, 2015

This solution breaks grid cache functionality. gridId is generated each time with unique suffix (e.g. 'grid-accounts-grid-1727381985', then 'grid-accounts-grid-464493576'), so we can not read from the cache by this key.

Regarding your issue #223, see how grid name is built:

    gridName: oro_datagrid_build_fullname(datagrid.name, datagrid.scope),

changing datagrid scope you can create similar grids for different entities.

For more details see DataGrid Scope documentation.

@Grygir Grygir closed this Aug 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Multiple datagrids with the same name render the data of the first one
3 participants