[]
Sheets.ConditionalFormatting.TextCompareType
文本比较类型
代码示例
//本示例使用TextCompareType枚举
var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.TextCompareType.contains, expected: "test"});
var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition);
validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom);
activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator);
spread.options.highlightInvalidData = true;
activeSheet.setValue(0, 0, "testing");
//Type text in 0,0 that does not contain "test" to see invalid symbol
• beginsWith = 2
字符串是否以指定的字符串开始
• contains = 6
字符串是否包含指定的字符串
• doesNotBeginWith = 3
字符串是否以指定的字符串开始
• doesNotContain = 7
字符串是否不包含指定的字符串
• doesNotEndWith = 5
字符串是否不以指定的字符串结束
• endsWith = 4
字符串是否以指定的字符串结束
• equalsTo = 0
字符串是否等于指定的字符串
• notEqualsTo = 1
字符串是否不等于指定的字符串