Easyui dynamic Header & Dynamic addition of tabs, easyui dynamic
When implementing a business today, You need to generate multiple tabs based on background business data, and the table headers in each tab page need to be dynamically generated based on the data.
The data format returned by the background is as follows:
The implementation method is as follows:
// $ ("# CompareResWin") // pop-up window // $ ('# compareResTabs') // success: function (result) {if (result. length = 0) {alert ('incomparable result');} else {$ ("# compareResWin "). window ('open'); // the pop-up window must be opened first, otherwise the table content cannot be initialized. // Create a 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
Zookeeper