首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >SmartClient中行的按需颜色集(TreeGrid)

SmartClient中行的按需颜色集(TreeGrid)
EN

Stack Overflow用户
提问于 2011-09-02 19:22:28
回答 2查看 468关注 0票数 0

我在SmartClient有一个TreeGrid。现在我想给一些线条上色,比如3-5,7-11等等。我使用了一个外部按钮,它将值传递给SmartClient。有人能告诉我怎么做吗?一个按钮正在传递该值,并且它工作正常。但问题是,从哪里获取SmartClient中的值,以及如何为这组线着色。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-09-03 06:03:03

由于TreeGrid是一个ListGrid,我想您可以覆盖getCellStyle函数并根据需要设置颜色。

http://www.smartclient.com/docs/8.1/a/b/c/go.html#search=getcellstyle

所以基本上在伪代码中:

代码语言:javascript
运行
复制
if (row >= 3 and row <=5)
     return "style1"
if (row >= 7 and row <=11)
     return "style2"
else
     return this.baseStyle

其中style1和2在css中定义。

票数 0
EN

Stack Overflow用户

发布于 2012-05-01 00:04:19

以及如何使用特定的样式名称(myStyle)自定义和保持状态,如:

  • myStyle
  • myStyleDark
  • myStyleOver
  • myStyleOverDark
  • myStyleSelected
  • myStyleSelectedDark
  • myStyleSelectedOver
  • myStyleSelectedOverDark
  • myStyleDisabled
  • myStyleDisabledDark

我尝试使用@Override of getCellStyle返回"myStyleA“或"myStyleB”,我希望保留动态后缀:"Dark","Over","Selected",...

一个想法?..。

http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/widgets/grid/ListGrid.html

代码语言:javascript
运行
复制
The state of the record is indicated by adding a suffix to the base style.
There are four independent boolean states, which are combined in the order given:

"Disabled" : whether the cell is disabled; enable by setting the "enabled" flag on record returned by getCellRecord
"Selected" : whether cell is selected; enable by passing a Selection object as "selection"
"Over" : mouse is over this cell; enable with showRollovers
"Dark" : alternating color bands; enable with alternateRowStyles 
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7282688

复制
相关文章

相似问题

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