Closed kamax1 closed 8 years ago
Hey
opts.item_height equals 0 during initialization (but nodes exists)
how this could be possible if nodes exists? could you please create example at codepen?
Here is an example. http://codepen.io/anon/pen/ORNagp I've figured out that it's caused by async loading of data and changing between different states.
Whoa, great catch @kamax1 !
Just pushed v0.17.1
Try this http://codepen.io/NeXTs/pen/GjkVoO?editors=1010
Pay attention how I changed html and loaded
. If your version was important to you - use it, but there would be additional height determination (because until loaded
is false - vue doesn't render table so Clusterize could not determine row's height. And will actually investigate row by triggering scroll (when obviously investigation of row height during .update is preferred))
Thank you for the fast response. Works perfectly!
When scrolling the table for the first time the cluster rerenders and content has bad flashing effect.
I investigated the problem. In my case problem in method getRowsHeight at line
opts.item_height = nodes[Math.floor(nodes.length / 2)].offsetHeight;
opts.item_height equals 0 during initialization (but nodes exists) so method getClusterNum return Infinity because of division by zeroi've added hot fix
now it works fine for me. Would be cool if you can fix it right way.
I'm using clusterize as directive in Vuejs framework.