How to use addView with tabview

Hi

I’m writing a sample use tabview, and I want to add tabview dynamicly, but when I use addView api of tabview, It can’t add a new tabview, I seems not work fine.

I also learn the sample of tabview, but it use tabbar instead, and also have some bugs when I switch the tab,the releate view doesn’t show.

Could you please tell me how to use addView with tabview.

My code snippet

{
	view:'tabview',
	id:'achui',
	cells:[{
		header:'sina',
		body:{
			view:'iframe',
			id:'iframe-body',
			src:'http://news.sina.com.cn'
		}
	},{
		header:'google',
		body:{
			view:'iframe',
			id:'iframe-body2',
			src:'http://www.163.com'
		}
	},{ header:"Empty", body:{
		view:"tabbar", 
		id:'tabbar', 
		value: 'listView', // the initially selected tab
		multiview:true, 
		options: [
			  { value: 'List', id: 'listView'},
			  { value: 'Form', id: 'formView'},
			  { value: 'Empty', id: 'emptyView'}]
	} }]
}

function getModule(){
	var tab = $$('achui');
	tab.addView('id1',view:'iframe',src:'http://www.jd.com');
}

You can but it requires a bit more of code for now.
tabview is in fact combination of multiview and tabbar element, so you need to add the new view to multiview and new button to tabbar

http://snippet.webix.io/d91afe0f

Thanks for your answer.

Another question: in my code when you click tab ‘empty’,and then click ‘addTab’ button,it will add a new tab,but when you click the new tab,the layout seems have a little problem. My browser is Chrome(Version 31.0.1650.63 m)

I can confirm the issue
We will fix it in the next build, for now you can resolve problem by adding empty view below the tabbar

http://snippet.webix.io/9ce0b552

Thanks,under your help, it works fine.

Hi maksim,

I come across this post, is there anyway to display the content of dynamic tab without using Iframe?. i have other application using ext js having similiar behaviour, the performance is really bad.

your example: http://snippet.webix.io/9ce0b552

Thanks

Sorry, just ignore my post, I tried that the component can show without Iframe.
It’s great !!, Thanks