SpreadJS使用教程:如何实现Specific Text 和TOP 10规则

SpreadJS最新试用版

使用 Specific Text 规则

Specific Text 规则用于查找单元格中的字符串。

SpreadJS使用教程:如何实现Specific Text 和TOP 10规则

示例代码

以下代码使用了Specific Text 规则。

var style = new GC.Spread.Sheets.Style();style.backColor = "red";var ranges=[new GC.Spread.Sheets.Range(0,0,10,1)];activeSheet.conditionalFormats.addSpecificTextRule(GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators.Contains, "test", style, ranges);activeSheet.setValue(0, 0, "testing");activeSheet.setValue(1, 0, "test");activeSheet.setValue(2, 0, "a");activeSheet.setValue(3, 0, "t");

使用 Top 10 规则

Top 10 规则用于检查单元格中的值是否较大或者较小。

SpreadJS使用教程:如何实现Specific Text 和TOP 10规则

示例代码

以下代码创建了两个 Scale 规则。

var style = new GC.Spread.Sheets.Style();style.backColor = "red";var ranges=[new GC.Spread.Sheets.Range(0,0,10,1)];activeSheet.conditionalFormats.addTop10Rule(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.Top, 2, style, ranges);activeSheet.setValue(0, 0, 1);activeSheet.setValue(1, 0, 50);activeSheet.setValue(2, 0, 11);activeSheet.setValue(3, 0, 5);

如果你对我们的产品感兴趣或者有任何疑问,欢迎咨询在线客服>>

高端UI界面开发
标签:

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2020年6月26日
下一篇 2020年6月26日

相关推荐

发表回复

登录后才能评论