datatable width responsiveness when changing browser size

Hi,

In the datatable width is calculated dynamically and set on the element style of several tags (webix_dtable, webix_hs_center, table, webix_ss_center, webix_ss_center_scroll).
When changing the size of the browser window, these widths are not recalculated and therefore the datatable is not responsive.
If the datatable is first displayed with a little browser window and then I maximize it, width is not spread 100% but rather the datatable is still narrow.
How can I overcome this issue?
Thanks!

I eventually solved the issue by doing the following but I am wondering if there is not a better solution in term of code and performance.

$(window).resize(function() {
    grid.adjust();
});

By the way,grid.resize() instead ofgrid.adjust() works too, so if my solution is OK, what should I better use?

Thanks

Adjust sets size of the control according to the size of HTML container.

Resize starts a bit more complex size negotiation, which may resize a control to a HTML container, or resize HTML container to a control ( if control has a fixed sizes for example )

In common case, just use .resize

Hello,

I saw a different example:

var eventId = webix.event(window, 'resize', function(){
    grid.resize();
  });

Is this better and should I detach the event when destroying the grid?

webix.eventRemove(eventId);

webix.event(window, ‘resize’,

is exactly the same as

$(window).resize

there is no any significant difference.
As for eventRemove, normally you need not use it, as on page unloading all events will be detached automatically.

if you are creating a single page app, where grid may be created and destroyed on the fly, it has sense to remove the global event handler after removing the related grid object.