Figured out. my values were not same as text when re-initializing it back so pq-select was not setting it back. I also do not need cellclick event.
editor: {
type: 'select',
attr: "multiple='multiple'",
init: function (ui) {
console.log("ui.cellData init");
console.log(ui.cellData);
var val = ui.cellData == null ? "" : ui.cellData;
var $sel = ui.$cell.find("select");
if (val != "") {
var optValues = val.split(",");
var trimOptValues = [];
for (var i = 0; i < optValues.length; i++)
{
trimOptValues.push(optValues.trim());
}
$sel.val(trimOptValues);
}
$sel.pqSelect({
checkbox: true,
multiplePlaceholder: 'Select Multiple',
maxDisplay: 5
});
},
getData: function (ui) {
//var val = ui.$cell.find("select").val();
// alert("hi");
// console.log("getdata");
var txt = ui.$cell.find("select").find("option:selected");
console.log(txt);
var selected = [];
for (var i = 0, l = txt.length; i < l; i++) {
selected.push(txt.textContent);
}
return selected.join(', ');
},