SpreadJS Documentation
treatNullValueAsZero Field
Indicates whether to treat the null value in a cell as zero.
Syntax
var instance = new GcSpread.Sheets.CellValueCondition(compareType, expected, formula);
var value; // Type: boolean
value = instance.treatNullValueAsZero;
var treatNullValueAsZero : boolean;
Example
This example sets the treatNullValueAsZero property.
var nCondition = new GcSpread.Sheets.CellValueCondition();
nCondition.compareType = GcSpread.Sheets.GeneralCompareType.EqualsTo;
nCondition.expected = 0;
//When the option is false, the validation fails and the red alert is displayed.
//When the option is true, the blank cell is treated as zero and the validation is successful.
nCondition.treatNullValueAsZero = false;
var validator = new GcSpread.Sheets.DefaultDataValidator(nCondition)
validator.IgnoreBlank(false);
activeSheet.getCell(0, 0, GcSpread.Sheets.SheetArea.viewport).dataValidator(validator);
spread.highlightInvalidData(true);
activeSheet.setValue(0, 0, null);
See Also

Reference

CellValueCondition type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.