Wijmo UI for the Web
dataParser Field
wijmo.grid Namespace > IC1FieldOptions Interface : dataParser Field

Type: wijmo.grid.IDataParser

Data converter that is able to translate values from a string representation to column data type and back.

Syntax
var instance; // Type: wijmo.grid.IC1FieldOptions;
var value; // Type: IDataParser
value = instance.dataParser;
var dataParser : IDataParser;
Example
var myBoolParser = {
    parseDOM: function (value, culture, format, nullString) {
        return this.parse(value.innerHTML, culture, format, nullString);
    },
    parse: function (value, culture, format, nullString) {
        if (typeof (value) === "boolean")  return value;
        if (!value || (value === " ") || (value === nullString)) {
            return null;
        }
        switch (value.toLowerCase()) {
            case "on": return true;
            case "off": return false;
        }
        return NaN;
    },
    toStr: function (value, culture, format, nullString) {
        if (value === null)  return nullString;
            return (value) ? "on" : "off";
        }
    }
}
$("#element").wijgrid({ columns: [ { dataType: "boolean", dataParser: myBoolParser } ] });
Remarks
If undefined, than the built-in parser for supported datatypes will be used.
See Also

Reference

IC1FieldOptions Interface