Crash when calling scrollTo on Table

Hi,

I’ve recreated an issue at https://snippet.webix.com/uxn6u263 where calling scrollTo on a table and then destroying it right after causes webix to crash in
line 263 of datastore.js:

//returns total count of elements
count:function(){
return this.order.length;
},

because this.order is null.

To reproduce it, simply click the “Resize datatables” button.

Thanks,
Manu

looks like the problem is solved in v5.2Pro and v5.3GPL
did not manage to reproduce the issue in these and upper versions

Did you see in the snippet that it is failing in the v6.3 PRO version and GPL?

When you click the Resize datatables button, you will see appearing a Javascript error in the top right corner of the page.

you are right.
when I tried in Chrome, the problem reproduced.
in FF only prior to v5.2 are buggy.
not sure why.

Thanks. I’ll make sure to mention the browser I’m using next time. Any idea for a workaround while waiting for a fix?

It has been 4 months since I reported this issue. Any hope to get this fixed? I’ve put the necessary code to reproduce the issue. It crashes with the latest version of Chrome I’m using.

Hello @fds32s18jdf,

It crashes with the latest version of Chrome I’m using.

It seems to me that although the behaviour is different on different browsers, your snippet will behave incorrectly in most cases. For instance, even though FF doesn’t throw an error, you can see that a new scroll isn’t being rendered. To avoid the issue you are having, you could destroy the datatable after a certain delay: https://snippet.webix.com/52z0lpee.

Having a delay is not a good option since I do not know how long it takes for webix to do his thing, so maybe most of the time that would be sufficient but maybe not.

Also, my code is way more complex than the snippet I provided and the ordering between the scrollTo call and the destructor call is not always the same. I’m using react/mobX and both control most of this stuff automatically.

No matter what, I believe that webix should better handle this from the get go. It looks like it is crashing because there is some shared state between the old and new table.

@fds32s18jdf
check this workaround
https://snippet.webix.com/3x9nn6ms