How to use tree.resize() function

I want to hide a sidebar tree menu and have tried tree.resize() function smth like this:
http://webix.com/snippet/e97d679f

Everything’s OK in this simple example.

But when I’m trying to do that in more complicated case, for instance like webix-admin-app demo - function resize() seems not to work.
I’ve added a new button ‘navicon’ there and been trying something like:

$$(‘app:menu’).config.width = 1;
$$(‘app:menu’).resize();
webix.message($$(‘app:menu’).config.width);
`
The property ‘width’ been changed (I’ve seen that in the webix.message), but the tree didn’t change your size at all…
Could you please show an example how to change sidebar width in real app like webix-admin-demo?

I’ve found and tried another function:

$$(‘app:menu’).$setSize(1);
`
It works!
But it changes only sidebar width and if I use resize() or adjust() after then nothing occurs…
Any suggestions?

Hi,

The first approach is valid one, and must work always

$$('app:menu').config.width = 1;
$$('app:menu').resize();

Just be sure that you have not set fixed width for some parent view ( for example tree is in the tabview which have a fixed width )

If issue still occurs, please share a demo link

As for $setSize, it will set size for sure, but it is not purposed for direct usage ( it can be used for redefining sizing logic of custom components )

Thank you for your help, Maksim!

<code class="js">$$<span class="br0">&#40;</span><span class="st0">'app:menu'</span><span class="br0">&#41;</span>.<span class="me1">resize</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>`

It’s amazing, but now it works fine:) I suspect there was Firefox cache: despite the fact that I have several times cleared the cache - probably it had still remembered some old version of some *.js file with my experiments…

By the way is there any possibility to force a browser not caching *.js files at all?

I’ve found this meta-tag prevents a browser from caching:

<meta http-equiv="cache-control" content="no-cache">