当前位置:网站首页>Dynamically add multiple tabs and initialize each tab page
Dynamically add multiple tabs and initialize each tab page
2022-07-25 09:23:00 【zk_ Kang】
What is demonstrated here is only what I encountered in the project , According to their actual situation , Modify by yourself .
html Only one is written in class by easyui-tabs Of div
<div id="center" data-options="region:'center'">
<!-- This definition div Of id, You need to use -->
<div id="tabs_D" class="easyui-tabs" >
</div>
</div>When the page is loaded, it will be loaded dynamically according to its own situation tab page ;
// Among them addTabw To add tab Methods
function initTableTabs(){
$.post('../../../BaseMessage/PUSH/XSJHService.ashx?m=SelectFDMBByCXHDBH', { "CXHDBH": C_CXHDBH }, function (res) {
var _Data = JSON.parse(res);
var _RowsFD = _Data.INFOFD;
var _RowsRQ = _Data.INFORQ;
if (_RowsFD != null) {
for (var k in _RowsFD) {
addTabw(_RowsFD[k].FDMC, 'DGY_Detail_Mode_dg_' + _RowsFD[k].FDBH);
window["FDRQData_"+ _RowsFD[k].FDBH]=[];
if (_RowsRQ != null) {
for (var i in _RowsRQ) {
if( _RowsRQ[i].FDBH == _RowsFD[k].FDBH){
window["FDRQData_"+ _RowsFD[k].FDBH].push(_RowsRQ[i]);
}
}
}
// Give it here datagrid assignment
$("#DGY_Detail_Mode_dg_" + _RowsFD[k].FDBH).datagrid('loadData', window["FDRQData_" + _RowsFD[k].FDBH]);
}
}
}
});
} // add to tab, initialization tab, to tab Upper table assignment
// Choose one tab, Input title
function selectTabw(title) {
if ($('#tabs_D').tabs('exists', title)) {
$('#tabs_D').tabs('select', title);// If there is a current page , Then jump to the page
}
}
// add to tab,tab Of content For one table, And tab Cannot be closed , If you want to change it to closable ,false Change it to true,
// In fact, these two are one method , First determine whether this page exists , There is no need to join , however , When I call here , Positive incoming title Different , So no judgment
function addTabw(title, table_id) {
var content = '<table id='+table_id+'></table>';
$('#tabs_D').tabs('add', {// non-existent , Then add a
title: title,
content: content,
closable: false
});
tableToInit(table_id);
}
// initialization tableById
function tableToInit(table_id) {
$("#"+table_id).datagrid({
title: '',
loadMsg: ' Loading data ...',
rownumbers: true,
singleSelect: true,
multiSort: false,
remoteSort: true,
columns: [[
{ title: ' Sales plan ID', field: 'CXHDBH', align: 'center', sortable: true, wdith: 120 },
{ title: ' Branch name ', field: 'FDMC', align: 'center', sortable: true, wdith: 200 },
{ title: ' date ', field: 'RQ', align: 'center', sortable: true, wdith: 200 },
{
title: ' The goal is ( Ten thousand yuan )', field: 'XSMB', align: 'center', width: 100, sortable: true,
formatter: function (value, row, index) {
return value == null ? '' : value;
}
},
{ title: ' The registrar ', field: 'DJRMC', align: 'center', width: 100, sortable: true },
{
title: ' Registration time ', field: 'DJSJ', align: 'center', width: 120, sortable: true,
formatter: function (value, row, index) {
return value != null ? value.replace("T", " ") : "";
}
}
]],
pageSize: 1000
});
}
边栏推荐
- The annualization of financial products is 4%. How much profit can you get from buying 10000 yuan a month?
- Mongodb installation and use
- Probe into Druid query timeout configuration → who is the querytimeout of datasource and jdbctemplate effective?
- [selected] from simple to deep, you will understand MQ principles and application scenarios
- Nacos启动报错Unable to start web server
- 一文搞懂try、catch、finally(包含return)执行流程(全网最详细解析)
- Nacos搭建配置中心出现client error: invalid param. endpoint is blank
- Leetcode组合总和+剪枝
- How to use pixi.js to make simple Parkour games
- [deep learning] overview | the latest progress of deep learning
猜你喜欢

Labview--- signal generator

Feiling ok1028a core board adapts to rtl8192cu WiFi module

NFT guide for musicians
![[stl]stack & queue simulation implementation](/img/92/c040c0e937e2666ee179189c60a3f2.png)
[stl]stack & queue simulation implementation

『每日一问』ReentrantLock加锁解锁

对称式加密与非对称式加密的对比

Silicon Valley classroom lesson 12 - official account on demand course and live broadcast management module

2022-7-14 JMeter pressure test

Ten thousand words long, one word thoroughly! Finally, someone has made business intelligence (BI) clear
![[stl]list Simulation Implementation](/img/92/2a78382700c1ebf299c6505d962c9c.png)
[stl]list Simulation Implementation
随机推荐
C#语言和SQL Server数据库技术
Nacos启动报错Unable to start web server
How to use pixi.js to make simple Parkour games
『每日一问』怎么实现一个正确的双重检查锁定
C#语言和SQL Server数据库技术
sql注入
[learn rust together] a preliminary understanding of rust package management tool cargo
Mongodb installation and use
分享一个避免递归的部门设计方法
C language and SQL Server database technology
activemq--可持久化机制之JDBC
[arm] Xintang nuc977 transplants wk2124 drive
[common tools] obtain system status information based on psutil and gputil
nacos2.1.0集群搭建
registration status: 204
保姆级Scanner类使用详解
C#语言和SQL Server数据库技术
Arrange the array into the smallest number
OpenCV实现简单的人脸追踪
Solve NPM error: cannot find module 'shelljs‘