sizing complex layouts

Hi, I have a fairly complex layout - a ‘mulitview’ with a datatable as each child of the multiview. The app only uses the body as it’s container.

There is a problem with sizing.

The problem occurs if one of the multiview children is more complicated, and has it’s own layout with 2 sub-datatables.

In that case, the entire multiview resizes to the height of the smallest sub component of the multiview’s children.

I have been able to attach an ‘adjust()’ method, triggered on window resizing, which will resize the entire multiview correctly, but only if the window is manually resized:

   webix.event(window, "resize", function(){$$('main_body').adjust()})

My attempts to trigger the resize automatically, e.g. after some delay, have not been successful.

        setTimeout(function() {
             $(window).trigger('resize');
        }, 1000)

Questions:

  1. is there some way to force a multiview to occupy 100% height no matter what the size of any of the children are?

  2. what is the best way to trigger an automatic resize or adjust(), and what should the timing of that be?

Thanks
Dave

One thing I’m noticing is that the layout will work if I follow this rule:

For any parent of the multiview, and the multiview itself: If you specify width, then you also have to explicitly set height:‘100%’,

Does that make sense?

If content of multiview has fixed width of height - multiview will take this size.

You can try to use fitBiggest:true in settings of multiview
http://docs.webix.com/api__ui.multiview_fitbiggest_config.html

As result multiview will size not to current visible view, but to biggest view.

Also, if you have a layout with fixed elements, you can always add a spacer {} as last element of layout - it will take all free space and will allow to use 100% height for parent multiview.

One more solution is wrapping a layout in scrollview, as size of content of scrollview doesn’t affect its parent.

Thanks, I discovered the fitBiggest:true solution, but good to know about the other 2

Thanks again.
David