首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用focusCellOnPointerMove时,表格单元格的样式设置在哪里?

问使用focusCellOnPointerMove时,表格单元格的样式设置在哪里?
EN

Stack Overflow用户
提问于 2017-03-12 01:49:53
回答 1查看 116关注 0票数 1

我有一个qx.ui.table.Table,当一行获得焦点时,它变得很难阅读。我使用qx.ui.table.cellrenderer.Date作为基类来覆盖单元格的背景颜色,尽管它看起来不像是在

focusCellOnPointerMove : true触发事件。

那么,当一行获得焦点时,表格的样式在哪里呢?

​

​

这是我的覆盖:

代码语言:javascript
复制
// Overridden
_getCellStyle : function(cellInfo)
{
  var diff = 5; // Example
  if (diff < 60)
  {
    var color = '#8cff5e';
    return this.base(arguments, cellInfo) + "background-color:" + color + ";";
  } else if (diff < 60 * 5)
  {
    var color = '#ffff00';
    return this.base(arguments, cellInfo) + "background-color:" + color + ";";
  } else
  {
    return cellInfo.style || "";
  }

},

使用scro34的建议:

​

EN

回答 1

Stack Overflow用户

发布于 2017-03-12 05:54:43

如果只想在表行指向某个表行时更改其背景颜色,可以使用qooxdoo的主题化功能并覆盖应用程序的主题附带的颜色声明。

当指针悬停在某一行上时,表格构件使用两个颜色键来控制背景颜色:表格-行-背景-焦点(未选定行)和表格-行-背景-焦点-选定(选定行)。

要覆盖预定义的值,请打开位于应用程序的"theme“文件夹中的Color.js,并向文件的"colors”部分添加两个条目,例如:

代码语言:javascript
复制
qx.Theme.define("myApp.theme.Color",
{
  extend : qx.theme.indigo.Color,

  colors :
  {
     "table-row-background-focused" : "#8cff5e",
     "table-row-background-focused-selected" : "#ffff00"
  }
});

更多关于qooxdoo主题的信息:http://www.qooxdoo.org/current/pages/desktop/ui_theming.html

关于表格样式的教程:http://www.qooxdoo.org/5.0.1/pages/desktop/ui_table_styling.html

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42738567

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档