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

Closed
wants to merge 1 commit into
base: master
from

Conversation

3 participants
@dragulceo
Contributor

dragulceo commented Feb 19, 2015

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

This comment has been minimized.

Show comment
Hide comment
@alex-kuzmenko

alex-kuzmenko May 18, 2015

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) %}
Contributor

alex-kuzmenko commented May 18, 2015

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

This comment has been minimized.

Show comment
Hide comment
@Grygir

Grygir Aug 21, 2015

Contributor

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.

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