SpreadJS 13
GC.Spread.Sheets.ConditionalFormatting Namespace / CustomValueType Enumeration
In This Topic
    CustomValueType Enumeration
    In This Topic
    Specifies the custom value type.
    Members
    MemberDescription
    emptyIndicates whether the cell value is empty or null.
    errorIndicates whether the cell value contains a calculation error.
    formulaIndicates whether the cell value is a formula.
    nonEmptyIndicates whether the cell value is not empty or null.
    nonErrorIndicates whether the cell value does not contain a calculation error.
    Example
    The following examples create conditions.
    var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.formulaCondition, {customValueType: GC.Spread.Sheets.ConditionalFormatting.CustomValueType.formula,
        formula: "A1>0"});
    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, -4);
    var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.formulaCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.CustomValueType.nonEmpty});
    var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition);
    validator.ignoreBlank(false);
    activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator);
    spread.options.highlightInvalidData = true;
    var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.formulaCondition);
    nCondition.customValueType(GC.Spread.Sheets.ConditionalFormatting.CustomValueType.formula);
    nCondition.formula("A1>0");
    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, -4);
    Inheritance Hierarchy

    Object
       GC.Spread.Sheets.ConditionalFormatting.CustomValueType

    See Also