当前位置:网站首页>Click the TD cell of table to open the dialog pop-up window. After obtaining the value, put the value back into the TD cell
Click the TD cell of table to open the dialog pop-up window. After obtaining the value, put the value back into the TD cell
2022-06-30 13:32:00 【Full stack programmer webmaster】
use dialog Make a pop-up window , After working for a day and a night, I finally tried it out in Baidu .
$("#table1 td").on('click',function () {
<!-- Get the clicked cell td Of id-->
var eachTdId=$(this).attr("id");
<!-- This is a difficult point , The next step can be based on the id With existing columns id Compare , for table Which columns in execute pop-up events ,-->
if(eachTdId=="tdoriCodeBk" || eachTdId=="tdoriCodeBk2" || eachTdId=="tdoriCodeBk3"){
<!-- Get the number of columns of the clicked cell -->
var tdSeq = $(this).parent().find("td").index($(this));
<!-- Get the number of rows of the clicked cell -->
var trSeq = $(this).parent().parent().find("tr").index($(this).parent());
<!--dialog plug-in unit -->
var d = dialog({
title: ' Add alternate metadata ',
<!-- The pop-up window that pops up is linked to the controller -->
url: '${base}/cis/cisDataItemDef/itemDefList',
<!-- Close the... Executed after the pop-up function function -->
onclose:function(){
<!-- difficulty , Put the value passed from the sub interface back to the clicked cell input In the box , stay tr:eq("+trSeq+") The comparison is , Must use + No var Type as number comparison -->
$("#table1 tr:eq("+trSeq+") td:eq("+tdSeq+") input").val($("#hide").val()); }}); d.height(450) d.width(750) d.showModal();
}
});
Controller code
@RequestMapping("/itemDefList")
public String itemDefList(){
return "/cis/cisDataItemDef/cisDataItemDefList.ftl";
}
The controller goes to ftl page , A pop-up window appears jquery Code
<script>
$("#save").on("click",function(){
<!-- Get the contents of the clicked line -->
var rows = $('#table').bootstrapTable('getSelections');
var code = [];
for(var i=0;i<rows.length;i++){
code.push(rows[i]['oriCode']);
}
if(code.length==0){
alert(" Please select the element to add ");
return false;
}
window.returnvalue=rows;
$("aa").value=rows;
var d = ar_.getDialog(parent);/* parent.dialog.get(window); */
<!-- Put the processed value in a hidden field of the parent page -->
$(window.parent.$("#hide").val(code));
<!-- Close the pop-up window -->
d.close();
}
});
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/106388.html Link to the original text :https://javaforall.cn
边栏推荐
- Basic syntax of unity script (5) - vector
- 资源变现小程序开通微信官方小商店教程
- 60 divine vs Code plug-ins!!
- How can I protect my private key?
- Loss function: Diou loss handwriting implementation
- 我如何才能保护我的私钥?
- 香港回归20余年,图扑数字孪生港珠澳大桥,超震撼
- 微信小程序报错:TypeError: Cannot read property ‘setData‘ of undefined
- Observable, seulement fiable: première bombe de salon de la série cloudops d'exploitation et d'entretien automatisés dans le nuage
- Basic syntax of unity script (3) - accessing game object components
猜你喜欢
rxjs Observable 两大类操作符简介
可觀測,才可靠:雲上自動化運維CloudOps系列沙龍 第一彈
华为帐号多端协同,打造美好互联生活
SQL programming problem, test case failed
Unity animator parameter
IDEA 2021.3 执行 golang 报错:RNING: undefined behavior version of Delve is too old for Go version 1.18
visualstudio 和sql
[KALI] KALI系统、软件更新(附带镜像源)
Rk356x u-boot Institute (command section) 3.3 env related command usage
Data Lake (11): Iceberg table data organization and query
随机推荐
golang文件的写入、追加、读取、复制操作:bufio包的使用示例
腾讯二面:@Bean 与 @Component 用在同一个类上,会怎么样?
[Title brushing] heater
[deep anatomy of C language] storage principle of float variable in memory & comparison between pointer variable and "zero value"
60 个神级 VS Code 插件!!
DNS 解析之家庭网络接入 Public DNS 实战
Apache Doris Compaction优化百科全书
数字化转型道阻且长,如何迈好关键的第一步
On the simplification and acceleration of join operation
STM32 porting the fish component of RT thread Standard Edition
postman 自動生成 curl 代碼片段
Development of unity script program
Unity Animator 参数
数据湖(十一):Iceberg表数据组织与查询
Simple understanding of the difference between get request and post submission
How to handle ZABBIX server startup failure
华为帐号多端协同,打造美好互联生活
Derivation of Park transformation formula for motor control
Understanding and mastery of ffmpeg avbufferpool
正则系列之断言Assertions