SpreadJS Documentation
GC.Spread.Sheets.DataValidation Namespace / DefaultDataValidator type / highlightStyle Method
typeIndicates the data validation highlightType.
Indicates the data validation highlight color.
Indicates the data validation highlight position.
Indicates the data validation highlight image url or data.
In This Topic
    highlightStyle Method
    In This Topic
    Get or Sets the invalid data cell highlight style.
    Syntax
    var instance = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(condition);
    var value; // Type: any
    value = instance.highlightStyle(style.type, style.color, style.position, style.image);
    function highlightStyle( 
       (optional) style.type : HighlightType,
       (optional) style.color : string,
       (optional) style.position : HighlightPosition,
       (optional) style.image : string
    ) : any;

    Parameters

    style.type
    typeIndicates the data validation highlightType.
    style.color
    Indicates the data validation highlight color.
    style.position
    Indicates the data validation highlight position.
    style.image
    Indicates the data validation highlight image url or data.

    Return Value

    If no value is set, returns the hignlight style object; otherwise, returns the data validator.
    Example
    //This example uses the highlightStyle method.
    sheet.setValue(1, 1, "sss");
    var dv = new GC.Spread.Sheets.DataValidation.createListValidator('Fruit,Vegetable,Food');
    dv.highlightStyle({
       type:GC.Spread.Sheets.DataValidation.HignlightType.dogEar,
       color:'blue',
       position:GC.Spread.Sheets.DataValidation.HighlightPosition.topLeft
    });
    sheet.setDataValidator(1,1, dv);
    spread.options.highlightInvalidData = true;
    See Also