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 } ] });