Clarity: [DataGrid] Errors occur when using clr-dg-action-overflow and a filter that results in 0 items to display

Created on 27 Jul 2017  路  12Comments  路  Source: vmware/clarity

[X] bug
[ ] feature request
[ ] enhancement

Expected behavior

I should be able to use the clr-dg-action-overflow element and filter my datagrid to something that may not have any matches without it breaking the page.

Actual behavior

Right now if I use a clr-dg-action-overflow element and filter a column with a term that results in 0 matches, the whole page blows up. In my app I am getting a Maximum call stack size exceeded error. In plunker it's a ViewDestroyedError: Attempt to use a destroyed view: detectChanges error. I'm not sure why I'm not seeing the same error in both, but either one fully breaks the page and I have a strong suspicion they are related.

Reproduction of behavior

https://plnkr.co/edit/dnFEBpcGTMFNpEGRxtgQ?p=preview

Environment details

  • Angular version: 4.0.X

  • Clarity version: 0.9.14

bug

Most helpful comment

@mathisscott @youdz

I have also reproduced this with no filter (just push Delete):
https://plnkr.co/QxqCu2jhqevqO5WG7sxj?p=preview

(here's a non-async list of items that results in the same thing: https://plnkr.co/yTJ8UnrpFdioU1iWJXLV?p=preview)

In my app I get the same error as the one in plunker (ViewDestroyedError: Attempt to use a destroyed view: detectChanges).

All 12 comments

@youdz
Can you verify if this is a bug or not, especially post EHCAIWC clean up?

I confirm it's a bug on our side, it might be related to #1183 but we need proper investigation to confirm. Thanks for filing this. 馃槃

@mathisscott @youdz

I have also reproduced this with no filter (just push Delete):
https://plnkr.co/QxqCu2jhqevqO5WG7sxj?p=preview

(here's a non-async list of items that results in the same thing: https://plnkr.co/yTJ8UnrpFdioU1iWJXLV?p=preview)

In my app I get the same error as the one in plunker (ViewDestroyedError: Attempt to use a destroyed view: detectChanges).

This bug can be reproduced on Clarity's document example page for expandable-rows as well, try filter on Creation date column, the error will occur in console if searching hits empty result.

Is there any workaround for this we can try in the mean time?

@youdz
Is this an EHCAIWC issue? Or is this a new issue with the datagrid?

This issue came from the 0.9.14 release. One of the chocolate commits caused this. We had to revert back to 0.9.13 otherwise none of out DataGrids worked.

We encountered 2 scenarios that caused this error to be thrown:
1.) Reducing our dataset which led to less rows in the DataGrid. We use action overflows and checkboxes in our DataGrids and the DataGrid component was trying to access checkboxes and menu items for the rows that were removed.
2.) Server side pagination. We have a tablePageSize of 10 and an apiPageSize of 35. We load 35 rows into the DataGrid and page through them 10 at a time. When reaching the fourth page 5 rows will be visible and we make a call to get the next 35, when those are retrieved we add the next 35 rows to the DataGrid and this was causing the DataGrid to error out with the 0.9.14 release.

Hope this helps.

I tried with all 0.9.x releases and this bug is present in all of them. I am forced to use 0.8.x for the moment.

If possible, let's try to get this fix backported to 0.8 then after the fix is available.

@gnomeontherun

@mathisscott you mean backported to 0.9.x?

I don't know if we would be able to backport this fix -- even to 0.9.x.

Please check with @youdz on that once you have a PR ready for 0.10

Hi there 馃憢, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

girijaa picture girijaa  路  29Comments

reddolan picture reddolan  路  31Comments

Harsh072 picture Harsh072  路  23Comments

gnomeontherun picture gnomeontherun  路  27Comments

lil-kim picture lil-kim  路  23Comments