我在SmartClient有一个TreeGrid。现在我想给一些线条上色,比如3-5,7-11等等。我使用了一个外部按钮,它将值传递给SmartClient。有人能告诉我怎么做吗?一个按钮正在传递该值,并且它工作正常。但问题是,从哪里获取SmartClient中的值,以及如何为这组线着色。
发布于 2011-09-03 06:03:03
由于TreeGrid是一个ListGrid,我想您可以覆盖getCellStyle函数并根据需要设置颜色。
http://www.smartclient.com/docs/8.1/a/b/c/go.html#search=getcellstyle
所以基本上在伪代码中:
if (row >= 3 and row <=5)
return "style1"
if (row >= 7 and row <=11)
return "style2"
else
return this.baseStyle其中style1和2在css中定义。
发布于 2012-05-01 00:04:19
以及如何使用特定的样式名称(myStyle)自定义和保持状态,如:
我尝试使用@Override of getCellStyle返回"myStyleA“或"myStyleB”,我希望保留动态后缀:"Dark","Over","Selected",...
一个想法?..。
http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/widgets/grid/ListGrid.html
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 https://stackoverflow.com/questions/7282688
复制相似问题