Skip to content

Commit 9beed9c

Browse files
author
Tim Shawver
committed
Fix for issue where editing a categorical fails when selecting an item with single quotes, issue #209.
1 parent b377885 commit 9beed9c

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

js/src/qgrid.editors.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,17 @@ class SelectEditor {
6363
}
6464

6565
var option_str = "";
66+
67+
this.elem = $("<SELECT tabIndex='0' class='editor-select'>");
68+
6669
for (var i in this.options) {
6770
var opt = $.trim(this.options[i]); // remove any white space including spaces after comma
68-
option_str += "<OPTION value='" + opt + "'>" + opt + "</OPTION>";
71+
var opt_elem = $("<OPTION>");
72+
opt_elem.val(opt);
73+
opt_elem.text(opt);
74+
opt_elem.appendTo(this.elem);
6975
}
70-
this.elem = $("<SELECT tabIndex='0' class='editor-select'>" + option_str + "</SELECT>");
76+
7177
this.elem.appendTo(args.container);
7278
this.elem.focus();
7379
}

0 commit comments

Comments
 (0)