Hi,
Toolbar placed in layout does not adjust its size.
see snippet: http://webix.com/snippet/1880e14e
when snippet is first time loaded toolbar does not adjust its size
Separately: there is bug in snippet, comment any call to resize, toolbar’s size will be adjusted to fit
The thing is that you call a webix.ui() constructor inside another one. Main view is initialized in the html code, while toolbar features its own constructor in the directive.
Normally, webix.ui is called once for the whole application (excluding windows and popups). In this case elements are adjusted and resized properly and automatically.
In your case you should provide resizing functions for every possible resizing action in the application
//page parsed
webix.attachEvent("onready", function () {
toolbar.resize();
});
//layour resized with resizer
webix.attachEvent("onLayoutResize", function(){
toolbar.resize();
});
http://webix.com/snippet/d604e52d
May be you’ll also need the onViewResize event in future.
But I think it’s better to place app configuration in one webix.ui.
Helga,
Please elaborate on “it’s better to place app configuration in one webix.ui”.
My app loads views dynamically, the app actually does not know what views are going to be loaded, it downloads information from the server, so views will be created in runtime thus I’ll have to use webix.ui for individual views…
There’re several ways to load views dynamically:
- Adding and deleting views dynamically - http://docs.webix.com/desktop__dynamic_layout.html
- Replacing views and configurations with webix.ui - http://docs.webix.com/helpers__top_ten_helpers.html#webixui. Starting from the part “In addition, the method can be used to…”