But what about when the pqgrid editor options are coming from a JSON array? The following does NOT work: { "value" : theValue, "text" : theText, "selected" : "selected" } or this { "value" : theValue, "text" : theText, "selected" : "true" }.
Or is the only way to handle this to override the column editor Type callback function? e.g. $( ".selector" ).pqGrid( "option", "colModel" )[6].editor.type
To answer my own question, I was able to solve it with the following, but it would be a plus to have it accept a JSON marker:
type: function (ui) {
var str = "<select multiple>",
options = ui.column.editor.options;
if (ui.cellData) {
$(options).each(function (i, option) {
var selected = '';
if (ui.cellData.indexOf(option.value) > -1) {
selected = 'selected';
}
str += "<option value='" + option.value + "' " + selected + " >" + option.text + "</option>";
});
str += "</select>"
ui.$cell.append(str);
} else {
return 'select';
}
},