[英]Mark row as selected after closing modal dialog
I have a table, with many rows. 我有一张桌子,有很多行。 From each row it is possible to open modal dialog with code (click on the first cell of the row), what I do with this code: 在每一行中,都可以使用代码打开模式对话框(单击该行的第一个单元格),然后执行以下代码:
var SetInventoryForAllCalendarsAndGroups = function () {
var OpenModalGroup = function (element) {
$("#myModalJEINVE_Group").modal();
}
return {
OpenModalGroup: OpenModalGroup
}
}();
What I don't know is how to select row after modal dialog is closed (same row where modal was opened from)? 我不知道如何在关闭模式对话框后选择行(从中打开模式的同一行)? So the row acts like it was clicked before opening modal dialog (in my case it's marked with yellow color). 因此,该行的行为就像在打开模式对话框之前被单击一样(在我的情况下,该行标记为黄色)。
add 加
$(element).paremts('tr').addClass('active')
JS JS
var SetInventoryForAllCalendarsAndGroups = function () {
var OpenModalGroup = function (element) {
$(element).parents('tr').addClass('active'); // here it is
$("#myModalJEINVE_Group").modal();
}
return {
OpenModalGroup: OpenModalGroup
}
}();
CSS 的CSS
.table tbody tr.active td {
background-color: yellow;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.