SpreadJS 13
GC.Spread.Formatter Namespace / FormatterBase type / parse Method
The text.
In This Topic
    parse Method
    In This Topic
    Parses the specified text. This function should be overwritten.
    Syntax
    var instance = new GC.Spread.Formatter.FormatterBase(format, cultureName);
    var value; // Type: Object
    value = instance.parse(text);
    function parse( 
       text : string
    ) : Object;

    Parameters

    text
    The text.

    Return Value

    The parsed object.
    Example
    This example creates a custom formatter.
    var customFormatterTest = {};
    customFormatterTest.prototype = GC.Spread.Formatter.FormatterBase;
    customFormatterTest.format = function (obj, conditionalForeColor) {
        conditionalForeColor.value = "blue";
        return "My format result : " + obj.toString();
    };
    customFormatterTest.parse = function (str) {
        if (!str) {
            return "";
        }
        return str;
    }
    activeSheet.getCell(1, 0).formatter(customFormatterTest);
    activeSheet.getCell(1, 0).value("Test");
    See Also