Multiview ScrollState

Greetings!

Any Multiview object will loose its scroll state when hidden (i.e. http://docs.webix.com/samples/20_multiview/01_init.html). In the noted example:

  1. Scroll the ‘List’ view a few pages down
  2. Select the ‘Form’ view
  3. Select the ‘List’ view again: note the view returns to scroll position 0

My questions are …

  1. Is there any view configuration that will maintain scroll state?
  2. Assuming the answer to #1 is ‘no’, could you kindly advise events (i.e. onAfterScroll) that should be observed to save/restore state?

Many Thanks!

Bruce

Hi Bruce,

Please use keepViews property for Multiview to avoid this issue.

Hi Maria!

Thank you for the thoughtful response.

I had experimented with keepViews, but experienced issues in my case (dynamically adding views). I did confirm with 3.24 samples that applying keepViews for dynamically added views seems to have issues. Using 13_tabview_dynamic.html and applying:

multiview: {
    keepViews: true
}

The views of the ‘static’ cells behave as expected. Any views added dynamically from the ‘Add Tab’ button will add the tab, but the view remains hidden after the call to $$(vid).show().

I have not experimented with a solution - any ideas?

Many Thanks,

Bruce

Hi Bruce!

I can confirm the issue. We will include the fix into the next update.

I have not experimented with a solution - any ideas?

You can implement a solution to save/restore scroll state (getScrollState, scrollTo and onViewChange event):

http://webix.com/snippet/43050435

Thanks very much Maria,

I really appreciate your help.

Regards,

Bruce