var instance; // Type: wijmo.grid.IC1FieldOptions; var value; // Type: IDataParser value = instance.dataParser;
var dataParser : IDataParser;
Data converter that is able to translate values from a string representation to column data type and back.
var instance; // Type: wijmo.grid.IC1FieldOptions; var value; // Type: IDataParser value = instance.dataParser;
var dataParser : IDataParser;
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 } ] });