SpreadJS 13
GC.Spread.Sheets Namespace / Worksheet type / setDataValidator Method
The row index.
The column index.
The row count.
The column count.
The data validator.
The sheet area. If this parameter is not provided, it defaults to viewport.
In This Topic
    setDataValidator Method
    In This Topic
    Sets the cell data validator.
    Syntax
    var instance = new GC.Spread.Sheets.Worksheet(name);
    var returnValue; // Type: any
    returnValue = instance.setDataValidator(row, col, rowCount, colCount, value, sheetArea);
    function setDataValidator( 
       row : number,
       col : number,
       rowCount : number,
       colCount : number,
       value : DefaultDataValidator,
       sheetArea : SheetArea
    ) : any;

    Parameters

    row
    The row index.
    col
    The column index.
    rowCount
    The row count.
    colCount
    The column count.
    value
    The data validator.
    sheetArea
    The sheet area. If this parameter is not provided, it defaults to viewport.
    Example
    spread.options.highlightInvalidData = true;
    var dv = GC.Spread.Sheets.DataValidation.createListValidator("1,2,3");
    dv.showInputMessage(true);
    dv.inputMessage("Value must be 1,2 or 3");
    dv.inputTitle("tip");
    activeSheet.setDataValidator(1,1,1,1,dv,GC.Spread.Sheets.SheetArea.viewport);
    alert(activeSheet.getDataValidator(1,1).getValidList(activeSheet,1,1));
    See Also

    Reference

    Worksheet type