Today, when implementing a business, you need to generate multiple tab pages based on background business data, and the header of the table in each tab page needs to be dynamically generated from the data.
The data format returned in the background is as follows:
The implementation method is as follows:
$ ("#compareResWin")//pop-up window//$ (' #compareResTabs ')///Popup tab Success:function (Result) { if (result.length==0) { alert (' incomparable to the result '), }else{ $ ("#compareResWin"). Window (' open '), or the popup window needs to be opened first, otherwise the table content cannot be initialized. //Loop Create tab for (var i=0;i<result.length;i++) { var oneScene = result[i]; var content = ' <div title= "' +onescene.scene_name+ '" style= "padding:10px" > <table id= "DG ' +i+ '" ></table></div> " $ (' #compareResTabs '). Tabs (' Add ',{ title:onescene.scene_name, content:content }); var Header = Onescene.header; var columns = []; for (var j=0;j
Easyui Dynamic Header && Dynamic add tabs