From fe05f2d0c6bb8c87b289d2de4c49336432b6059e Mon Sep 17 00:00:00 2001 From: Harshal Dhumal Date: Thu, 7 Jan 2016 13:30:41 +0530 Subject: [PATCH] Resolved an issue setting proper optionsValues for the Select2Cell. --- .../static/js/backgrid/backgrid.pgadmin.js | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/web/pgadmin/static/js/backgrid/backgrid.pgadmin.js b/web/pgadmin/static/js/backgrid/backgrid.pgadmin.js index 56932f294..3343edca1 100644 --- a/web/pgadmin/static/js/backgrid/backgrid.pgadmin.js +++ b/web/pgadmin/static/js/backgrid/backgrid.pgadmin.js @@ -294,29 +294,29 @@ * Select2Cell for backgrid. */ var Select2Cell = Backgrid.Extension.Select2Cell = Backgrid.Cell.extend({ - className: "select2-cell", - + defaults: _.defaults({ + select2: {} + }, Backgrid.Cell.prototype.defaults), events: { "change": "onSave", "select2:unselect": "onSave" }, template: _.template( - '', - null, - {variable: null} + '' ), render: function () { var col = _.defaults(this.column.toJSON(), this.defaults), model = this.model, column = this.column, editable = Backgrid.callByNeed(col.editable, column, model), - optionValues = this.optionValues; + optionValues = _.clone(this.optionValues || this.column.get('options')); this.$el.empty(); if (!_.isArray(optionValues)) throw new TypeError("optionValues must be an array"); - /* Add empty option as Select2 requires any empty '