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

addChildren throws error when ext-grid is hidden #978

Closed
yangjuncode opened this issue Nov 25, 2019 · 5 comments
Closed

addChildren throws error when ext-grid is hidden #978

yangjuncode opened this issue Nov 25, 2019 · 5 comments
Labels
bug ext-grid (Unsupported experimental plugin)

Comments

@yangjuncode
Copy link

the callstack is below:

jquery.fancytree.grid.js?8b9c:807 Uncaught (in promise) TypeError: Cannot set property 'ftnode' of undefined
at Fancytree.nodeRender (jquery.fancytree.grid.js?8b9c:807)
at Fancytree.eval [as nodeRender] (jquery.fancytree.js?f020:335)
at Fancytree._callHook (jquery.fancytree.js?f020:2785)
at FancytreeNode.render (jquery.fancytree.js?f020:1961)
at FancytreeNode.addChildren (jquery.fancytree.js?f020:667)
at VueComponent.asyncNodeSelectStatus (addressBook.vue?3315:284)

@mar10 mar10 added waiting bug ext-grid (Unsupported experimental plugin) labels Nov 25, 2019
@mar10
Copy link
Owner

mar10 commented Nov 25, 2019

Thank you for contributing! 👍

It looks like you're using Vue.js? Does the problem occur without that framework as well?

In order to process your issue, we need some more information, explanation what already was tried and/or concrete data.

A debuggable example (jsFiddle, Plunkr, CodePen, ...) may be helpful.

Please read the Contribution Guidelines for some hints on how to submit helpful feature requests and bug reports.

@yangjuncode
Copy link
Author

some info is missing, the tree is in a display none div.
the attach is my modified demo.
when tree init ok, click add children button will trigger the error.
sample-ext-grid.html.zip

@mar10 mar10 changed the title when ext-grid enabled, addChildren err addChildren shows error when ext-grid is hidden Nov 26, 2019
@mar10 mar10 changed the title addChildren shows error when ext-grid is hidden addChildren throws error when ext-grid is hidden Nov 26, 2019
@mar10 mar10 removed the waiting label Nov 27, 2019
@mar10 mar10 closed this as completed in 5d93514 Nov 27, 2019
@yangjuncode
Copy link
Author

yangjuncode commented Nov 28, 2019

@mar10
thanks for fixing, but i have a small question about the code.
i have commented on commit 5d93514.

@mar10
Copy link
Owner

mar10 commented Nov 28, 2019

1/0 does evaluate to NaN, which is falsy, so this line

newCount = Math.floor(free / trHeight) || 0;

is a hack for

newCount = trHeight ? Math.floor(free / trHeight) : 0;

which would be more clear, I admit.

mar10 added a commit that referenced this issue Nov 28, 2019
Update #978
@yangjuncode
Copy link
Author

the two version is not equal at least in firefox:

var free=10
undefined
var trHeight=0
undefined
Math.floor(free / trHeight) || 0
Infinity
trHeight ? Math.floor(free / trHeight) : 0;
0

thanks for the un-hack version anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ext-grid (Unsupported experimental plugin)
Projects
None yet
Development

No branches or pull requests

2 participants