angular-tree-component icon indicating copy to clipboard operation
angular-tree-component copied to clipboard

tree does not render when nodes fetched within a timeout

Open outerbound opened this issue 9 years ago • 8 comments

When I put nodes creation inside a timeout, tree does not render. Created a plunkr that you can see the problem https://plnkr.co/edit/c0LTf5?p=info

Essentially with timeout I am simulating nodes fetching from http webservice call.

outerbound avatar Mar 06 '17 16:03 outerbound

The same issue - happens after AppPool recycled. Also error is displayed in the console: "[mobx.array] Attempt to read an array index (0) that is out of bounds (0). Please check length first. Out of bound indices will not be tracked by MobX"

After refresh with disabled cache tree appears but error is still diplaying

vshapran avatar Mar 06 '17 16:03 vshapran

Same issue here - works when reverting @outerbound's plunk to v2.8.2 (before virtual scolling) https://plnkr.co/edit/2DbXj9R3km6MmIp44Ajh

JanPrinsloo avatar Mar 07 '17 08:03 JanPrinsloo

Fixed in 3.2.1 - please upgrade

adamkleingit avatar Mar 07 '17 14:03 adamkleingit

Thanks, that fixed it!

JanPrinsloo avatar Mar 07 '17 15:03 JanPrinsloo

Sorry I missed virtual scrolling was disabled by default - not working in v3.2.3, please see https://plnkr.co/edit/nROjem69yZTW8hVcemp8?p=preview

JanPrinsloo avatar Mar 14 '17 07:03 JanPrinsloo

TreeVirtualScroll.getViewportNodes() expects viewportHeight to be truthy before it allows setting nodes. A workaround shown in the plunk below, is to apply a height to <viewport> using component style:

:host >>> tree-viewport { height: 600px; }

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

JanPrinsloo avatar Mar 14 '17 14:03 JanPrinsloo

Hi, I'll look into it this weekend

--

On Tue, Mar 14, 2017 at 4:43 PM, JanPrinsloo [email protected] wrote:

TreeVirtualScroll.getViewportNodes() expects viewportHeight to be truthy before it allows setting nodes. A workaround shown in the plunk below, is to apply a height to using component style:

:host >>> tree-viewport { height: 600px; }

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

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/500tech/angular-tree-component/issues/208#issuecomment-286442761, or mute the thread https://github.com/notifications/unsubscribe-auth/AA2SShsWrVRGNKTjVqDOjmiWrX89Dq_fks5rlqeNgaJpZM4MUV0- .

adamkleingit avatar Mar 15 '17 11:03 adamkleingit

I use v3.7.3 have the same issue. I use @JanPrinsloo's workaround, it's work. @adamkleingit Is the issue fixed?

apeter10 avatar Jun 14 '17 15:06 apeter10