Hi,

PFA patch for backgrid Select2cell in which I have added multiselect
support which was missing.

-- 
*Harshal Dhumal*
*Software Engineer *



EenterpriseDB <http://www.enterprisedb.com>
diff --git a/web/pgadmin/static/js/backgrid/backgrid.pgadmin.js b/web/pgadmin/static/js/backgrid/backgrid.pgadmin.js
index 55ba7c0..d2d4486 100644
--- a/web/pgadmin/static/js/backgrid/backgrid.pgadmin.js
+++ b/web/pgadmin/static/js/backgrid/backgrid.pgadmin.js
@@ -396,7 +396,7 @@
     editor: null,
 
     defaults: _.defaults({
-      select2: {},
+      select2: {multiple:false},
       opt: {
         label: null,
         value: null,
@@ -471,11 +471,18 @@
       var optionText = null,
           optionValue = null,
           model = this.model,
-          selectedValues = model.get(this.column.get("name"));
+          selectedValues = model.get(this.column.get("name")),
+          self = this,
+          select2_opts = _.extend(
+            {openOnEnter: false},
+            col.select2, this.defaults.select2
+            ),
+          selectTpl = _.template('<select <%=multiple ? "multiple" : "" %>></select>');
 
       delete this.$select;
-      self = this,
-      $select = self.$select = $('<select></select>').appendTo(this.$el);
+
+      $select = self.$select = $(selectTpl(
+          {multiple:select2_opts.multiple})).appendTo(this.$el);
 
       for (var i = 0; i < optionValues.length; i++) {
         var opt = optionValues[i];
@@ -501,11 +508,6 @@
         }
       }
 
-      var select2_opts = _.extend(
-            {openOnEnter: false},
-            col.select2, this.defaults.select2
-            );
-
       if(col && _.has(col.disabled)) {
         _.extend(select2_opts, {
           disabled: evalF(col.disabled, col, model)
-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Reply via email to