tonytomov/jqGrid — Issue #215: Add support for JavaScript booleans as values for checkboxes in createEl
Author: emielJ
Created: 2011-12-11 21:29:51+00:00
State: open

When the value `false` is used as the value for a `checkbox` element that has to be created using the function `createEl` in `grid.common.js` an exception occurs in the first line of the following snippet:

var vl1 = vl.toLowerCase();
if (vl1.search(/(false|0|no|off|undefined)/i) < 0 && vl1 !== "") {

If this snippet is changed to

var vl1 = (vl + "").toLowerCase();
if (vl1.search(/(false|0|no|off|undefined)/i) < 0 && vl1 !== "") {

this code will also work when JavaScript booleans are used as values.

Not this construct is also used in other parts of the jqGrid code, for instance in `grid.formedit.js`