单击下一个表格行后,突出显示的行不会消失 [英] Highlight row is not getting disappear after I click the next table row

查看:72
本文介绍了单击下一个表格行后,突出显示的行不会消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I need to create background as yellow while selecting the gear icon for the menu option in the table row, I have tried the below code for highlighting the table row,

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

从表格行(隐藏)中选择带有齿轮图标的菜单时,背景颜色即将到来好。

While selecting the menu from the table row (hidden) with the gear icon, the background color is coming well.

[![在此处输入图片说明] [1]] [1]

[![enter image description here][1]][1]

相应的html文件如下

corresponding html file is below

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

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

But when I move to the next table row(non hidden), the past table row color is still in yellow color, not getting disappear.

[![在此处输入图像说明] [2]] [2]

[![enter image description here][2]][2]

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

I'm using the below css code for creating the highlight when i'm clicking the row

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

任何人都可以建议我代码。我正在使用Ember 1.4.0。

Can anybody suggest me code for this. I’m using Ember 1.4.0.

推荐答案

您可以在jquery下面尝试重置背景颜色,在焦点上发生事件。

you can try below jquery to reset your background color where event will occur on 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
  });
});

这篇关于单击下一个表格行后,突出显示的行不会消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆