Tabview tab lost content when change tab

Hi,

In a tabview, every time I change the tab the content of the tabs that are not displayed disappears and I need to have access to the content of the hidden tabs since they are constantly loaded with data via ajax.

for example, if I have two tabs and in each of them I have a “ul” element and I load data from ajax like “li” to the “ul” element using jquery append, the ul element of the tab that is not visible is undefined

Please see snipet https://snippet.webix.com/wusw6v7g

Is there any way that the content of tabs is not lost?

Thanks in advance

Hey @JAP,

To answer your question, it is impossible to keep the DOM elements located in the other tab, since they only get rendered when you switch to the appropriate tab, also, when you switch between the tabs they get completely rerendered depending on the currently selected tab (meaning the DOM element gets added/deleted dynamically).

However, while you can’t do that specifically, there are a few possible options that would achieve a similar result:

1\. You can either explicitly redefine the existing template via the setHTML method: https://snippet.webix.com/1iq90lmt.

2\. Alternatively you can create a custom template function, which would take your data as an input and output the HTML node using that data: https://snippet.webix.com/uwknl683.

@Dzmitry, Perfect Thanks so much!!!