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

TreeView does not update rows after AJAX (filter, etc.) #1033

Open
nothrem opened this issue Jun 7, 2022 · 0 comments
Open

TreeView does not update rows after AJAX (filter, etc.) #1033

nothrem opened this issue Jun 7, 2022 · 0 comments

Comments

@nothrem
Copy link

nothrem commented Jun 7, 2022

When DataGrid is switched into TreeView it renders items by separate template (/src/templates/datagrid_tree.latte). This template overwrites the base template /src/templates/datagrid.latte.

But the treeview template does not define all snippets from the datagrid template - specifically it's missing snippet tbody (probably because the TreeView does not actuallly use table).

As a result, when grid requests the whole body to be refreshed (e.g. after changing filters), the grid receives the snippet tbody but does not know where to update it in the DOM. Thus the new list of rows send by AJAX is ignored and old rows remains displayed.

I have found possible solution by replacing the base snippet table by the more specific tbody in the datagrid_tree.latte, but I don't know if the table snippet is used for something and if it would break something else.

current datagrid_tree.latte

<div class="datagrid-tree-item-children datagrid-tree" n:snippet="table" ...

suggested fix for datagrid_tree.latte

<div class="datagrid-tree-item-children datagrid-tree" n:snippet="tbody" ...

Workaround:

$grid->setTemplate('/path/to/your/fixed_copy_of_datagrid_tree.latte');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant