单击下一个 table 行后,突出显示行没有消失

Highlight row is not getting disappear after I click the next table row

我需要在为 table 行中的菜单选项选择齿轮图标时将背景创建为黄色,我已尝试使用以下代码突出显示 table 行,

var view = Core.view.Menu.create({
    model: model,
    menuContext: { ibmm: ibmm },
    anchor: this.$(),
    highlight: this.$().parents('tr:first').css('background-color','yellow')
});
view.show();

从带有齿轮图标的 table 行(隐藏)中选择菜单时,背景颜色很好。

[![在此处输入图片描述][1]][1]

对应的html文件如下

<tr id="ember23242" class="ember-view content-row body-row-view container-view" tabindex="0" aria-label="">

但是当我移动到下一个table行(非隐藏)时,过去的table行颜色仍然是黄色,没有消失。

[![在此处输入图片描述][2]][2]

我正在使用下面的 css 代码在我单击行时创建突出显示

table.content-table.highlighted tr.content-row:focus {
  background: #FFFF99 none 0 0 repeat;
}

任何人都可以建议我为此编写代码。我正在使用 Ember 1.4.0.

检查:first and :first-child

之间的区别
var view = Core.view.Menu.create({
    model: model,
    menuContext: { ibmm: ibmm },
    anchor: this.$(),
    highlight: this.$().parents('tr:first-child').css('background-color','yellow')
});
view.show();

您可以尝试以下 jquery 来重置 focusout 事件发生时的背景颜色。

$(function(){
  $("table.content-table.highlighted tr.content-row").on("focusout", function(){
        $(this).css('background','#FFFF00 none 0 0 repeat'); // change color code as per your need
  });
});