在表格行中将菜单选项的齿轮图标选择为删除时,我已经将背景颜色设置为黄色,我尝试了以下代码来突出显示表格行,
click: function () {
var ibmm = this.get('parentView.rowView.object');
var ibmms = this.get('parentView.rowView.tableView.model');
$(function() {
$("table.content-table.highlighted tr.content-row").on("focusout", function() {
$(this).toggleClass("my-line");
});
});
var model = Core.model.Menu.create({
loadState: 'done',
content: [
Core.model.Menu.Item.create({
label: 'Delete',
icon: 'delete',
invoke: function () {
var fmtLabel = ibmm.label ? (ibmm.label + " ("+ibmm.name+")") : ibmm.name;
Core.confirm(
"Delete Definition",
"Are you sure you want to delete the Definition for " + fmtLabel + "?",
"Delete",
"Cancel"
).then(function () {
Core.services({
service: 'ibmm',
type: 'delete',
data: {
name: ibmm.name
}
}).done(function () {
ibmms.reload();
Core.notify({
title:"Delete LMD Definition",
message: "LMD Definition " + fmtLabel + " deleted"
});
});
});
}
})
]
});
var view = Core.view.Menu.create({
model: model,
menuContext: { ibmm: ibmm },
anchor: this.$(),
highlight: this.$().parents('tr:first')
});
view.show();
return false;
}
我正在使用的对应CSS:
table.content-table.highlighted tr.content-row.my-line {
background: #FFFF99 none 0 0 repeat;
}
在带有齿轮图标的表格行(隐藏)中选择菜单时,通过使用 focusout 功能,背景色显示得很好。但是,当我选择带有齿轮图标的下一个表格行时,背景颜色逐渐消失。由于主点击功能是通过使用返回来实现的。我在click函数中具有click函数。所以只有这些问题发生了。