Edit
=======================================
Easier way to setup multiple select editor without mixing HTML markup in js is
editor: {
type: 'select',
attr: 'multiple',
options: userIndex (array of strings or array of objects )
}
=========================================================
This is the working code of multiple select editor using callback function (which is quite lengthy).
var selectEditor = function (ui) {
var $cell = ui.$cell,
rowData = ui.rowData,
dataIndx = ui.dataIndx,
cls = ui.cls,
dc = ui.cellData,
dc = dc ? dc : [];
var options = ['a', 'b', 'c'],
str="";
for (var i = 0; i < options.length; i++) {
var opt = options[i];
if ($.inArray(opt, dc)!=-1)
str += "<option selected>" + opt + "</option>";
else
str += "<option>" + opt + "</option>";
}
var $sel = $('<select id="example" name="' + dataIndx + '" multiple="multiple" class="' + cls + '">' + str + "</select>")
.appendTo($cell);
}