开发者

Dojo datgrid cell font colour

How to add a font color to a cell in dojo datagrid? I need to change the color dynamically (depend on the value it gets). I don't want to use html tags returning from formatter method.

for example, 'number' should be red if lesser than 0 and blue greater than 0.

in layout,

number{
 formatter : format
}

method,

var format(value){
  if(value<0){
     // what should to returned to 开发者_如何转开发change font color without html tag?
  }else if(value>0){
    // what should to returned to change font color without html tag?
  }
}


You can try with

dojo.style(node, style, value);

if you know the node. After that you may need to render the grid. This should have the same effect as using html tags in the formatter. Which may look aesthetically ugly but works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜