diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.js b/web/pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.js
index 2d5fb295..97e689b9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.js
@@ -1,101 +1,102 @@
 define('pgadmin.node.cast', [
-  'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'sources/pgadmin',
-  'pgadmin.browser', 'pgadmin.alertifyjs', 'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
+  'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
+  'pgadmin.alertifyjs', 'pgadmin.backform', 'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, Backform) {
     // Extend the collection class for cast
-    if (!pgBrowser.Nodes['coll-cast']) {
-      var casts = pgAdmin.Browser.Nodes['coll-cast'] =
-        pgAdmin.Browser.Collection.extend({
-          node: 'cast',
-          label: gettext('Casts'),
-          type: 'coll-cast',
-          columns: ['name', 'description']
-        });
-    };
+  if (!pgBrowser.Nodes['coll-cast']) {
+    pgAdmin.Browser.Nodes['coll-cast'] =
+      pgAdmin.Browser.Collection.extend({
+        node: 'cast',
+        label: gettext('Casts'),
+        type: 'coll-cast',
+        columns: ['name', 'description'],
+      });
+  }
 
     // Extend the node class for cast
-    if (!pgBrowser.Nodes['cast']) {
-      pgAdmin.Browser.Nodes['cast'] = pgAdmin.Browser.Node.extend({
-        parent_type: 'database',
-        type: 'cast',
-        sqlAlterHelp: 'sql-altercast.html',
-        sqlCreateHelp: 'sql-createcast.html',
-        dialogHelp: url_for('help.static', {'filename': 'cast_dialog.html'}),
-        canDrop: true,
-        canDropCascade: true,
-        label: gettext('Cast'),
-        hasSQL: true,
-        hasDepends: true,
-        Init: function() {
+  if (!pgBrowser.Nodes['cast']) {
+    pgAdmin.Browser.Nodes['cast'] = pgAdmin.Browser.Node.extend({
+      parent_type: 'database',
+      type: 'cast',
+      sqlAlterHelp: 'sql-altercast.html',
+      sqlCreateHelp: 'sql-createcast.html',
+      dialogHelp: url_for('help.static', {'filename': 'cast_dialog.html'}),
+      canDrop: true,
+      canDropCascade: true,
+      label: gettext('Cast'),
+      hasSQL: true,
+      hasDepends: true,
+      Init: function() {
 
           // Avoid multiple registration of menus
-          if (this.initialized)
-            return;
+        if (this.initialized)
+          return;
 
-          this.initialized = true;
+        this.initialized = true;
 
           // Add context menus for cast
-          pgBrowser.add_menus([{
-            name: 'create_cast_on_database', node: 'database', module: this,
-            applies: ['object', 'context'], callback: 'show_obj_properties',
-            category: 'create', priority: 4, label: gettext('Cast...'),
-            icon: 'wcTabIcon icon-cast', data: {action: 'create'},
-            enable: pgBrowser.Nodes['database'].is_conn_allow
-          },{
-            name: 'create_cast_on_coll', node: 'coll-cast', module: this,
-            applies: ['object', 'context'], callback: 'show_obj_properties',
-            category: 'create', priority: 4, label: gettext('Cast...'),
-            icon: 'wcTabIcon icon-cast', data: {action: 'create'}
-          },{
-            name: 'create_cast', node: 'cast', module: this,
-            applies: ['object', 'context'], callback: 'show_obj_properties',
-            category: 'create', priority: 4, label: gettext('Cast...'),
-            icon: 'wcTabIcon icon-cast', data: {action: 'create'}
-          }]);
+        pgBrowser.add_menus([{
+          name: 'create_cast_on_database', node: 'database', module: this,
+          applies: ['object', 'context'], callback: 'show_obj_properties',
+          category: 'create', priority: 4, label: gettext('Cast...'),
+          icon: 'wcTabIcon icon-cast', data: {action: 'create'},
+          enable: pgBrowser.Nodes['database'].is_conn_allow,
+        },{
+          name: 'create_cast_on_coll', node: 'coll-cast', module: this,
+          applies: ['object', 'context'], callback: 'show_obj_properties',
+          category: 'create', priority: 4, label: gettext('Cast...'),
+          icon: 'wcTabIcon icon-cast', data: {action: 'create'},
+        },{
+          name: 'create_cast', node: 'cast', module: this,
+          applies: ['object', 'context'], callback: 'show_obj_properties',
+          category: 'create', priority: 4, label: gettext('Cast...'),
+          icon: 'wcTabIcon icon-cast', data: {action: 'create'},
+        }]);
 
-        },
+      },
 
         // Define the backform model for cast node
-        model: pgAdmin.Browser.Node.Model.extend({
-          defaults: {
-            name: undefined,            // Name of the cast
-            encoding: 'UTF8',
-            srctyp: undefined,          // Source type
-            trgtyp: undefined,          // Target type
-            proname: undefined,         // Function
-            castcontext: undefined,     // Context (IMPLICIT/EXPLICIT/ASSIGNMENT)
-            syscast: undefined,         // Is this cast is system object? Yes/No
-            description: undefined      // Comment on the cast
-          },
+      model: pgAdmin.Browser.Node.Model.extend({
+        defaults: {
+          name: undefined,            // Name of the cast
+          encoding: 'UTF8',
+          srctyp: undefined,          // Source type
+          trgtyp: undefined,          // Target type
+          proname: undefined,         // Function
+          castcontext: undefined,     // Context (IMPLICIT/EXPLICIT/ASSIGNMENT)
+          syscast: undefined,         // Is this cast is system object? Yes/No
+          description: undefined,      // Comment on the cast
+        },
 
           // Define the schema for cast
-          schema: [{
-            id: 'name', label: gettext('Name'), cell: 'string',
-            editable: false, type: 'text', disabled: true, cellHeaderClasses: 'width_percent_50'
-          },{
-            id: 'oid', label: gettext('OID'), cell: 'string',
-            editable: false, type: 'text', disabled: true, mode: ['properties'],
-          },{
-            id: 'srctyp', label: gettext('Source type'), url: 'get_type',
-            type: 'text', group: gettext('Definition'), disabled: function(m) {
-            return !m.isNew()
-            }, mode: ['create'],
+        schema: [{
+          id: 'name', label: gettext('Name'), cell: 'string',
+          editable: false, type: 'text', disabled: true, cellHeaderClasses: 'width_percent_50',
+        },{
+          id: 'oid', label: gettext('OID'), cell: 'string',
+          editable: false, type: 'text', disabled: true, mode: ['properties'],
+        },{
+          id: 'srctyp', label: gettext('Source type'), url: 'get_type',
+          type: 'text', group: gettext('Definition'), disabled: function(m) {
+            return !m.isNew();
+          }, mode: ['create'],
 
-            transform: function(rows) {
-              _.each(rows, function(r) {
-                r['image'] = 'icon-cast';
-              });
-              return rows;
-            },
+          transform: function(rows) {
+            _.each(rows, function(r) {
+              r['image'] = 'icon-cast';
+            });
+            return rows;
+          },
 
             /*
              * Control is extended to create cast name from source type and destination type
              * once their values are changed
              */
-             control: Backform.NodeAjaxOptionsControl.extend({
+          control: Backform.NodeAjaxOptionsControl.extend({
 
-               onChange: function() {
-                 Backform.NodeAjaxOptionsControl.prototype.onChange.apply(
+            onChange: function() {
+              Backform.NodeAjaxOptionsControl.prototype.onChange.apply(
                     this, arguments
                     );
 
@@ -104,44 +105,44 @@ define('pgadmin.node.cast', [
                   * target type are set, if yes then fetch values from both
                   * controls and generate cast name
                   */
-                 var srctype = this.model.get('srctyp');
-                 var trgtype = this.model.get('trgtyp');
-                 if(srctype != undefined && srctype != '' &&
+              var srctype = this.model.get('srctyp');
+              var trgtype = this.model.get('trgtyp');
+              if(srctype != undefined && srctype != '' &&
                     trgtype != undefined && trgtype != '')
-                   this.model.set("name", srctype+"->"+trgtype);
-                 else
-                   this.model.unset("name");
-               }
-            })
-          },
+                this.model.set('name', srctype+'->'+trgtype);
+              else
+                   this.model.unset('name');
+            },
+          }),
+        },
 
           /*
            * Text control for viewing source type in properties and
            * edit mode only
            */
-          {
-            id: 'srctyp', label: gettext('Source type'), type: 'text',
-            group: gettext('Definition'), disabled: true, mode:['properties','edit']
-          },{
-            id: 'trgtyp', label: gettext('Target type'), url: 'get_type',
-            type: 'text', group: gettext('Definition'), disabled: function(m) {
-              return !m.isNew()
-              }, mode: ['create'],
-            transform: function(rows) {
-              _.each(rows, function(r) {
-                r['image'] = 'icon-cast';
-              });
-              return rows;
-            },
+        {
+          id: 'srctyp', label: gettext('Source type'), type: 'text',
+          group: gettext('Definition'), disabled: true, mode:['properties','edit'],
+        },{
+          id: 'trgtyp', label: gettext('Target type'), url: 'get_type',
+          type: 'text', group: gettext('Definition'), disabled: function(m) {
+            return !m.isNew();
+          }, mode: ['create'],
+          transform: function(rows) {
+            _.each(rows, function(r) {
+              r['image'] = 'icon-cast';
+            });
+            return rows;
+          },
 
             /*
              * Control is extended to create cast name from source type and destination type
              * once their values are changed
              */
-             control: Backform.NodeAjaxOptionsControl.extend({
+          control: Backform.NodeAjaxOptionsControl.extend({
 
-             onChange: function() {
-               Backform.NodeAjaxOptionsControl.prototype.onChange.apply(
+            onChange: function() {
+              Backform.NodeAjaxOptionsControl.prototype.onChange.apply(
                  this, arguments
                  );
 
@@ -150,76 +151,78 @@ define('pgadmin.node.cast', [
                   * target type are set, if yes then fetch values from both
                   * controls and generate cast name
                   */
-               var srcType = this.model.get('srctyp');
-               var trgtype = this.model.get('trgtyp');
-               if(srcType != undefined && srcType != '' &&
+              var srcType = this.model.get('srctyp');
+              var trgtype = this.model.get('trgtyp');
+              if(srcType != undefined && srcType != '' &&
                   trgtype != undefined && trgtype != '')
-                 this.model.set("name", srcType+"->"+trgtype);
-               else
-                 this.model.unset("name");
-             }
-             })
-          },
+                this.model.set('name', srcType+'->'+trgtype);
+              else
+                 this.model.unset('name');
+            },
+          }),
+        },
           /*
            * Text control for viewing target type in properties and
            * edit mode only
            */
-          {
-            id: 'trgtyp', label: gettext('Target type'), type: 'text',
-            group: gettext('Definition'), disabled: true, mode:['properties','edit']
-          },
+        {
+          id: 'trgtyp', label: gettext('Target type'), type: 'text',
+          group: gettext('Definition'), disabled: true, mode:['properties','edit'],
+        },
 
           /*
            * Proname field is dependent on source type and target type.
            * On source and target type changed event,
            * associated functions will be fetch using ajax call
            */
-          {
-            id: 'proname', label: gettext('Function'), deps:['srctyp', 'trgtyp'],
-            type: 'text', disabled: function(m) { return !m.isNew(); },
-            group: gettext('Definition'), mode: ['create'],
-            control: 'node-ajax-options',
-            options: function(control) {
-              var srcTyp = control.model.get('srctyp');
-              var trgtyp = control.model.get('trgtyp');
-              var res = [];
+        {
+          id: 'proname', label: gettext('Function'), deps:['srctyp', 'trgtyp'],
+          type: 'text', disabled: function(m) { return !m.isNew(); },
+          group: gettext('Definition'), mode: ['create'],
+          control: 'node-ajax-options',
+          options: function(control) {
+            var srcTyp = control.model.get('srctyp');
+            var trgtyp = control.model.get('trgtyp');
+            var res = [];
 
-              if(srcTyp != undefined && srcTyp != '' &&
+            if(srcTyp != undefined && srcTyp != '' &&
                  trgtyp != undefined && trgtyp != '')
               {
-                 var node = control.field.get('schema_node'),
-                 _url = node.generate_url.apply(
+              var node = control.field.get('schema_node'),
+                _url = node.generate_url.apply(
                  node, [
                    null, 'get_functions', control.field.get('node_data'), false,
-                   control.field.get('node_info')
+                   control.field.get('node_info'),
                  ]);
-                 $.ajax({
-                 type: 'POST',
-                 timeout: 30000,
-                 url: _url,
-                 cache: false,
-                 async: false,
-                 data: {"srctyp" : srcTyp, "trgtyp" : trgtyp},
+              $.ajax({
+                type: 'POST',
+                timeout: 30000,
+                url: _url,
+                cache: false,
+                async: false,
+                data: {'srctyp' : srcTyp, 'trgtyp' : trgtyp},
 
                  // On success return function list from server
-                 success: function(result) {
-                   res = result.data;
-                   return res;
-                 },
+                success: function(result) {
+                  res = result.data;
+                  return res;
+                },
 
                  // On failure show error appropriate error message to user
-                 error: function(xhr, status, error) {
-                   try {
-                     var err = $.parseJSON(xhr.responseText);
-                     if (err.success == 0) {
-                       alertify.error(err.errormsg);
-                     }
-                   } catch (e) {}
-                 }
-                });
-              }
+                error: function(xhr) {
+                  try {
+                    var err = $.parseJSON(xhr.responseText);
+                    if (err.success == 0) {
+                      alertify.error(err.errormsg);
+                    }
+                  } catch (e) {
+                    // Do nothing
+                  }
+                },
+              });
+            }
             return res;
-          }
+          },
         },
         /*
          * Text type control for viewing function name in properties and
@@ -227,7 +230,7 @@ define('pgadmin.node.cast', [
          */
         {
           id: 'proname', label: gettext('Function'), type: 'text',
-          group: gettext('Definition'), disabled: true, mode:['properties','edit']
+          group: gettext('Definition'), disabled: true, mode:['properties','edit'],
         },{
           id: 'castcontext', label: gettext('Context'),
           options:{'onText':'IMPLICIT','offText':'EXPLICIT'},
@@ -236,8 +239,8 @@ define('pgadmin.node.cast', [
           control: Backform.SwitchControl.extend({
             getValueFromDOM: function() {
               return this.$input.prop('checked') ? 'IMPLICIT' : 'EXPLICIT';
-            }
-          })
+            },
+          }),
         },
         /*
          * Text control for viewing context in properties and
@@ -246,25 +249,25 @@ define('pgadmin.node.cast', [
         {
           id: 'castcontext', label: gettext('Context'), disabled: true,
           options:[{
-            label: 'IMPLICIT', value: 'IMPLICIT'
+            label: 'IMPLICIT', value: 'IMPLICIT',
           },{
-            label: 'EXPLICIT', value: 'EXPLICIT'
+            label: 'EXPLICIT', value: 'EXPLICIT',
           },{
-            label: 'ASSIGNMENT', value: 'ASSIGNMENT'
+            label: 'ASSIGNMENT', value: 'ASSIGNMENT',
           }], editable: false, type: 'select2', group: gettext('Definition'),
-          mode:['properties', 'edit']
+          mode:['properties', 'edit'],
         },{
           id: 'syscast', label: gettext('System cast?'),
           cell: 'switch', type: 'switch', mode: ['properties'], disabled: true,
           options: {
             'onText': gettext('Yes'), 'offText': gettext('No'),
             'onColor': 'success', 'offColor': 'primary',
-            'size': 'small'
-          }
+            'size': 'small',
+          },
         },{
-          id: 'description', label: gettext('Comment'),type: 'text',
-          type: 'multiline', cellHeaderClasses: 'width_percent_50'
-        }
+          id: 'description', label: gettext('Comment'),
+          type: 'multiline', cellHeaderClasses: 'width_percent_50',
+        },
         ],
 
         /*
@@ -272,38 +275,41 @@ define('pgadmin.node.cast', [
          * target type if any one of them is not selected while creating
          * new cast
          */
-        validate: function(keys){
+        validate: function() {
 
-          var srctype = this.get('srctyp');
-          var trgtype = this.get('trgtyp');
+          var srctype = this.get('srctyp'),
+            trgtype = this.get('trgtyp'),
+            msg;
 
           // validate source type control
-          if (_.isUndefined(srctype) || _.isNull(srctype) || String(srctype).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Source type must be selected.');
+          if (
+            _.isUndefined(srctype) || _.isNull(srctype) ||
+              String(srctype).replace(/^\s+|\s+$/g, '') == ''
+          ) {
+            msg = gettext('Source type must be selected.');
             this.errorModel.set('srctyp', msg);
             return msg;
-          }
-          else
-          {
+          } else {
             this.errorModel.unset('srctyp');
           }
 
           // validate target type control
-          if (_.isUndefined(trgtype) || _.isNull(trgtype) || String(trgtype).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Target type must be selected.');
+          if (
+            _.isUndefined(trgtype) || _.isNull(trgtype) ||
+              String(trgtype).replace(/^\s+|\s+$/g, '') == ''
+          ) {
+            msg = gettext('Target type must be selected.');
             this.errorModel.set('trgtyp', msg);
             return msg;
-          }
-          else
-          {
+          } else {
             this.errorModel.unset('trgtyp');
           }
           this.trigger('on-status-clear');
           return null;
-        }
-      })
-  });
+        },
+      }),
+    });
 
   }
-    return pgBrowser.Nodes['coll-cast'];
+  return pgBrowser.Nodes['coll-cast'];
 });
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/static/js/event_trigger.js b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/static/js/event_trigger.js
index 5decd435..6218e479 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/static/js/event_trigger.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/static/js/event_trigger.js
@@ -1,19 +1,19 @@
 define('pgadmin.node.event_trigger', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
+  'pgadmin.backform', 'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform) {
 
   // Extend the browser's collection class for event trigger collection
   if (!pgBrowser.Nodes['coll-event_trigger']) {
-    var databases = pgAdmin.Browser.Nodes['coll-event_trigger'] =
+    pgAdmin.Browser.Nodes['coll-event_trigger'] =
       pgAdmin.Browser.Collection.extend({
         node: 'event_trigger',
         label: gettext('Event Trigger'),
         type: 'coll-event_trigger',
-        columns: ['name', 'eventowner', 'comment']
+        columns: ['name', 'eventowner', 'comment'],
       });
-  };
+  }
 
   // Extend the browser's node class for event triggers node
   if (!pgBrowser.Nodes['event_trigger']) {
@@ -30,7 +30,7 @@ define('pgadmin.node.event_trigger', [
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -38,19 +38,19 @@ define('pgadmin.node.event_trigger', [
           name: 'create_event_trigger_on_coll', node: 'coll-event_trigger', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Event Trigger...'),
-          icon: 'wcTabIcon icon-event_trigger', data: {action: 'create'}
+          icon: 'wcTabIcon icon-event_trigger', data: {action: 'create'},
         },{
           name: 'create_event_trigger', node: 'event_trigger', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Event Trigger...'),
-          icon: 'wcTabIcon icon-event_trigger', data: {action: 'create'}
+          icon: 'wcTabIcon icon-event_trigger', data: {action: 'create'},
         },{
           name: 'create_event_trigger', node: 'database', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Event Trigger...'),
           icon: 'wcTabIcon icon-event_trigger', data: {action: 'create'},
-          enable: pgBrowser.Nodes['database'].is_conn_allow
-        }
+          enable: pgBrowser.Nodes['database'].is_conn_allow,
+        },
         ]);
       },
       // Define the model for event trigger node
@@ -60,14 +60,14 @@ define('pgadmin.node.event_trigger', [
           name: undefined,
           eventowner: undefined,
           comment: undefined,
-          enabled: "O",
+          enabled: 'O',
           eventfuncoid: undefined,
           eventfunname: undefined,
-          eventname: "DDL_COMMAND_START",
+          eventname: 'DDL_COMMAND_START',
           when: undefined,
           xmin: undefined,
           source: undefined,
-          language: undefined
+          language: undefined,
         },
 
         // Default values!
@@ -85,46 +85,46 @@ define('pgadmin.node.event_trigger', [
         // Define the schema for the event trigger node
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text'
+          type: 'text',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text', mode: ['properties']
+          type: 'text', mode: ['properties'],
         },{
           id: 'eventowner', label: gettext('Owner'), cell: 'string',
           type: 'text', mode: ['properties', 'edit','create'], node: 'role',
-          control: Backform.NodeListByNameControl
+          control: Backform.NodeListByNameControl,
         },{
-          id: 'comment', label: gettext('Comment'), type: 'multiline'
+          id: 'comment', label: gettext('Comment'), type: 'multiline',
         },{
           id: 'enabled', label: gettext('Enabled status'),
-          type:"radio", group: gettext("Definition"), mode: ['properties', 'edit','create'],
+          type:'radio', group: gettext('Definition'), mode: ['properties', 'edit','create'],
           options: [
-            {label: "Enable", value: "O"},
-            {label: "Disable", value: "D"},
-            {label: "Replica", value: "R"},
-            {label: "Always", value: "A"}
-          ]
+            {label: 'Enable', value: 'O'},
+            {label: 'Disable', value: 'D'},
+            {label: 'Replica', value: 'R'},
+            {label: 'Always', value: 'A'},
+          ],
         },{
           id: 'eventfunname', label: gettext('Trigger function'),
-          type: 'text', control: 'node-ajax-options', group: gettext("Definition"),
-          url:'fopts', cache_node: 'trigger_function'
+          type: 'text', control: 'node-ajax-options', group: gettext('Definition'),
+          url:'fopts', cache_node: 'trigger_function',
         },{
           id: 'eventname', label: gettext('Events'),
-          type:"radio", group: gettext("Definition"), cell: 'string',
+          type:'radio', group: gettext('Definition'), cell: 'string',
           options: [
-            {label: "DDL COMMAND START", value: "DDL_COMMAND_START"},
-            {label: "DDL COMMAND END", value: "DDL_COMMAND_END"},
-            {label: "SQL DROP", value: "SQL_DROP"}
-          ]
+            {label: 'DDL COMMAND START', value: 'DDL_COMMAND_START'},
+            {label: 'DDL COMMAND END', value: 'DDL_COMMAND_END'},
+            {label: 'SQL DROP', value: 'SQL_DROP'},
+          ],
         },{
-          id: 'when', label: gettext('When'), type: 'multiline', group: gettext("Definition"),
+          id: 'when', label: gettext('When'), type: 'multiline', group: gettext('Definition'),
         },{
           id: 'seclabels', label: gettext('Security Labels'),
           model: pgBrowser.SecLabelModel, editable: false, type: 'collection',
           group: gettext('Security'), mode: ['edit', 'create'],
           min_version: 90200, canAdd: true,
-          canEdit: false, canDelete: true, control: 'unique-col-collection'
-         }
+          canEdit: false, canDelete: true, control: 'unique-col-collection',
+        },
         ],
         // event trigger model data validation.
         validate: function() {
@@ -166,9 +166,9 @@ define('pgadmin.node.event_trigger', [
           }
 
           return null;
-        }
-      })
-  });
+        },
+      }),
+    });
 
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/static/js/extension.js b/web/pgadmin/browser/server_groups/servers/databases/extensions/static/js/extension.js
index 9f59cc3d..94fc342c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/static/js/extension.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/static/js/extension.js
@@ -1,8 +1,8 @@
 define('pgadmin.node.extension', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
   'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
-  'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser) {
+  'pgadmin.backform', 'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform) {
 
   /*
    * Create and Add an Extension Collection into nodes
@@ -12,14 +12,14 @@ define('pgadmin.node.extension', [
    *   columns - List of columns to show under under properties.
    */
   if (!pgBrowser.Nodes['coll-extension']) {
-    var extensions = pgAdmin.Browser.Nodes['coll-extension'] =
+    pgAdmin.Browser.Nodes['coll-extension'] =
       pgAdmin.Browser.Collection.extend({
         node: 'extension',
         label: gettext('Extension'),
         type: 'coll-extension',
-        columns: ['name', 'owner', 'comment']
+        columns: ['name', 'owner', 'comment'],
       });
-  };
+  }
 
   /*
    * Create and Add an Extension Node into nodes
@@ -63,19 +63,19 @@ define('pgadmin.node.extension', [
           name: 'create_extension_on_coll', node: 'coll-extension', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Extension...'),
-          icon: 'wcTabIcon icon-extension', data: {action: 'create'}
+          icon: 'wcTabIcon icon-extension', data: {action: 'create'},
         },{
           name: 'create_extension', node: 'extension', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Extension...'),
-          icon: 'wcTabIcon icon-extension', data: {action: 'create'}
+          icon: 'wcTabIcon icon-extension', data: {action: 'create'},
         },{
           name: 'create_extension', node: 'database', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Extension...'),
           icon: 'wcTabIcon icon-extension', data: {action: 'create'},
-          enable: pgBrowser.Nodes['database'].is_conn_allow
-        }
+          enable: pgBrowser.Nodes['database'].is_conn_allow,
+        },
         ]);
       },
 
@@ -93,8 +93,8 @@ define('pgadmin.node.extension', [
             },
             transform: function(data, cell) {
               var res = [],
-                  control = cell || this,
-                  label = control.model.get('name');
+                control = cell || this,
+                label = control.model.get('name');
 
               if (!control.model.isNew()) {
                 res.push({label: label, value: label});
@@ -112,7 +112,7 @@ define('pgadmin.node.extension', [
                        * convert Array Object as [Object] string
                        */
                       res.push({label: d.name, value: JSON.stringify(d)});
-                  })
+                  });
                 }
               }
               return res;
@@ -128,7 +128,7 @@ define('pgadmin.node.extension', [
             control: Backform.NodeAjaxOptionsControl.extend({
               getValueFromDOM: function() {
                 var data = this.formatter.toRaw(
-                  _.unescape(this.$el.find("select").val()), this.model);
+                  _.unescape(this.$el.find('select').val()), this.model);
                 /*
                  * return null if data is empty to prevent it from
                  * throwing parsing error. Adds check as name can be empty
@@ -147,35 +147,37 @@ define('pgadmin.node.extension', [
                * set attributes values into the model
                */
               onChange: function() {
-                Backform.NodeAjaxOptionsControl.prototype.onChange.apply(this, arguments);
-                var selectedValue = this.$el.find("select").val();
-                if (selectedValue.trim() != "") {
+                Backform.NodeAjaxOptionsControl.prototype.onChange.apply(
+                  this, arguments
+                );
+                var selectedValue = this.$el.find('select').val();
+                if (selectedValue.trim() != '') {
                   var d = this.formatter.toRaw(selectedValue, this.model);
                   if(typeof(d) === 'string')
                     d=JSON.parse(d);
-                  var changes = {
+                  this.model.set({
                     'version' : '',
                     'relocatable': (
-                        (!_.isNull(d.relocatable[0]) && !_.isUndefined(d.relocatable[0])) ?
-                        d.relocatable[0]: '')
-                    };
-                  this.model.set(changes);
-                }
-                else {
-                  var changes = {'version': '', 'relocatable': true, 'schema': ''};
-                  this.model.set(changes);
+                      (!_.isNull(d.relocatable[0]) &&
+                        !_.isUndefined(d.relocatable[0])) ? d.relocatable[0]: ''
+                    ),
+                  });
+                } else {
+                  this.model.set({
+                    'version': '', 'relocatable': true, 'schema': '',
+                  });
                 }
               },
-            })
+            }),
           },
           {
             id: 'eid', label: gettext('OID'), cell: 'string',
-            type: 'text', disabled: true, mode: ['properties']
+            type: 'text', disabled: true, mode: ['properties'],
           },
           {
             id: 'owner', label: gettext('Owner'), control: 'node-list-by-name',
             mode: ['properties'], node: 'role', cell: 'string',
-            cache_level: 'server'
+            cache_level: 'server',
           },
           {
             id: 'schema', label: gettext('Schema'), type: 'text',
@@ -188,7 +190,7 @@ define('pgadmin.node.extension', [
                * attribute is True or False
                */
               return (m.has('relocatable') ? !m.get('relocatable') : false);
-            }
+            },
           },
           {
             id: 'relocatable', label: gettext('Relocatable?'), cell: 'switch',
@@ -196,8 +198,8 @@ define('pgadmin.node.extension', [
             options: {
               'onText': gettext('Yes'), 'offText': gettext('No'),
               'onColor': 'success', 'offColor': 'primary',
-              'size': 'small'
-            }
+              'size': 'small',
+            },
           },
           {
             id: 'version', label: gettext('Version'), cell: 'string',
@@ -207,8 +209,8 @@ define('pgadmin.node.extension', [
             // Transform the data into version for the selected extension.
             transform: function(data, cell) {
               var res = [],
-                  control = cell || this,
-                  extension = control.model.get('name');
+                control = cell || this,
+                extension = control.model.get('name');
 
               _.each(data, function(dt) {
                 if(dt.name == extension) {
@@ -220,12 +222,12 @@ define('pgadmin.node.extension', [
                 }
               });
               return res;
-            }
+            },
           },
           {
             id: 'comment', label: gettext('Comment'), cell: 'string',
-            type: 'multiline', disabled: true
-          }
+            type: 'multiline', disabled: true,
+          },
         ],
         validate: function() {
 
@@ -247,10 +249,10 @@ define('pgadmin.node.extension', [
             this.errorModel.unset('name');
           }
           return null;
-        }
-      })
-    })
-  };
+        },
+      }),
+    });
+  }
 
   return pgBrowser.Nodes['coll-extension'];
 });
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/static/js/foreign_server.js b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/static/js/foreign_server.js
index 32ffadb4..2548eb89 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/static/js/foreign_server.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/static/js/foreign_server.js
@@ -1,52 +1,52 @@
 define('pgadmin.node.foreign_server', [
   'sources/gettext', 'jquery', 'underscore', 'underscore.string', 'sources/pgadmin',
-  'pgadmin.browser', 'alertify', 'pgadmin.browser.collection',
-  'pgadmin.browser.server.privilege'
-], function(gettext, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'pgadmin.browser', 'pgadmin.backform', 'pgadmin.browser.collection',
+  'pgadmin.browser.server.privilege',
+], function(gettext, $, _, S, pgAdmin, pgBrowser, Backform) {
 
   // Extend the browser's node model class to create a Options model
   var OptionsModel = pgAdmin.Browser.Node.Model.extend({
-        idAttribute: 'fsrvoption',
-        defaults: {
-          fsrvoption: undefined,
-          fsrvvalue: undefined
-        },
+    idAttribute: 'fsrvoption',
+    defaults: {
+      fsrvoption: undefined,
+      fsrvvalue: undefined,
+    },
 
         // Defining schema for the Options model
-        schema: [
+    schema: [
           {id: 'fsrvoption', label: gettext('Options'), type:'text', cellHeaderClasses:'width_percent_50', group: null, editable: true},
           {id: 'fsrvvalue', label: gettext('Value'), type: 'text', cellHeaderClasses:'width_percent_50', group:null, editable: true},
-        ],
+    ],
 
         /* validate function is used to validate the input given by
          * the user. In case of error, message will be displayed on
          * the browser for the respective control.
          */
-        validate: function() {
+    validate: function() {
           // Validation for the option name
-          if (_.isUndefined(this.get('fsrvoption')) ||
+      if (_.isUndefined(this.get('fsrvoption')) ||
             _.isNull(this.get('fsrvoption')) ||
             String(this.get('fsrvoption')).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = 'Please enter an option name';
-            this.errorModel.set('fsrvoption', msg);
-            return msg;
-          } else {
-            this.errorModel.unset('fsrvoption');
-          }
-          return null;
-        }
-    });
+        var msg = 'Please enter an option name';
+        this.errorModel.set('fsrvoption', msg);
+        return msg;
+      } else {
+        this.errorModel.unset('fsrvoption');
+      }
+      return null;
+    },
+  });
 
   // Extend the browser's collection class for foreign server collection
   if (!pgBrowser.Nodes['coll-foreign_server']) {
-    var foreign_data_wrappers = pgAdmin.Browser.Nodes['coll-foreign_server'] =
+    pgAdmin.Browser.Nodes['coll-foreign_server'] =
       pgAdmin.Browser.Collection.extend({
         node: 'foreign_server',
         label: gettext('Foreign Servers'),
         type: 'coll-foreign_server',
-        columns: ['name','fsrvowner','description']
+        columns: ['name','fsrvowner','description'],
       });
-  };
+  }
 
   // Extend the browser's node class for foreign server node
   if (!pgBrowser.Nodes['foreign_server']) {
@@ -64,7 +64,7 @@ define('pgadmin.node.foreign_server', [
 
         // Avoid multiple registration of menus
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -75,18 +75,18 @@ define('pgadmin.node.foreign_server', [
           name: 'create_foreign_server_on_coll', node: 'coll-foreign_server', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Foreign Server...'),
-          icon: 'wcTabIcon icon-foreign_server', data: {action: 'create'}
+          icon: 'wcTabIcon icon-foreign_server', data: {action: 'create'},
         },{
           name: 'create_foreign_server', node: 'foreign_server', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Foreign Server...'),
-          icon: 'wcTabIcon icon-foreign_server', data: {action: 'create'}
+          icon: 'wcTabIcon icon-foreign_server', data: {action: 'create'},
         },{
           name: 'create_foreign_server', node: 'foreign_data_wrapper', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Foreign Server...'),
-          icon: 'wcTabIcon icon-foreign_server', data: {action: 'create'}
-        }
+          icon: 'wcTabIcon icon-foreign_server', data: {action: 'create'},
+        },
         ]);
       },
 
@@ -100,7 +100,7 @@ define('pgadmin.node.foreign_server', [
           fsrvoptions: [],
           fsrvowner: undefined,
           description: undefined,
-          fsrvacl: []
+          fsrvacl: [],
         },
 
         // Default values!
@@ -118,44 +118,42 @@ define('pgadmin.node.foreign_server', [
         // Defining schema for the foreign server node
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text', disabled: function(m) {
-            if (this.mode == 'edit' && this.node_info.server.version < 90200) {
-              return true;
-            }
-            else
-              return false;
-          }
+          type: 'text', disabled: function() {
+            return (
+              this.mode == 'edit' && this.node_info.server.version < 90200
+            );
+          },
         },{
           id: 'fsrvid', label: gettext('OID'), cell: 'string',
-          type: 'text', disabled: true, mode: ['properties']
+          type: 'text', disabled: true, mode: ['properties'],
         },{
           id: 'fsrvowner', label: gettext('Owner'), type: 'text',
           control: Backform.NodeListByNameControl, node: 'role',
-          mode: ['edit', 'create', 'properties'], select2: { allowClear: false }
+          mode: ['edit', 'create', 'properties'], select2: { allowClear: false },
         },{
           id: 'fsrvtype', label: gettext('Type'), cell: 'string',
           group: gettext('Definition'), type: 'text', mode: ['edit','create','properties'], disabled: function(m) {
             return !m.isNew();
-          }
+          },
         },{
           id: 'fsrvversion', label: gettext('Version'), cell: 'string',
-          group: gettext('Definition'), type: 'text'
+          group: gettext('Definition'), type: 'text',
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
-          type: 'multiline'
+          type: 'multiline',
         },{
-          id: 'fsrvoptions', label: gettext('Options'), type: 'collection', group: gettext("Options"),
+          id: 'fsrvoptions', label: gettext('Options'), type: 'collection', group: gettext('Options'),
           model: OptionsModel, control: 'unique-col-collection', mode: ['edit', 'create'],
           canAdd: true, canDelete: true, uniqueCol : ['fsrvoption'],
-          columns: ['fsrvoption','fsrvvalue']
-         }, pgBrowser.SecurityGroupSchema, {
-            id: 'fsrvacl', label: gettext('Privileges'), type: 'collection', group: 'security',
-            model: pgAdmin.Browser.Node.PrivilegeRoleModel.extend({privileges: ['U']}), control: 'unique-col-collection',
-            mode: ['edit', 'create'], canAdd: true, canDelete: true, uniqueCol : ['grantee']
-         },{
+          columns: ['fsrvoption','fsrvvalue'],
+        }, pgBrowser.SecurityGroupSchema, {
+          id: 'fsrvacl', label: gettext('Privileges'), type: 'collection', group: 'security',
+          model: pgAdmin.Browser.Node.PrivilegeRoleModel.extend({privileges: ['U']}), control: 'unique-col-collection',
+          mode: ['edit', 'create'], canAdd: true, canDelete: true, uniqueCol : ['grantee'],
+        },{
           id: 'acl', label: gettext('Privileges'), type: 'text',
-          group: gettext('Security'), mode: ['properties'], disabled: true
-         }
+          group: gettext('Security'), mode: ['properties'], disabled: true,
+        },
         ],
 
         /* validate function is used to validate the input given by
@@ -174,9 +172,9 @@ define('pgadmin.node.foreign_server', [
             this.errorModel.unset('name');
           }
           return null;
-        }
-      })
-  });
+        },
+      }),
+    });
 
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/static/js/user_mapping.js b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/static/js/user_mapping.js
index 7a0388b4..8f56e0ce 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/static/js/user_mapping.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/static/js/user_mapping.js
@@ -1,54 +1,55 @@
 define('pgadmin.node.user_mapping', [
-  'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'sources/pgadmin',
-  'pgadmin.browser', 'alertify', 'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
+  'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
+  'pgadmin.backform', 'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform) {
 
     // Extend the browser's node model class to create a Options model
-    var OptionsModel = pgAdmin.Browser.Node.Model.extend({
-       idAttribute: 'umoption',
-        defaults: {
-          umoption: undefined,
-          umvalue: undefined
-        },
+  var OptionsModel = pgAdmin.Browser.Node.Model.extend({
+    idAttribute: 'umoption',
+    defaults: {
+      umoption: undefined,
+      umvalue: undefined,
+    },
 
         // Defining schema for the Options model
-        schema: [{
-          id: 'umoption', label: gettext('Options'), type:'text',
-          cellHeaderClasses:'width_percent_50', group: null, editable: true
-        }, {
-          id: 'umvalue', label: gettext('Value'), type: 'text',
-          cellHeaderClasses:'width_percent_50', group:null, editable: true
-        }],
+    schema: [{
+      id: 'umoption', label: gettext('Options'), type:'text',
+      cellHeaderClasses:'width_percent_50', group: null, editable: true,
+    }, {
+      id: 'umvalue', label: gettext('Value'), type: 'text',
+      cellHeaderClasses:'width_percent_50', group:null, editable: true,
+    }],
 
         /* validate function is used to validate the input given by
          * the user. In case of error, message will be displayed on
          * the browser for the respective control.
          */
-        validate: function() {
+    validate: function() {
           // Validation for the option value
-          if (_.isUndefined(this.get('umoption')) ||
+      if (_.isUndefined(this.get('umoption')) ||
             _.isNull(this.get('umoption')) ||
             String(this.get('umoption')).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = 'Please enter an option name';
-            this.errorModel.set('umoption', msg);
-            return msg;
-          } else {
-            this.errorModel.unset('umoption');
-          }
-          return null;
-        }
-    });
+        var msg = 'Please enter an option name';
+        this.errorModel.set('umoption', msg);
+        return msg;
+      } else {
+        this.errorModel.unset('umoption');
+      }
+      return null;
+    },
+  });
 
   // Extend the browser's collection class for user mapping collection
   if (!pgBrowser.Nodes['coll-user_mapping']) {
-    var foreign_data_wrappers = pgAdmin.Browser.Nodes['coll-user_mapping'] =
+    pgAdmin.Browser.Nodes['coll-user_mapping'] =
       pgAdmin.Browser.Collection.extend({
         node: 'user_mapping',
         label: gettext('User Mappings'),
         type: 'coll-user_mapping',
-        columns: ['name']
+        columns: ['name'],
       });
-  };
+  }
 
   // Extend the browser's node class for user mapping node
   if (!pgBrowser.Nodes['user_mapping']) {
@@ -67,7 +68,7 @@ define('pgadmin.node.user_mapping', [
 
         // Avoid multiple registration of menus
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -78,18 +79,18 @@ define('pgadmin.node.user_mapping', [
           name: 'create_user_mapping_on_coll', node: 'coll-user_mapping', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('User Mapping...'),
-          icon: 'wcTabIcon icon-user_mapping', data: {action: 'create'}
+          icon: 'wcTabIcon icon-user_mapping', data: {action: 'create'},
         },{
           name: 'create_user_mapping', node: 'user_mapping', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('User Mapping...'),
-          icon: 'wcTabIcon icon-user_mapping', data: {action: 'create'}
+          icon: 'wcTabIcon icon-user_mapping', data: {action: 'create'},
         },{
           name: 'create_user_mapping', node: 'foreign_server', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('User Mapping...'),
-          icon: 'wcTabIcon icon-user_mapping', data: {action: 'create'}
-        }
+          icon: 'wcTabIcon icon-user_mapping', data: {action: 'create'},
+        },
         ]);
       },
 
@@ -97,7 +98,7 @@ define('pgadmin.node.user_mapping', [
       model: pgAdmin.Browser.Node.Model.extend({
         defaults: {
           name: undefined,
-          um_options: []
+          um_options: [],
         },
 
         // Default values!
@@ -118,25 +119,29 @@ define('pgadmin.node.user_mapping', [
           control: Backform.NodeListByNameControl, node: 'role',
           mode: ['edit', 'create', 'properties'], select2: { allowClear: false },
           disabled: function(m) { return !m.isNew(); },
-          transform: function(data) {
+          transform: function() {
             var self = this,
               node = self.field.get('schema_node');
             var res =
             Backform.NodeListByNameControl.prototype.defaults.transform.apply(
               this, arguments
             );
-            res.unshift({label: 'CURRENT_USER', value: 'CURRENT_USER', image: 'icon-' + node.type},
-                        {label: 'PUBLIC', value: 'PUBLIC', image: 'icon-' + node.type});
+            res.unshift({
+              label: 'CURRENT_USER', value: 'CURRENT_USER',
+              image: 'icon-' + node.type,
+            },{
+              label: 'PUBLIC', value: 'PUBLIC', image: 'icon-' + node.type,
+            });
             return res;
-         }
+          },
         },{
           id: 'um_oid', label: gettext('OID'), cell: 'string',
           type: 'text', disabled: true, mode: ['properties'],
         },{
-          id: 'umoptions', label: gettext('Options'), type: 'collection', group: gettext("Options"),
+          id: 'umoptions', label: gettext('Options'), type: 'collection', group: gettext('Options'),
           model: OptionsModel, control: 'unique-col-collection', mode: ['create', 'edit'],
-          canAdd: true, canDelete: true, uniqueCol : ['umoption']
-        }
+          canAdd: true, canDelete: true, uniqueCol : ['umoption'],
+        },
         ],
 
         /* validate function is used to validate the input given by
@@ -155,9 +160,9 @@ define('pgadmin.node.user_mapping', [
             this.errorModel.unset('name');
           }
           return null;
-        }
-      })
-  });
+        },
+      }),
+    });
 
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/static/js/foreign_data_wrapper.js b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/static/js/foreign_data_wrapper.js
index ef9d617a..f1ece969 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/static/js/foreign_data_wrapper.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/static/js/foreign_data_wrapper.js
@@ -1,53 +1,53 @@
 define('pgadmin.node.foreign_data_wrapper', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection', 'pgadmin.browser.server.privilege'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
+  'pgadmin.browser.collection', 'pgadmin.browser.server.privilege',
+], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform) {
 
     // Extend the browser's node model class to create a Options model
-    var OptionsModel = pgBrowser.Node.Model.extend({
-        idAttribute: 'fdwoption',
-        defaults: {
-          fdwoption: undefined,
-          fdwvalue: undefined
-        },
+  var OptionsModel = pgBrowser.Node.Model.extend({
+    idAttribute: 'fdwoption',
+    defaults: {
+      fdwoption: undefined,
+      fdwvalue: undefined,
+    },
         // Defining schema for the Options model
-        schema: [{
-          id: 'fdwoption', label: gettext('Option'), type:'text',
-          cellHeaderClasses:'width_percent_50', editable: true
-        },{
-          id: 'fdwvalue', label: gettext('Value'), type: 'text',
-          cellHeaderClasses:'width_percent_50', group:null, editable: true
-        }],
+    schema: [{
+      id: 'fdwoption', label: gettext('Option'), type:'text',
+      cellHeaderClasses:'width_percent_50', editable: true,
+    },{
+      id: 'fdwvalue', label: gettext('Value'), type: 'text',
+      cellHeaderClasses:'width_percent_50', group:null, editable: true,
+    }],
         /* validate function is used to validate the input given by
          * the user. In case of error, message will be displayed on
          * the browser for the respective control.
          */
-        validate: function() {
+    validate: function() {
           // Validation for the option name
-          if (_.isUndefined(this.get('fdwoption')) ||
+      if (_.isUndefined(this.get('fdwoption')) ||
             _.isNull(this.get('fdwoption')) ||
             String(this.get('fdwoption')).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = 'Please enter an option name';
-            this.errorModel.set('fdwoption', msg);
-            return msg;
-          } else {
-            this.errorModel.unset('fdwoption');
-          }
-          return null;
-        }
-    });
+        var msg = 'Please enter an option name';
+        this.errorModel.set('fdwoption', msg);
+        return msg;
+      } else {
+        this.errorModel.unset('fdwoption');
+      }
+      return null;
+    },
+  });
 
   // Extend the browser's collection class for foreign data wrapper collection
   if (!pgBrowser.Nodes['coll-foreign_data_wrapper']) {
-    var foreign_data_wrappers = pgBrowser.Nodes['coll-foreign_data_wrapper'] =
+    pgBrowser.Nodes['coll-foreign_data_wrapper'] =
       pgBrowser.Collection.extend({
         node: 'foreign_data_wrapper',
         label: gettext('Foreign Data Wrappers'),
         type: 'coll-foreign_data_wrapper',
-        columns: ['name','fdwowner','description']
+        columns: ['name','fdwowner','description'],
       });
-  };
+  }
 
   // Extend the browser's node class for foreign data wrapper node
   if (!pgBrowser.Nodes['foreign_data_wrapper']) {
@@ -66,7 +66,7 @@ define('pgadmin.node.foreign_data_wrapper', [
 
         // Avoid multiple registration of menus
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -77,19 +77,19 @@ define('pgadmin.node.foreign_data_wrapper', [
           name: 'create_foreign_data_wrapper_on_coll', node: 'coll-foreign_data_wrapper', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Foreign Data Wrapper...'),
-          icon: 'wcTabIcon icon-foreign_data_wrapper', data: {action: 'create'}
+          icon: 'wcTabIcon icon-foreign_data_wrapper', data: {action: 'create'},
         },{
           name: 'create_foreign_data_wrapper', node: 'foreign_data_wrapper', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Foreign Data Wrapper...'),
-          icon: 'wcTabIcon icon-foreign_data_wrapper', data: {action: 'create'}
+          icon: 'wcTabIcon icon-foreign_data_wrapper', data: {action: 'create'},
         },{
           name: 'create_foreign_data_wrapper', node: 'database', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Foreign Data Wrapper...'),
           icon: 'wcTabIcon icon-foreign_data_wrapper', data: {action: 'create'},
-          enable: pgBrowser.Nodes['database'].is_conn_allow
-        }
+          enable: pgBrowser.Nodes['database'].is_conn_allow,
+        },
         ]);
       },
 
@@ -102,7 +102,7 @@ define('pgadmin.node.foreign_data_wrapper', [
           fdwvalue: undefined,
           fdwhan: undefined,
           fdwoption: undefined,
-          fdwacl: []
+          fdwacl: [],
         },
 
         // Default values!
@@ -120,67 +120,64 @@ define('pgadmin.node.foreign_data_wrapper', [
         // Defining schema for the foreign data wrapper node
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text', disabled: function(m) {
-
+          type: 'text', disabled: function() {
             // name field will be disabled only if edit mode and server version is below 9.2
-            if (this.mode == 'edit' && this.node_info.server.version < 90200) {
-              return true;
-            }
-            else
-              return false;
-          }
+            return (
+              this.mode == 'edit' && this.node_info.server.version < 90200
+            );
+          },
         },{
           id: 'fdwoid', label: gettext('OID'), cell: 'string',
-          type: 'text', disabled: true, mode: ['properties']
+          type: 'text', disabled: true, mode: ['properties'],
         },{
           id: 'fdwowner', label: gettext('Owner'), type: 'text',
           control: Backform.NodeListByNameControl, node: 'role',
-          mode: ['edit', 'create', 'properties'], select2: { allowClear: false }
+          mode: ['edit', 'create', 'properties'], select2: { allowClear: false },
         },{
           id: 'fdwhan', label: gettext('Handler'), type: 'text', control: 'node-ajax-options',
-          group: gettext('Definition'), mode: ['edit', 'create', 'properties'], url:'get_handlers'
+          group: gettext('Definition'), mode: ['edit', 'create', 'properties'], url:'get_handlers',
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
-          type: 'multiline'
+          type: 'multiline',
         },{
           id: 'fdwoptions', label: gettext('Options'), type: 'collection', group: gettext('Options'),
           model: OptionsModel, control: 'unique-col-collection', mode: ['edit', 'create'],
           canAdd: true, canDelete: true, uniqueCol : ['fdwoption'],
-          columns: ['fdwoption','fdwvalue']
+          columns: ['fdwoption','fdwvalue'],
         },{
           id: 'fdwvalue', label: gettext('Validator'), type: 'text', control: 'node-ajax-options',
-          group: gettext('Definition'), mode: ['edit', 'create', 'properties'], url:'get_validators'
+          group: gettext('Definition'), mode: ['edit', 'create', 'properties'], url:'get_validators',
+        },{
+          id: 'security', label: gettext('Security'), type: 'group',
         },{
-          id: 'security', label: gettext('Security'), type: 'group'
+          id: 'fdwacl', label: gettext('Privileges'), type: 'collection',
+          group: 'security', mode: ['edit', 'create'], canAdd: true,
+          canDelete: true, uniqueCol : ['grantee'],
+          model: pgBrowser.Node.PrivilegeRoleModel.extend({
+            privileges: ['U'],
+          }), control: 'unique-col-collection',
         },{
-            id: 'fdwacl', label: gettext('Privileges'), type: 'collection',
-            group: 'security', mode: ['edit', 'create'], canAdd: true,
-            canDelete: true, uniqueCol : ['grantee'],
-            model: pgBrowser.Node.PrivilegeRoleModel.extend({
-              privileges: ['U']
-            }), control: 'unique-col-collection'
-         },{
           id: 'acl', label: gettext('Privileges'), type: 'text',
-          group: gettext('Security'), mode: ['properties'], disabled: true
-         }],
+          group: gettext('Security'), mode: ['properties'], disabled: true,
+        }],
          /* validate function is used to validate the input given by
           * the user. In case of error, message will be displayed on
           * the browser for the respective control.
           */
-         validate: function() {
-           var name = this.get('name');
+        validate: function() {
+          var name = this.get('name');
 
-           if (_.isUndefined(name) || _.isNull(name) ||
+          if (_.isUndefined(name) || _.isNull(name) ||
                String(name).replace(/^\s+|\s+$/g, '') == '') {
-                 var msg = gettext('Name cannot be empty.');
-                 this.errorModel.set('name', msg);
-                 return msg;
-               } else {
-                 this.errorModel.unset('name');
-               }
-               return null;
-         }
-      })
+            var msg = gettext('Name cannot be empty.');
+            this.errorModel.set('name', msg);
+            return msg;
+          } else {
+            this.errorModel.unset('name');
+          }
+          return null;
+        },
+      }),
     });
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/static/js/language.js b/web/pgadmin/browser/server_groups/servers/databases/languages/static/js/language.js
index 5bc53826..e0da4e0d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/languages/static/js/language.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/languages/static/js/language.js
@@ -1,19 +1,19 @@
 define('pgadmin.node.language', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection', 'pgadmin.browser.server.privilege'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
+  'pgadmin.browser.collection', 'pgadmin.browser.server.privilege',
+], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform) {
 
   // Extend the browser's collection class for languages collection
   if (!pgBrowser.Nodes['coll-language']) {
-    var languages = pgBrowser.Nodes['coll-language'] =
+    pgBrowser.Nodes['coll-language'] =
       pgBrowser.Collection.extend({
         node: 'language',
         label: gettext('Languages'),
         type: 'coll-language',
-        columns: ['name', 'lanowner', 'description']
+        columns: ['name', 'lanowner', 'description'],
       });
-  };
+  }
 
   // Extend the browser's node class for language node
   if (!pgBrowser.Nodes['language']) {
@@ -32,7 +32,7 @@ define('pgadmin.node.language', [
 
         // Avoid multiple registration of menus
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -43,17 +43,17 @@ define('pgadmin.node.language', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Language...'),
           icon: 'wcTabIcon icon-language', data: {action: 'create'},
-          enable: pgBrowser.Nodes['database'].is_conn_allow
+          enable: pgBrowser.Nodes['database'].is_conn_allow,
         },{
           name: 'create_language_on_coll', node: 'coll-language', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Language...'),
-          icon: 'wcTabIcon icon-language', data: {action: 'create'}
+          icon: 'wcTabIcon icon-language', data: {action: 'create'},
         },{
           name: 'create_language', node: 'language', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Language...'),
-          icon: 'wcTabIcon icon-language', data: {action: 'create'}
+          icon: 'wcTabIcon icon-language', data: {action: 'create'},
         }]);
       },
 
@@ -70,7 +70,7 @@ define('pgadmin.node.language', [
           laninl: undefined,
           lanval: undefined,
           is_template: false,
-          template_list: []
+          template_list: [],
         },
 
         // Default values!
@@ -91,8 +91,8 @@ define('pgadmin.node.language', [
           url:'get_templates', select2: { allowClear: false, tags: true, multiple: false },
           transform: function(data, cell) {
             var res = [],
-                control = cell || this,
-                label = control.model.get('name');
+              control = cell || this,
+              label = control.model.get('name');
 
             if (!control.model.isNew()) {
               res.push({label: label, value: label});
@@ -103,32 +103,32 @@ define('pgadmin.node.language', [
                 _.each(data, function(d) {
                   res.push({label: d.tmplname, value: d.tmplname});
                   tmp_list.push(d.tmplname);
-                })
+                });
               }
               this.model.set({'template_list': tmp_list});
             }
 
             return res;
-          }
+          },
         },{
           id: 'oid', label: gettext('OID'), cell: 'string', mode: ['properties'],
-          type: 'text', disabled: true
+          type: 'text', disabled: true,
         },{
           id: 'lanowner', label: gettext('Owner'), type: 'text',
           control: Backform.NodeListByNameControl, node: 'role',
-          mode: ['edit', 'properties', 'create'], select2: { allowClear: false }
+          mode: ['edit', 'properties', 'create'], select2: { allowClear: false },
         },{
           id: 'acl', label: gettext('Privileges'), type: 'text',
-          group: gettext('Security'), mode: ['properties'], disabled: true
+          group: gettext('Security'), mode: ['properties'], disabled: true,
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
-          type: 'multiline'
+          type: 'multiline',
         },{
           id: 'trusted', label: gettext('Trusted?'), type: 'switch',
           options: {
             'onText': gettext('Yes'), 'offText': gettext('No'),
             'onColor': 'success', 'offColor': 'primary',
-            'size': 'small'
+            'size': 'small',
           },
           group: gettext('Definition'), mode: ['edit', 'properties', 'create'], deps: ['name'],
           disabled: function(m) {
@@ -141,7 +141,7 @@ define('pgadmin.node.language', [
                 m.set({'is_template': true});
             }
             return true;
-          }
+          },
         },{
           id: 'lanproc', label: gettext('Handler Function'), type: 'text', control: 'node-ajax-options',
           group: gettext('Definition'), mode: ['edit', 'properties', 'create'], url:'get_functions',
@@ -157,7 +157,7 @@ define('pgadmin.node.language', [
                 if (d.prop_type == 'handler') {
                   res.push({label: d.label, value: d.label});
                 }
-              })
+              });
             }
             return res;
           }, disabled: function(m) {
@@ -166,7 +166,7 @@ define('pgadmin.node.language', [
                 return false;
             }
             return true;
-          }
+          },
         },{
           id: 'laninl', label: gettext('Inline Function'), type: 'text', control: 'node-ajax-options',
           group: gettext('Definition'), mode: ['edit', 'properties', 'create'], url:'get_functions',
@@ -182,7 +182,7 @@ define('pgadmin.node.language', [
                 if (d.prop_type == 'inline') {
                   res.push({label: d.label, value: d.label});
                 }
-              })
+              });
             }
             return res;
           }, disabled: function(m) {
@@ -191,7 +191,7 @@ define('pgadmin.node.language', [
                 return false;
             }
             return true;
-          }
+          },
         },{
           id: 'lanval', label: gettext('Validator Function'), type: 'text', control: 'node-ajax-options',
           group: gettext('Definition'), mode: ['edit', 'properties', 'create'], url:'get_functions',
@@ -203,11 +203,11 @@ define('pgadmin.node.language', [
           transform: function(data) {
             var res = [];
             if (data && _.isArray(data)) {
-                _.each(data, function(d) {
-                  if (d.prop_type == 'validator') {
-                    res.push({label: d.label, value: d.label});
-                  }
-                })
+              _.each(data, function(d) {
+                if (d.prop_type == 'validator') {
+                  res.push({label: d.label, value: d.label});
+                }
+              });
             }
             return res;
           }, disabled: function(m) {
@@ -216,31 +216,32 @@ define('pgadmin.node.language', [
                 return false;
             }
             return true;
-          }
+          },
         }, {
           id: 'lanacl', label: gettext('Privileges'), type: 'collection',
           group: 'security', control: 'unique-col-collection', mode: ['edit', 'create'],
           model: pgBrowser.Node.PrivilegeRoleModel.extend({
-            privileges: ['U']
-          }), canAdd: true, canDelete: true, uniqueCol : ['grantee']
-         },{
+            privileges: ['U'],
+          }), canAdd: true, canDelete: true, uniqueCol : ['grantee'],
+        },{
           id: 'seclabels', label: gettext('Security Labels'), mode: ['edit', 'create'],
           model: pgBrowser.SecLabelModel, editable: false,
           type: 'collection', group: 'security', min_version: 90200,
           canAdd: true, canEdit: false, canDelete: true,
-          control: 'unique-col-collection'
-        }
+          control: 'unique-col-collection',
+        },
         ],
         /* validate function is used to validate the input given by
          * the user. In case of error, message will be displayed on
          * the GUI for the respective control.
          */
         validate: function() {
-          var name = this.get('name');
+          var name = this.get('name'),
+            msg;
 
           if (_.isUndefined(name) || _.isNull(name) ||
             String(name).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Name cannot be empty.');
+            msg = gettext('Name cannot be empty.');
             this.errorModel.set('name', msg);
             return msg;
           } else {
@@ -252,7 +253,7 @@ define('pgadmin.node.language', [
             var handler_func = this.get('lanproc');
             if (_.isUndefined(handler_func) || _.isNull(handler_func) ||
               String(handler_func).replace(/^\s+|\s+$/g, '') == '') {
-              var msg = gettext('Handler Function cannot be empty.');
+              msg = gettext('Handler Function cannot be empty.');
               this.errorModel.set('lanproc', msg);
               return msg;
             } else {
@@ -261,9 +262,9 @@ define('pgadmin.node.language', [
           }
 
           return null;
-        }
-      })
-    })
+        },
+      }),
+    });
   }
   return pgBrowser.Nodes['coll-language'];
 });
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/catalog_objects/columns/static/js/catalog_object_column.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/catalog_objects/columns/static/js/catalog_object_column.js
index 4518505d..d7e30ebe 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/catalog_objects/columns/static/js/catalog_object_column.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/catalog_objects/columns/static/js/catalog_object_column.js
@@ -1,70 +1,70 @@
 define('pgadmin.node.catalog_object_column', [
   'sources/gettext', 'jquery', 'underscore', 'underscore.string', 'sources/pgadmin',
-  'pgadmin.browser', 'alertify', 'pgadmin.browser.collection'
-], function(gettext, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'pgadmin.browser', 'pgadmin.browser.collection',
+], function(gettext, $, _, S, pgAdmin, pgBrowser) {
 
   if (!pgBrowser.Nodes['coll-catalog_object_column']) {
-    var databases = pgAdmin.Browser.Nodes['coll-catalog_object_column'] =
+    pgAdmin.Browser.Nodes['coll-catalog_object_column'] =
       pgAdmin.Browser.Collection.extend({
         node: 'catalog_object_column',
         label: gettext('catalog_object_column'),
         type: 'coll-catalog_object_column',
-        columns: ['attname', 'attnum', 'cltype', 'description']
+        columns: ['attname', 'attnum', 'cltype', 'description'],
       });
-  };
+  }
 
   if (!pgBrowser.Nodes['catalog_object_column']) {
     pgAdmin.Browser.Nodes['catalog_object_column'] =
       pgAdmin.Browser.Node.extend({
-      parent_type: 'catalog_object',
-      type: 'catalog_object_column',
-      label: gettext('catalog_object_column'),
-      hasSQL:  false,
-      hasScriptTypes: [],
-      hasDepends: true,
-      Init: function() {
+        parent_type: 'catalog_object',
+        type: 'catalog_object_column',
+        label: gettext('catalog_object_column'),
+        hasSQL:  false,
+        hasScriptTypes: [],
+        hasDepends: true,
+        Init: function() {
         /* Avoid mulitple registration of menus */
-        if (this.initialized)
+          if (this.initialized)
             return;
 
-        this.initialized = true;
+          this.initialized = true;
 
-      },
-      model: pgAdmin.Browser.Node.Model.extend({
-        defaults: {
-          attname: undefined,
-          attowner: undefined,
-          atttypid: undefined,
-          attnum: undefined,
-          cltype: undefined,
-          collspcname: undefined,
-          attacl: undefined,
-          description: undefined
         },
-        schema: [{
-          id: 'attname', label: gettext('Column'), cell: 'string',
-          type: 'text', disabled: true
-        },{
-          id: 'attowner', label: gettext('Owner'), cell: 'string',
-          type: 'text', disabled: true
-        },{
-          id: 'attnum', label: gettext('Position'), cell: 'string',
-          type: 'text', disabled: true
-        },{
-          id: 'cltype', label: gettext('Data type'), cell: 'string',
-          group: gettext('Definition'), type: 'text', disabled: true
-        },{
-          id: 'collspcname', label: gettext('Collation'), cell: 'string',
-          group: gettext('Definition'), type: 'text', disabled: true
-        },{
-          id: 'attacl', label: gettext('Privileges'), cell: 'string',
-          group: gettext('Security'), type: 'text', disabled: true
-        },{
-          id: 'description', label: gettext('Comment'), cell: 'string',
-          type: 'multiline', disabled: true
-        }]
-      })
-    });
+        model: pgAdmin.Browser.Node.Model.extend({
+          defaults: {
+            attname: undefined,
+            attowner: undefined,
+            atttypid: undefined,
+            attnum: undefined,
+            cltype: undefined,
+            collspcname: undefined,
+            attacl: undefined,
+            description: undefined,
+          },
+          schema: [{
+            id: 'attname', label: gettext('Column'), cell: 'string',
+            type: 'text', disabled: true,
+          },{
+            id: 'attowner', label: gettext('Owner'), cell: 'string',
+            type: 'text', disabled: true,
+          },{
+            id: 'attnum', label: gettext('Position'), cell: 'string',
+            type: 'text', disabled: true,
+          },{
+            id: 'cltype', label: gettext('Data type'), cell: 'string',
+            group: gettext('Definition'), type: 'text', disabled: true,
+          },{
+            id: 'collspcname', label: gettext('Collation'), cell: 'string',
+            group: gettext('Definition'), type: 'text', disabled: true,
+          },{
+            id: 'attacl', label: gettext('Privileges'), cell: 'string',
+            group: gettext('Security'), type: 'text', disabled: true,
+          },{
+            id: 'description', label: gettext('Comment'), cell: 'string',
+            type: 'multiline', disabled: true,
+          }],
+        }),
+      });
   }
 
   return pgBrowser.Nodes['catalog_object_column'];
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/catalog_objects/static/js/catalog_object.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/catalog_objects/static/js/catalog_object.js
index dd94fffd..7107dcee 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/catalog_objects/static/js/catalog_object.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/catalog_objects/static/js/catalog_object.js
@@ -1,17 +1,17 @@
 define('pgadmin.node.catalog_object', [
   'sources/gettext', 'jquery', 'underscore', 'underscore.string', 'sources/pgadmin',
-  'pgadmin.browser', 'alertify', 'pgadmin.browser.collection'
-], function(gettext, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'pgadmin.browser', 'pgadmin.browser.collection',
+], function(gettext, $, _, S, pgAdmin, pgBrowser) {
 
   if (!pgBrowser.Nodes['coll-catalog_object']) {
-    var databases = pgAdmin.Browser.Nodes['coll-catalog_object'] =
+    pgAdmin.Browser.Nodes['coll-catalog_object'] =
       pgAdmin.Browser.Collection.extend({
         node: 'catalog_object',
         label: gettext('Catalog Objects'),
         type: 'coll-catalog_object',
-        columns: ['name', 'owner', 'description']
+        columns: ['name', 'owner', 'description'],
       });
-  };
+  }
 
   if (!pgBrowser.Nodes['catalog_object']) {
     pgAdmin.Browser.Nodes['catalog_object'] = pgAdmin.Browser.Node.extend({
@@ -24,7 +24,7 @@ define('pgadmin.node.catalog_object', [
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -38,20 +38,20 @@ define('pgadmin.node.catalog_object', [
         },
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text', disabled: true
+          type: 'text', disabled: true,
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text', disabled: true
+          type: 'text', disabled: true,
         },{
           id: 'owner', label: gettext('Owner'), cell: 'string',
-          type: 'text', disabled: true
+          type: 'text', disabled: true,
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
-          type: 'multiline' ,  disabled: true
-        }
-        ]
-      })
-  });
+          type: 'multiline' ,  disabled: true,
+        },
+        ],
+      }),
+    });
 
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/static/js/collation.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/static/js/collation.js
index 0d75eee6..9015d8d2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/static/js/collation.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/static/js/collation.js
@@ -1,18 +1,18 @@
 define('pgadmin.node.collation', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
+  'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser) {
 
   if (!pgBrowser.Nodes['coll-collation']) {
-    var databases = pgAdmin.Browser.Nodes['coll-collation'] =
+    pgAdmin.Browser.Nodes['coll-collation'] =
       pgAdmin.Browser.Collection.extend({
         node: 'collation',
         label: gettext('Collations'),
         type: 'coll-collation',
-        columns: ['name', 'owner', 'description']
+        columns: ['name', 'owner', 'description'],
       });
-  };
+  }
 
   if (!pgBrowser.Nodes['collation']) {
     pgAdmin.Browser.Nodes['collation'] = pgBrowser.Node.extend({
@@ -37,20 +37,20 @@ define('pgadmin.node.collation', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Collation...'),
           icon: 'wcTabIcon icon-collation', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_collation', node: 'collation', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Collation...'),
           icon: 'wcTabIcon icon-collation', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_collation', node: 'schema', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Collation...'),
           icon: 'wcTabIcon icon-collation', data: {action: 'create', check: false},
-          enable: 'canCreate'
-        }
+          enable: 'canCreate',
+        },
         ]);
 
       },
@@ -63,7 +63,7 @@ define('pgadmin.node.collation', [
           owner: undefined,
           lc_type: undefined,
           lc_collate: undefined,
-          description: undefined
+          description: undefined,
         },
 
         // Default values!
@@ -83,15 +83,15 @@ define('pgadmin.node.collation', [
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'],
-          disabled: 'inSchema'
+          disabled: 'inSchema',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text' , mode: ['properties']
+          type: 'text' , mode: ['properties'],
         },{
           id: 'owner', label: gettext('Owner'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'],
           disabled: 'inSchema', control: 'node-list-by-name',
-          node: 'role'
+          node: 'role',
         },{
           id: 'schema', label: gettext('Schema'), cell: 'string',
           type: 'text', mode: ['create', 'edit'], node: 'schema',
@@ -103,43 +103,42 @@ define('pgadmin.node.collation', [
             }
             return true;
           }, control: 'node-list-by-name',
-          cache_node: 'database', cached_level: 'database'
+          cache_node: 'database', cached_level: 'database',
         },{
           id: 'copy_collation', label: gettext('Copy collation'), cell: 'string',
           control: 'node-ajax-options',
           type: 'text', mode: ['create', 'edit'], group: gettext('Definition'),
           url: 'get_collations', disabled: 'inSchemaWithModelCheck',
-          deps: ['locale', 'lc_collate', 'lc_type']
+          deps: ['locale', 'lc_collate', 'lc_type'],
         },{
           id: 'locale', label: gettext('Locale'), cell: 'string',
           type: 'text', mode: ['create', 'edit'], group: gettext('Definition'),
           disabled: 'inSchemaWithModelCheck',
-          deps: ['lc_collate', 'lc_type', 'copy_collation']
+          deps: ['lc_collate', 'lc_type', 'copy_collation'],
         },{
           id: 'lc_collate', label: gettext('LC_COLLATE'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'], group: gettext('Definition'),
-          deps: ['locale', 'copy_collation'], disabled: 'inSchemaWithModelCheck'
+          deps: ['locale', 'copy_collation'], disabled: 'inSchemaWithModelCheck',
         },{
           id: 'lc_type', label: gettext('LC_TYPE'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'], group: gettext('Definition'),
           disabled: 'inSchemaWithModelCheck',
-          deps: ['locale', 'copy_collation']
+          deps: ['locale', 'copy_collation'],
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
           type: 'multiline', mode: ['properties', 'create', 'edit'],
-          disabled: 'inSchema'
-        }
+          disabled: 'inSchema',
+        },
         ],
         validate: function() {
           var err = {},
-          msg = undefined,
-          changedAttrs = this.changed,
-          locale_flag = false,
-          lc_type_flag = false,
-          lc_coll_flag = false,
-          copy_coll_flag = false,
-          msg = undefined,
-          data = this.toJSON();
+            msg = undefined,
+            changedAttrs = this.changed,
+            locale_flag = false,
+            lc_type_flag = false,
+            lc_coll_flag = false,
+            copy_coll_flag = false,
+            data = this.toJSON();
 
           this.errorModel.clear();
 
@@ -166,7 +165,7 @@ define('pgadmin.node.collation', [
           }
           if (locale_flag && (lc_coll_flag || lc_type_flag) && copy_coll_flag) {
             msg = gettext('Definition incomplete. Please provide Locale OR Copy Collation OR LC_TYPE/LC_COLLATE.');
-            err['locale'] = msg
+            err['locale'] = msg;
           }
           return null;
         },
@@ -183,12 +182,12 @@ define('pgadmin.node.collation', [
           if(this.node_info &&  'schema' in this.node_info)
           {
             // Enable copy_collation only if locale & lc_* is not provided
-            if (m.isNew() && this.name == "copy_collation")
+            if (m.isNew() && this.name == 'copy_collation')
             {
               if(m.get('locale'))
                 return true;
               if(m.get('lc_collate') || m.get('lc_type'))
-                return true
+                return true;
               return false;
             }
 
@@ -198,7 +197,7 @@ define('pgadmin.node.collation', [
               if(m.get('locale'))
                 return true;
               if(m.get('copy_collation'))
-                return true
+                return true;
               return false;
             }
 
@@ -208,7 +207,7 @@ define('pgadmin.node.collation', [
               if(m.get('lc_collate') || m.get('lc_type'))
                 return true;
               if(m.get('copy_collation'))
-                return true
+                return true;
               return false;
             }
 
@@ -221,37 +220,37 @@ define('pgadmin.node.collation', [
 
           }
           return true;
-        }
+        },
       }),
       canCreate: function(itemData, item, data) {
           //If check is false then , we will allow create menu
-          if (data && data.check == false)
-            return true;
+        if (data && data.check == false)
+          return true;
 
-          var t = pgBrowser.tree, i = item, d = itemData;
+        var t = pgBrowser.tree, i = item, d = itemData;
           // To iterate over tree to check parent node
-          while (i) {
+        while (i) {
             // If it is schema then allow user to create collation
-            if (_.indexOf(['schema'], d._type) > -1)
-              return true;
+          if (_.indexOf(['schema'], d._type) > -1)
+            return true;
 
-            if ('coll-collation' == d._type) {
+          if ('coll-collation' == d._type) {
               //Check if we are not child of catalog
-              var prev_i = t.hasParent(i) ? t.parent(i) : null,
-                prev_d = prev_i ? t.itemData(prev_i) : null;
-              if( prev_d._type == 'catalog') {
-                return false;
-              } else {
-                return true;
-              }
+            var prev_i = t.hasParent(i) ? t.parent(i) : null,
+              prev_d = prev_i ? t.itemData(prev_i) : null;
+            if( prev_d._type == 'catalog') {
+              return false;
+            } else {
+              return true;
             }
-            i = t.hasParent(i) ? t.parent(i) : null;
-            d = i ? t.itemData(i) : null;
           }
+          i = t.hasParent(i) ? t.parent(i) : null;
+          d = i ? t.itemData(i) : null;
+        }
           // by default we do not want to allow create menu
-          return true;
-      }
-  });
+        return true;
+      },
+    });
 
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/domain_constraints/static/js/domain_constraints.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/domain_constraints/static/js/domain_constraints.js
index 932b7bc2..9b3bba1f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/domain_constraints/static/js/domain_constraints.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/domain_constraints/static/js/domain_constraints.js
@@ -1,20 +1,20 @@
 // Domain Constraint Module: Collection and Node
 define('pgadmin.node.domain_constraints', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
+  'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser) {
 
   // Define Domain Constraint Collection Node
   if (!pgBrowser.Nodes['coll-domain_constraints']) {
-    var domain_constraints = pgAdmin.Browser.Nodes['coll-domain_constraints'] =
+    pgAdmin.Browser.Nodes['coll-domain_constraints'] =
       pgAdmin.Browser.Collection.extend({
         node: 'domain_constraints',
         label: gettext('Domain Constraints'),
         type: 'coll-domain_constraints',
-        columns: ['name', 'description']
+        columns: ['name', 'description'],
       });
-  };
+  }
 
   // Domain Constraint Node
   if (!pgBrowser.Nodes['domain_constraints']) {
@@ -31,7 +31,7 @@ define('pgadmin.node.domain_constraints', [
       Init: function() {
         // Avoid mulitple registration of menus
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -40,20 +40,20 @@ define('pgadmin.node.domain_constraints', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 5, label: gettext('Domain Constraint...'),
           icon: 'wcTabIcon icon-domain_constraints', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_domain_constraints', node: 'domain_constraints', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 5, label: gettext('Domain Constraint...'),
           icon: 'wcTabIcon icon-domain_constraints', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_domain_constraints', node: 'domain', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 5, label: gettext('Domain Constraint...'),
           icon: 'wcTabIcon icon-domain_constraints', data: {action: 'create', check: false},
-          enable: 'canCreate'
-        }
+          enable: 'canCreate',
+        },
         ]);
 
       },
@@ -65,48 +65,48 @@ define('pgadmin.node.domain_constraints', [
           description: undefined,
           consrc: undefined,
           connoinherit: undefined,
-          convalidated: true
+          convalidated: true,
         },
         // Domain Constraint Schema
         schema: [{
           id: 'name', label: gettext('Name'), type:'text', cell:'string',
-          disabled: 'isDisabled'
+          disabled: 'isDisabled',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text' , mode: ['properties']
+          type: 'text' , mode: ['properties'],
         },{
           id: 'description', label: gettext('Comment'), type: 'multiline', cell:
           'string', mode: ['properties', 'create', 'edit'], min_version: 90500,
         },{
           id: 'consrc', label: gettext('Check'), type: 'multiline', cel:
           'string', group: gettext('Definition'), mode: ['properties',
-          'create', 'edit'], disabled: function(m) { return !m.isNew(); }
+            'create', 'edit'], disabled: function(m) { return !m.isNew(); },
         },{
           id: 'connoinherit', label: gettext('No inherit'), type:
           'switch', cell: 'boolean', group: gettext('Definition'), mode:
           ['properties', 'create', 'edit'], disabled: 'isDisabled',
-          visible: false
+          visible: false,
         },{
-          id: 'convalidated', label: gettext("Validate?"), type: 'switch', cell:
+          id: 'convalidated', label: gettext('Validate?'), type: 'switch', cell:
           'boolean', group: gettext('Definition'), min_version: 90200,
           disabled: function(m) {
-          if (!m.isNew()) {
-            var server = this.node_info.server;
-            if (server.version < 90200) { return true;
-            }
-            else if(m.get('convalidated')) {
+            if (!m.isNew()) {
+              var server = this.node_info.server;
+              if (server.version < 90200) { return true;
+              }
+              else if(m.get('convalidated')) {
                 return true;
+              }
+              return false;
             }
             return false;
-          }
-          return false;
           },
-          mode: ['properties', 'create', 'edit']
+          mode: ['properties', 'create', 'edit'],
         }],
         // Client Side Validation
         validate: function() {
           var err = {},
-              errmsg;
+            errmsg;
 
           if (_.isUndefined(this.get('name')) || String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
             err['name'] = gettext('Name cannot be empty.');
@@ -137,7 +137,7 @@ define('pgadmin.node.domain_constraints', [
             }
           }
           return false;
-        }
+        },
       }),
     });
   }
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/static/js/domain.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/static/js/domain.js
index ebdef6b1..403ca471 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/static/js/domain.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/static/js/domain.js
@@ -1,26 +1,29 @@
 // Domain Module: Collection and Node.
 define('pgadmin.node.domain', [
-  'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'sources/pgadmin',
-  'pgadmin.browser', 'alertify', 'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform', 'pgadmin.backgrid',
+  'pgadmin.browser.collection',
+], function(
+  gettext, url_for, $, _, Backbone, pgAdmin, pgBrowser, Backform, Backgrid
+) {
 
   // Define Domain Collection Node
   if (!pgBrowser.Nodes['coll-domain']) {
-    var domains = pgBrowser.Nodes['coll-domain'] =
+    pgBrowser.Nodes['coll-domain'] =
       pgBrowser.Collection.extend({
         node: 'domain',
         label: gettext('Domains'),
         type: 'coll-domain',
-        columns: ['name', 'owner', 'description']
+        columns: ['name', 'owner', 'description'],
       });
-  };
+  }
 
   // Constraint Model
   var ConstraintModel = pgBrowser.Node.Model.extend({
     idAttribute: 'conoid',
-    initialize: function(attrs, args) {
+    initialize: function(attrs) {
       if (!_.size(attrs) === 0) {
-        this.convalidated_default = this.get('convalidated')
+        this.convalidated_default = this.get('convalidated');
       }
       pgBrowser.Node.Model.prototype.initialize.apply(this, arguments);
     },
@@ -28,11 +31,11 @@ define('pgadmin.node.domain', [
       conoid: undefined,
       conname: undefined,
       consrc: undefined,
-      convalidated: true
+      convalidated: true,
     },
     convalidated_default: true,
     schema: [{
-      id: 'conoid', type: 'text', cell: 'string', visible: false
+      id: 'conoid', type: 'text', cell: 'string', visible: false,
     },{
       id: 'conname', label: gettext('Name'), type: 'text', cell: 'string',
       cellHeaderClasses: 'width_percent_40',
@@ -44,13 +47,13 @@ define('pgadmin.node.domain', [
           }
         }
         return true;
-      }
+      },
     },{
       id: 'consrc', label: gettext('Check'), type: 'multiline',
       cell: Backgrid.Extension.TextareaCell, group: gettext('Definition'),
       cellHeaderClasses: 'width_percent_60', editable: function(m) {
         return _.isUndefined(m.isNew) ? true : m.isNew();
-      }
+      },
     },{
       id: 'convalidated', label: gettext('Validate?'), type: 'switch', cell:
       'boolean', group: gettext('Definition'),
@@ -66,12 +69,12 @@ define('pgadmin.node.domain', [
           return true;
         }
         return true;
-      }
+      },
     }],
     toJSON: Backbone.Model.prototype.toJSON,
     validate: function() {
       return null;
-    }
+    },
   });
 
   // Domain Node
@@ -89,7 +92,7 @@ define('pgadmin.node.domain', [
       Init: function() {
         // Avoid mulitple registration of menus
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -98,20 +101,20 @@ define('pgadmin.node.domain', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Domain...'),
           icon: 'wcTabIcon icon-domain', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_domain', node: 'domain', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Domain...'),
           icon: 'wcTabIcon icon-domain', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_domain', node: 'schema', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Domain...'),
           icon: 'wcTabIcon icon-domain', data: {action: 'create', check: false},
-          enable: 'canCreate'
-        }
+          enable: 'canCreate',
+        },
         ]);
 
       },
@@ -123,7 +126,7 @@ define('pgadmin.node.domain', [
           var isNew = (_.size(attrs) === 0);
           if (isNew) {
             // Set Selected Schema
-            var schema = args.node_info.schema.label
+            var schema = args.node_info.schema.label;
             this.set({'basensp': schema}, {silent: true});
 
             // Set Current User
@@ -146,34 +149,34 @@ define('pgadmin.node.domain', [
           sysdomain: undefined,
           collname: undefined,
           constraints: [],
-          seclabels: []
+          seclabels: [],
         },
         type_options: undefined,
         // Domain Schema
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text', mode: ['properties', 'create', 'edit']
+          type: 'text', mode: ['properties', 'create', 'edit'],
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text' , mode: ['properties']
+          type: 'text' , mode: ['properties'],
         },{
           id: 'owner', label: gettext('Owner'), cell: 'string', control: Backform.NodeListByNameControl,
-          node: 'role',  type: 'text', mode: ['edit', 'create', 'properties']
+          node: 'role',  type: 'text', mode: ['edit', 'create', 'properties'],
         },{
           id: 'basensp', label: gettext('Schema'), cell: 'node-list-by-name',
-           control: 'node-list-by-name', cache_level: 'database', type: 'text',
-           node: 'schema', mode: ['create', 'edit']
+          control: 'node-list-by-name', cache_level: 'database', type: 'text',
+          node: 'schema', mode: ['create', 'edit'],
         },{
           id: 'sysdomain', label: gettext('System domain?'), cell: 'boolean',
           type: 'switch', mode: ['properties'],
           options: {
             'onText': gettext('Yes'), 'offText': gettext('No'),
             'onColor': 'success', 'offColor': 'primary',
-            'size': 'small'
-          }
+            'size': 'small',
+          },
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
-          type: 'multiline'
+          type: 'multiline',
         },{
           id: 'basetype', label: gettext('Base type'), cell: 'string',
           control: 'node-ajax-options', type: 'text', url: 'get_types',
@@ -185,7 +188,7 @@ define('pgadmin.node.domain', [
           transform: function(d) {
             this.model.type_options =  d;
             return d;
-          }
+          },
         },{
           id: 'typlen', label: gettext('Length'), cell: 'string',
           type: 'text', group: gettext('Definition'), deps: ['basetype'],
@@ -201,18 +204,18 @@ define('pgadmin.node.domain', [
                 // if type from selected from combobox matches in options
                 if ( of_type == o.value ) {
                     // if length is allowed for selected type
-                    if(o.length)
+                  if(o.length)
                     {
                       // set the values in model
-                      m.set('is_tlength', true, {silent: true});
-                      m.set('min_val', o.min_val, {silent: true});
-                      m.set('max_val', o.max_val, {silent: true});
-                    }
+                    m.set('is_tlength', true, {silent: true});
+                    m.set('min_val', o.min_val, {silent: true});
+                    m.set('max_val', o.max_val, {silent: true});
+                  }
                 }
               });
             }
             return !m.get('is_tlength');
-          }
+          },
         },{
           id: 'precision', label: gettext('Precision'), cell: 'string',
           type: 'text', group: gettext('Definition'), deps: ['basetype'],
@@ -228,56 +231,55 @@ define('pgadmin.node.domain', [
                 // if type from selected from combobox matches in options
                 if ( of_type == o.value ) {
                     // if precession is allowed for selected type
-                    if(o.precision)
+                  if(o.precision)
                     {
                       // set the values in model
-                      m.set('is_precision', true, {silent: true});
-                      m.set('min_val', o.min_val, {silent: true});
-                      m.set('max_val', o.max_val, {silent: true});
-                    }
+                    m.set('is_precision', true, {silent: true});
+                    m.set('min_val', o.min_val, {silent: true});
+                    m.set('max_val', o.max_val, {silent: true});
+                  }
                 }
               });
             }
             return !m.get('is_precision');
-          }
+          },
         },{
           id: 'typdefault', label: gettext('Default'), cell: 'string',
           type: 'text', group: gettext('Definition'),
-          placeholder: "Enter an expression or a value."
+          placeholder: 'Enter an expression or a value.',
         },{
           id: 'typnotnull', label: gettext('Not Null?'), cell: 'boolean',
           type: 'switch', group: gettext('Definition'),
           options: {
             'onText': gettext('Yes'), 'offText': gettext('No'),
             'onColor': 'success', 'offColor': 'primary',
-            'size': 'small'
-          }
+            'size': 'small',
+          },
         },{
           id: 'collname', label: gettext('Collation'), cell: 'string',
           control: 'node-ajax-options', type: 'text', url: 'get_collations',
           group: gettext('Definition'), cache_level: 'database',
           cache_node: 'schema', disabled: function(m) {
             return !m.isNew();
-          }
+          },
         },{
           id: 'constraints', label: gettext('Constraints'), cell: 'string',
           type: 'collection', group: gettext('Constraints'), mode: ['edit', 'create'],
           model: ConstraintModel, canAdd: true, canDelete: true,
-          canEdit: false, columns: ['conname','consrc', 'convalidated']
+          canEdit: false, columns: ['conname','consrc', 'convalidated'],
         },
-        pgBrowser.SecurityGroupSchema,
+          pgBrowser.SecurityGroupSchema,
         {
           id: 'seclabels', label: gettext('Security Labels'),
           model: pgBrowser.SecLabelModel, type: 'collection',
           group: 'security', mode: ['edit', 'create'],
           min_version: 90100, canAdd: true,
           canEdit: false, canDelete: true,
-          control: 'unique-col-collection', uniqueCol : ['provider']
+          control: 'unique-col-collection', uniqueCol : ['provider'],
         }],
         validate: function() { // Client Side Validation
           var err = {},
-              errmsg,
-              seclabels = this.get('seclabels');
+            errmsg;
 
           if (_.isUndefined(this.get('name')) || String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
             err['name'] = gettext('Name cannot be empty.');
@@ -291,8 +293,8 @@ define('pgadmin.node.domain', [
 
           this.errorModel.clear().set(err);
 
-          return null;
-        }
+          return errmsg;
+        },
       }),
       canCreate: function(itemData, item, data) {
         //If check is false then , we will allow create menu
@@ -323,16 +325,16 @@ define('pgadmin.node.domain', [
         return true;
       },
       isDisabled: function(m){
-          if (!m.isNew()) {
-            var server = this.node_info.server;
-            if (server.version < 90200)
+        if (!m.isNew()) {
+          var server = this.node_info.server;
+          if (server.version < 90200)
             {
-              return false;
-            }
+            return false;
           }
-          return true;
         }
-  });
+        return true;
+      },
+    });
 
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.js
index a7ed1546..160db83f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.js
@@ -1,55 +1,34 @@
 /* Create and Register Foreign Table Collection and Node. */
 define('pgadmin.node.foreign_table', [
-  'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform', 'pgadmin.backgrid',
+  'pgadmin.browser.collection',
+], function(
+  gettext, url_for, $, _, Backbone, pgAdmin, pgBrowser, Backform, Backgrid
+) {
 
   if (!pgBrowser.Nodes['coll-foreign_table']) {
-    var foreigntable = pgBrowser.Nodes['coll-foreign_table'] =
+    pgBrowser.Nodes['coll-foreign_table'] =
       pgBrowser.Collection.extend({
         node: 'foreign_table',
         label: gettext('Foreign Tables'),
         type: 'coll-foreign_table',
-        columns: ['name', 'owner', 'description']
+        columns: ['name', 'owner', 'description'],
       });
-  };
-
-  // Integer Cell for Columns Length and Precision
-  var IntegerDepCell = Backgrid.IntegerCell.extend({
-      initialize: function() {
-        Backgrid.NumberCell.prototype.initialize.apply(this, arguments);
-        Backgrid.Extension.DependentCell.prototype.initialize.apply(this, arguments);
-      },
-      dependentChanged: function () {
-        this.$el.empty();
-        var model = this.model;
-        var column = this.column;
-        var editable = this.column.get("editable");
-        var is_editable = _.isFunction(editable) ? !!editable.apply(column, [model]) : !!editable;
-
-        if (is_editable){ this.$el.addClass("editable"); }
-        else { this.$el.removeClass("editable"); }
-
-        this.delegateEvents();
-        return this;
-      },
-      remove: Backgrid.Extension.DependentCell.prototype.remove
-    });
-
+  }
 
   // Options Model
   var ColumnOptionsModel = pgBrowser.Node.Model.extend({
     idAttribute: 'option',
     defaults: {
       option: undefined,
-      value: undefined
+      value: undefined,
     },
     schema: [
       {id: 'option', label: gettext('Option'), type:'text', editable: true, cellHeaderClasses: 'width_percent_30'},
       {
-        id: 'value', label: gettext('Value'), type: 'text', editable: true, cellHeaderClasses: 'width_percent_50'
-      }
+        id: 'value', label: gettext('Value'), type: 'text', editable: true, cellHeaderClasses: 'width_percent_50',
+      },
     ],
     validate: function() {
       if (_.isUndefined(this.get('value')) ||
@@ -65,7 +44,7 @@ define('pgadmin.node.foreign_table', [
       }
 
       return null;
-    }
+    },
   });
 
   // Columns Model
@@ -83,183 +62,183 @@ define('pgadmin.node.foreign_table', [
       inheritedfrom: undefined,
       inheritedid: undefined,
       attstattarget: undefined,
-      coloptions: []
+      coloptions: [],
     },
     type_options: undefined,
     schema: [{
-        id: 'attname', label: gettext('Name'), cell: 'string', type: 'text',
-        editable: 'is_editable_column', cellHeaderClasses: 'width_percent_40'
-      },{
-        id: 'datatype', label: gettext('Data Type'), cell: 'node-ajax-options',
-        control: 'node-ajax-options', type: 'text', url: 'get_types',
-        editable: 'is_editable_column', cellHeaderClasses: 'width_percent_0',
-        group: gettext('Definition'),
-        transform: function(d, self){
-            self.model.type_options = d;
-            return d;
-          }
-      },{
-        id: 'typlen', label: gettext('Length'),
-        cell: 'string', group: gettext('Definition'),
-        type: 'int', deps: ['datatype'],
-        disabled: function(m) {
-          var val = m.get('typlen');
+      id: 'attname', label: gettext('Name'), cell: 'string', type: 'text',
+      editable: 'is_editable_column', cellHeaderClasses: 'width_percent_40',
+    },{
+      id: 'datatype', label: gettext('Data Type'), cell: 'node-ajax-options',
+      control: 'node-ajax-options', type: 'text', url: 'get_types',
+      editable: 'is_editable_column', cellHeaderClasses: 'width_percent_0',
+      group: gettext('Definition'),
+      transform: function(d, self){
+        self.model.type_options = d;
+        return d;
+      },
+    },{
+      id: 'typlen', label: gettext('Length'),
+      cell: 'string', group: gettext('Definition'),
+      type: 'int', deps: ['datatype'],
+      disabled: function(m) {
+        var val = m.get('typlen');
           // We will store type from selected from combobox
-          if(!(_.isUndefined(m.get('inheritedid'))
+        if(!(_.isUndefined(m.get('inheritedid'))
             || _.isNull(m.get('inheritedid'))
             || _.isUndefined(m.get('inheritedfrom'))
             || _.isNull(m.get('inheritedfrom')))) {
 
-            if (!_.isUndefined(val)) {
-              setTimeout(function() {
-                m.set('typlen', undefined);
-              }, 10);
-            }
-            return true;
+          if (!_.isUndefined(val)) {
+            setTimeout(function() {
+              m.set('typlen', undefined);
+            }, 10);
           }
+          return true;
+        }
 
-          var of_type = m.get('datatype'),
-              has_length = false;
-          if(m.type_options) {
-            m.set('is_tlength', false, {silent: true});
+        var of_type = m.get('datatype'),
+          has_length = false;
+        if(m.type_options) {
+          m.set('is_tlength', false, {silent: true});
 
             // iterating over all the types
-            _.each(m.type_options, function(o) {
+          _.each(m.type_options, function(o) {
               // if type from selected from combobox matches in options
-              if ( of_type == o.value ) {
+            if ( of_type == o.value ) {
                 // if length is allowed for selected type
-                if(o.length)
+              if(o.length)
                 {
                   // set the values in model
-                  has_length = true;
-                  m.set('is_tlength', true, {silent: true});
-                  m.set('min_val', o.min_val, {silent: true});
-                  m.set('max_val', o.max_val, {silent: true});
-                }
+                has_length = true;
+                m.set('is_tlength', true, {silent: true});
+                m.set('min_val', o.min_val, {silent: true});
+                m.set('max_val', o.max_val, {silent: true});
               }
-            });
-
-            if (!has_length && !_.isUndefined(val)) {
-              setTimeout(function() {
-                m.set('typlen', undefined);
-              }, 10);
             }
+          });
 
-            return !(m.get('is_tlength'));
-          }
           if (!has_length && !_.isUndefined(val)) {
-              setTimeout(function() {
-                m.set('typlen', undefined);
-              }, 10);
-            }
-          return true;
-        },
-        cellHeaderClasses: 'width_percent_10'
-      },{
-        id: 'precision', label: gettext('Precision'),
-        type: 'int', deps: ['datatype'],
-        cell: 'string', group: gettext('Definition'),
-        disabled: function(m) {
-          var val = m.get('precision');
-          if(!(_.isUndefined(m.get('inheritedid'))
+            setTimeout(function() {
+              m.set('typlen', undefined);
+            }, 10);
+          }
+
+          return !(m.get('is_tlength'));
+        }
+        if (!has_length && !_.isUndefined(val)) {
+          setTimeout(function() {
+            m.set('typlen', undefined);
+          }, 10);
+        }
+        return true;
+      },
+      cellHeaderClasses: 'width_percent_10',
+    },{
+      id: 'precision', label: gettext('Precision'),
+      type: 'int', deps: ['datatype'],
+      cell: 'string', group: gettext('Definition'),
+      disabled: function(m) {
+        var val = m.get('precision');
+        if(!(_.isUndefined(m.get('inheritedid'))
             || _.isNull(m.get('inheritedid'))
             || _.isUndefined(m.get('inheritedfrom'))
             || _.isNull(m.get('inheritedfrom')))) {
 
-            if (!_.isUndefined(val)) {
-              setTimeout(function() {
-                m.set('precision', undefined);
-              }, 10);
-            }
-            return true;
+          if (!_.isUndefined(val)) {
+            setTimeout(function() {
+              m.set('precision', undefined);
+            }, 10);
           }
+          return true;
+        }
 
-          var of_type = m.get('datatype'),
-              has_precision = false;
+        var of_type = m.get('datatype'),
+          has_precision = false;
 
-          if(m.type_options) {
-             m.set('is_precision', false, {silent: true});
+        if(m.type_options) {
+          m.set('is_precision', false, {silent: true});
             // iterating over all the types
-            _.each(m.type_options, function(o) {
+          _.each(m.type_options, function(o) {
               // if type from selected from combobox matches in options
-              if ( of_type == o.value ) {
+            if ( of_type == o.value ) {
                 // if precession is allowed for selected type
-                if(o.precision)
+              if(o.precision)
                 {
-                  has_precision = true;
+                has_precision = true;
                   // set the values in model
-                  m.set('is_precision', true, {silent: true});
-                  m.set('min_val', o.min_val, {silent: true});
-                  m.set('max_val', o.max_val, {silent: true});
-                }
+                m.set('is_precision', true, {silent: true});
+                m.set('min_val', o.min_val, {silent: true});
+                m.set('max_val', o.max_val, {silent: true});
               }
-            });
-            if (!has_precision && !_.isUndefined(val)) {
-              setTimeout(function() {
-                m.set('precision', undefined);
-              }, 10);
             }
-            return !(m.get('is_precision'));
-          }
+          });
           if (!has_precision && !_.isUndefined(val)) {
             setTimeout(function() {
               m.set('precision', undefined);
             }, 10);
           }
-          return true;
-      }, cellHeaderClasses: 'width_percent_10'
-      },{
-        id: 'typdefault', label: gettext('Default'), type: 'text',
-        cell: 'string', min_version: 90300, group: gettext('Definition'),
-        placeholder: "Enter an expression or a value.",
-        cellHeaderClasses: 'width_percent_10',
-        editable: function(m) {
-          if(!(_.isUndefined(m.get('inheritedid'))
+          return !(m.get('is_precision'));
+        }
+        if (!has_precision && !_.isUndefined(val)) {
+          setTimeout(function() {
+            m.set('precision', undefined);
+          }, 10);
+        }
+        return true;
+      }, cellHeaderClasses: 'width_percent_10',
+    },{
+      id: 'typdefault', label: gettext('Default'), type: 'text',
+      cell: 'string', min_version: 90300, group: gettext('Definition'),
+      placeholder: 'Enter an expression or a value.',
+      cellHeaderClasses: 'width_percent_10',
+      editable: function(m) {
+        if(!(_.isUndefined(m.get('inheritedid'))
             || _.isNull(m.get('inheritedid'))
             || _.isUndefined(m.get('inheritedfrom'))
             || _.isNull(m.get('inheritedfrom')))) { return false; }
-          if (this.get('node_info').server.version < 90300){
-            return false;
-          }
-          return true;
+        if (this.get('node_info').server.version < 90300){
+          return false;
         }
-      },{
-        id: 'attnotnull', label: gettext('Not Null'),
-        cell: 'boolean',type: 'switch', editable: 'is_editable_column',
-        cellHeaderClasses: 'width_percent_10', group: gettext('Definition')
-      },{
-        id: 'attstattarget', label: gettext('Statistics'), min_version: 90200,
-        cell: 'integer', type: 'int', group: gettext('Definition'),
-        editable: function(m) {
-         if (_.isUndefined(m.isNew) || m.isNew()) { return false; }
-         if (this.get('node_info').server.version < 90200){
-            return false;
-         }
-         return (_.isUndefined(m.get('inheritedid')) || _.isNull(m.get('inheritedid'))
-          || _.isUndefined(m.get('inheritedfrom')) || _.isNull(m.get('inheritedfrom'))) ? true : false
-        }, cellHeaderClasses: 'width_percent_10'
-      },{
-        id: 'collname', label: gettext('Collation'), cell: 'node-ajax-options',
-        control: 'node-ajax-options', type: 'text', url: 'get_collations',
-        min_version: 90300, editable: function(m) {
-          if (!(_.isUndefined(m.isNew)) && !m.isNew()) { return false; }
-          return (_.isUndefined(m.get('inheritedid')) || _.isNull(m.get('inheritedid'))
-           || _.isUndefined(m.get('inheritedfrom')) || _.isNull(m.get('inheritedfrom'))) ? true : false
-        },
-        cellHeaderClasses: 'width_percent_20', group: gettext('Definition')
-      },{
-        id: 'attnum', cell: 'string',type: 'text', visible: false
-      },{
-        id: 'inheritedfrom', label: gettext('Inherited From'), cell: 'string',
-        type: 'text', visible: false, mode: ['properties', 'edit'],
-        cellHeaderClasses: 'width_percent_10'
-      },{
-          id: 'coloptions', label: gettext('Options'), cell: 'string',
-          type: 'collection', group: gettext('Options'), mode: ['edit', 'create'],
-          model: ColumnOptionsModel, canAdd: true, canDelete: true, canEdit: false,
-          control: Backform.UniqueColCollectionControl, uniqueCol : ['option'],
-          min_version: 90200
-      }],
+        return true;
+      },
+    },{
+      id: 'attnotnull', label: gettext('Not Null'),
+      cell: 'boolean',type: 'switch', editable: 'is_editable_column',
+      cellHeaderClasses: 'width_percent_10', group: gettext('Definition'),
+    },{
+      id: 'attstattarget', label: gettext('Statistics'), min_version: 90200,
+      cell: 'integer', type: 'int', group: gettext('Definition'),
+      editable: function(m) {
+        if (_.isUndefined(m.isNew) || m.isNew()) { return false; }
+        if (this.get('node_info').server.version < 90200){
+          return false;
+        }
+        return (_.isUndefined(m.get('inheritedid')) || _.isNull(m.get('inheritedid'))
+          || _.isUndefined(m.get('inheritedfrom')) || _.isNull(m.get('inheritedfrom'))) ? true : false;
+      }, cellHeaderClasses: 'width_percent_10',
+    },{
+      id: 'collname', label: gettext('Collation'), cell: 'node-ajax-options',
+      control: 'node-ajax-options', type: 'text', url: 'get_collations',
+      min_version: 90300, editable: function(m) {
+        if (!(_.isUndefined(m.isNew)) && !m.isNew()) { return false; }
+        return (_.isUndefined(m.get('inheritedid')) || _.isNull(m.get('inheritedid'))
+           || _.isUndefined(m.get('inheritedfrom')) || _.isNull(m.get('inheritedfrom'))) ? true : false;
+      },
+      cellHeaderClasses: 'width_percent_20', group: gettext('Definition'),
+    },{
+      id: 'attnum', cell: 'string',type: 'text', visible: false,
+    },{
+      id: 'inheritedfrom', label: gettext('Inherited From'), cell: 'string',
+      type: 'text', visible: false, mode: ['properties', 'edit'],
+      cellHeaderClasses: 'width_percent_10',
+    },{
+      id: 'coloptions', label: gettext('Options'), cell: 'string',
+      type: 'collection', group: gettext('Options'), mode: ['edit', 'create'],
+      model: ColumnOptionsModel, canAdd: true, canDelete: true, canEdit: false,
+      control: Backform.UniqueColCollectionControl, uniqueCol : ['option'],
+      min_version: 90200,
+    }],
     validate: function() {
       var errmsg = null;
 
@@ -282,9 +261,9 @@ define('pgadmin.node.foreign_table', [
     },
     is_editable_column: function(m) {
       return (_.isUndefined(m.get('inheritedid')) || _.isNull(m.get('inheritedid'))
-       || _.isUndefined(m.get('inheritedfrom')) || _.isNull(m.get('inheritedfrom'))) ? true : false
+       || _.isUndefined(m.get('inheritedfrom')) || _.isNull(m.get('inheritedfrom'))) ? true : false;
     },
-    toJSON: Backbone.Model.prototype.toJSON
+    toJSON: Backbone.Model.prototype.toJSON,
   });
 
 
@@ -295,16 +274,15 @@ define('pgadmin.node.foreign_table', [
   *  for the selected table.
   */
   var NodeAjaxOptionsMultipleControl = Backform.NodeAjaxOptionsControl.extend({
-    onChange: function(e) {
+    onChange: function() {
       var model = this.model,
-          $el = $(e.target),
-          attrArr = this.field.get("name").split('.'),
-          name = attrArr.shift(),
-          path = attrArr.join('.'),
-          value = this.getValueFromDOM(),
-          changes = {},
-          columns = model.get('columns'),
-          inherits = model.get(name);
+        attrArr = this.field.get('name').split('.'),
+        name = attrArr.shift(),
+        path = attrArr.join('.'),
+        value = this.getValueFromDOM(),
+        changes = {},
+        columns = model.get('columns'),
+        inherits = model.get(name);
 
       if (this.model.errorModel instanceof Backbone.Model) {
         if (_.isEmpty(path)) {
@@ -320,7 +298,7 @@ define('pgadmin.node.foreign_table', [
 
       var self = this;
 
-      if (typeof(inherits)  == "string"){ inherits = JSON.parse(inherits); }
+      if (typeof(inherits)  == 'string'){ inherits = JSON.parse(inherits); }
 
       // Remove Columns if inherit option is deselected from the combobox
       if(_.size(value) < _.size(inherits)) {
@@ -341,30 +319,30 @@ define('pgadmin.node.foreign_table', [
       }
 
       changes[name] = _.isEmpty(path) ? value : _.clone(model.get(name)) || {};
-      this.stopListening(this.model, "change:" + name, this.render);
+      this.stopListening(this.model, 'change:' + name, this.render);
       model.set(changes);
-      this.listenTo(this.model, "change:" + name, this.render);
+      this.listenTo(this.model, 'change:' + name, this.render);
     },
     fetchColumns: function(table_id){
       var self = this,
-          url = 'get_columns',
-          m = self.model.top || self.model;
+        url = 'get_columns',
+        m = self.model.top || self.model;
 
       if (url) {
         var node = this.field.get('schema_node'),
-            node_info = this.field.get('node_info'),
-            full_url = node.generate_url.apply(
+          node_info = this.field.get('node_info'),
+          full_url = node.generate_url.apply(
               node, [
                 null, url, this.field.get('node_data'),
-                this.field.get('url_with_id') || false, node_info
+                this.field.get('url_with_id') || false, node_info,
               ]),
-            cache_level = this.field.get('cache_level') || node.type,
-            cache_node = this.field.get('cache_node');
+          cache_level = this.field.get('cache_level') || node.type,
+          cache_node = this.field.get('cache_node');
 
         cache_node = (cache_node && pgBrowser.Nodes['cache_node']) || node;
 
         m.trigger('pgadmin:view:fetching', m, self.field);
-        var data = {attrelid: table_id}
+        var data = {attrelid: table_id};
 
         // Fetching Columns data for the selected table.
         $.ajax({
@@ -381,7 +359,7 @@ define('pgadmin.node.foreign_table', [
           },
           error: function() {
             m.trigger('pgadmin:view:fetch:error', m, self.field);
-          }
+          },
         });
         m.trigger('pgadmin:view:fetched', m, self.field);
 
@@ -399,10 +377,10 @@ define('pgadmin.node.foreign_table', [
   // Constraints Model
   var ConstraintModel = pgBrowser.Node.Model.extend({
     idAttribute: 'conoid',
-    initialize: function(attrs, args) {
+    initialize: function(attrs) {
       var isNew = (_.size(attrs) === 0);
       if (!isNew) {
-        this.convalidated_default = this.get('convalidated')
+        this.convalidated_default = this.get('convalidated');
       }
       pgBrowser.Node.Model.prototype.initialize.apply(this, arguments);
     },
@@ -412,27 +390,26 @@ define('pgadmin.node.foreign_table', [
       consrc: undefined,
       connoinherit: undefined,
       convalidated: true,
-      conislocal: undefined
+      conislocal: undefined,
     },
     convalidated_default: true,
     schema: [{
-      id: 'conoid', type: 'text', cell: 'string', visible: false
+      id: 'conoid', type: 'text', cell: 'string', visible: false,
     },{
       id: 'conname', label: gettext('Name'), type: 'text', cell: 'string',
-      editable: 'is_editable', cellHeaderClasses: 'width_percent_30'
+      editable: 'is_editable', cellHeaderClasses: 'width_percent_30',
     },{
       id: 'consrc', label: gettext('Check'), type: 'multiline',
       editable: 'is_editable', cell: Backgrid.Extension.TextareaCell,
-      cellHeaderClasses: 'width_percent_30'
+      cellHeaderClasses: 'width_percent_30',
     },{
       id: 'connoinherit', label: gettext('No Inherit'), type: 'switch',
       cell: 'boolean', editable: 'is_editable',
-      cellHeaderClasses: 'width_percent_20'
+      cellHeaderClasses: 'width_percent_20',
     },{
       id: 'convalidated', label: gettext('Validate?'), type: 'switch',
       cell: 'boolean', cellHeaderClasses: 'width_percent_20',
       editable: function(m) {
-        var server = this.get('node_info').server;
         if (_.isUndefined(m.isNew)) { return true; }
         if (!m.isNew()) {
           if(m.get('convalidated') && m.convalidated_default) {
@@ -441,12 +418,12 @@ define('pgadmin.node.foreign_table', [
           return true;
         }
         return true;
-      }
-     }
+      },
+    },
     ],
     validate: function() {
       var err = {},
-      errmsg;
+        errmsg;
 
       if (_.isUndefined(this.get('conname')) || String(this.get('conname')).replace(/^\s+|\s+$/g, '') == '') {
         err['conname'] = gettext('Constraint Name cannot be empty.');
@@ -464,9 +441,9 @@ define('pgadmin.node.foreign_table', [
       return errmsg;
     },
     is_editable: function(m) {
-        return _.isUndefined(m.isNew) ? true : m.isNew();
+      return _.isUndefined(m.isNew) ? true : m.isNew();
     },
-    toJSON: Backbone.Model.prototype.toJSON
+    toJSON: Backbone.Model.prototype.toJSON,
   });
 
 
@@ -474,20 +451,20 @@ define('pgadmin.node.foreign_table', [
   var OptionsModel = pgBrowser.Node.Model.extend({
     defaults: {
       option: undefined,
-      value: undefined
+      value: undefined,
     },
     schema: [{
       id: 'option', label: gettext('Option'), cell: 'string', type: 'text',
-      editable: true, cellHeaderClasses:'width_percent_50'
+      editable: true, cellHeaderClasses:'width_percent_50',
     },{
       id: 'value', label: gettext('Value'), cell: 'string',type: 'text',
-      editable: true, cellHeaderClasses:'width_percent_50'
-    }
+      editable: true, cellHeaderClasses:'width_percent_50',
+    },
     ],
     validate: function() {
       // TODO: Add validation here
     },
-    toJSON: Backbone.Model.prototype.toJSON
+    toJSON: Backbone.Model.prototype.toJSON,
   });
 
 
@@ -506,7 +483,7 @@ define('pgadmin.node.foreign_table', [
       Init: function() {
         /* Avoid multiple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -515,20 +492,20 @@ define('pgadmin.node.foreign_table', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Foreign Table...'),
           icon: 'wcTabIcon icon-foreign_table', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_foreign_table', node: 'foreign_table', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Foreign Table...'),
           icon: 'wcTabIcon icon-foreign_table', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_foreign_table', node: 'schema', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Foreign Table...'),
           icon: 'wcTabIcon icon-foreign_table', data: {action: 'create', check: false},
-          enable: 'canCreate'
-        }
+          enable: 'canCreate',
+        },
         ]);
 
       },
@@ -539,11 +516,11 @@ define('pgadmin.node.foreign_table', [
           var isNew = (_.size(attrs) === 0);
           if (isNew) {
             var schema = args.node_info.schema._label,
-                userInfo = pgBrowser.serverInfo[args.node_info.server._id].user;
+              userInfo = pgBrowser.serverInfo[args.node_info.server._id].user;
 
             // Set Selected Schema and Current User
             this.set({
-              'basensp': schema, 'owner': userInfo.name
+              'basensp': schema, 'owner': userInfo.name,
             }, {silent: true});
           }
           pgBrowser.Node.Model.prototype.initialize.apply(this, arguments);
@@ -562,34 +539,34 @@ define('pgadmin.node.foreign_table', [
           ftoptions: [],
           relacl: [],
           stracl: [],
-          seclabels: []
+          seclabels: [],
         },
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text', mode: ['properties', 'create', 'edit']
+          type: 'text', mode: ['properties', 'create', 'edit'],
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text' , mode: ['properties']
+          type: 'text' , mode: ['properties'],
         },{
           id: 'owner', label: gettext('Owner'), cell: 'string',
           control: Backform.NodeListByNameControl,
-          node: 'role',  type: 'text', select2: { allowClear: false }
+          node: 'role',  type: 'text', select2: { allowClear: false },
         },{
           id: 'basensp', label: gettext('Schema'), cell: 'node-list-by-name',
-           control: 'node-list-by-name', cache_level: 'database', type: 'text',
-           node: 'schema', mode:['create', 'edit']
+          control: 'node-list-by-name', cache_level: 'database', type: 'text',
+          node: 'schema', mode:['create', 'edit'],
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
-          type: 'multiline'
+          type: 'multiline',
         },{
           id: 'ftsrvname', label: gettext('Foreign server'), cell: 'string', control: 'node-ajax-options',
-          type: 'text', group: gettext('Definition'), url: 'get_foreign_servers', disabled: function(m) { return !m.isNew(); }
+          type: 'text', group: gettext('Definition'), url: 'get_foreign_servers', disabled: function(m) { return !m.isNew(); },
         },{
           id: 'inherits', label: gettext('Inherits'), group: gettext('Definition'),
           type: 'array', min_version: 90500, control: NodeAjaxOptionsMultipleControl,
           url: 'get_tables', select2: {multiple: true},
           'cache_level': 'database',
-          transform: function(d, self){
+          transform: function(d) {
             if (this.field.get('mode') == 'edit') {
               var oid = this.model.get('oid');
               var s = _.findWhere(d, {'id': oid});
@@ -598,7 +575,7 @@ define('pgadmin.node.foreign_table', [
               }
             }
             return d;
-          }
+          },
         },{
           id: 'columns', label: gettext('Columns'), cell: 'string',
           type: 'collection', group: gettext('Columns'), mode: ['edit', 'create'],
@@ -606,12 +583,12 @@ define('pgadmin.node.foreign_table', [
           columns: ['attname', 'datatype', 'inheritedfrom'],
           canDeleteRow: function(m) {
             return (_.isUndefined(m.get('inheritedid')) || _.isNull(m.get('inheritedid'))
-              || _.isUndefined(m.get('inheritedfrom')) || _.isNull(m.get('inheritedfrom'))) ? true : false
+              || _.isUndefined(m.get('inheritedfrom')) || _.isNull(m.get('inheritedfrom'))) ? true : false;
           },
           canEditRow: function(m) {
             return (_.isUndefined(m.get('inheritedid')) || _.isNull(m.get('inheritedid'))
-              || _.isUndefined(m.get('inheritedfrom')) || _.isNull(m.get('inheritedfrom'))) ? true : false
-          }
+              || _.isUndefined(m.get('inheritedfrom')) || _.isNull(m.get('inheritedfrom'))) ? true : false;
+          },
         },
         {
           id: 'constraints', label: gettext('Constraints'), cell: 'string',
@@ -625,20 +602,20 @@ define('pgadmin.node.foreign_table', [
             }
             return true;
           }, min_version: 90500, canDeleteRow: function(m) {
-            return (m.get('conislocal') == true || _.isUndefined(m.get('conislocal'))) ? true : false
-          }
+            return (m.get('conislocal') == true || _.isUndefined(m.get('conislocal'))) ? true : false;
+          },
         },{
           id: 'strftoptions', label: gettext('Options'), cell: 'string',
-          type: 'text', group: gettext('Definition'), mode: ['properties']
+          type: 'text', group: gettext('Definition'), mode: ['properties'],
         },{
           id: 'ftoptions', label: gettext('Options'), cell: 'string',
           type: 'collection', group: gettext('Options'), mode: ['edit', 'create'],
           model: OptionsModel, canAdd: true, canDelete: true, canEdit: false,
-          control: 'unique-col-collection', uniqueCol : ['option']
+          control: 'unique-col-collection', uniqueCol : ['option'],
         },{
           id: 'relacl', label: gettext('Privileges'), cell: 'string',
           type: 'text', group: gettext('Security'),
-          mode: ['properties'], min_version: 90200
+          mode: ['properties'], min_version: 90200,
         }, pgBrowser.SecurityGroupSchema, {
           id: 'acl', label: gettext('Privileges'), model: pgAdmin
           .Browser.Node.PrivilegeRoleModel.extend(
@@ -646,21 +623,20 @@ define('pgadmin.node.foreign_table', [
           editable: false, type: 'collection', group: 'security',
           mode: ['edit', 'create'],
           canAdd: true, canDelete: true, control: 'unique-col-collection',
-          min_version: 90200
+          min_version: 90200,
         },{
           id: 'seclabels', label: gettext('Security Labels'),
           model: pgBrowser.SecLabelModel, type: 'collection',
           group: 'security', mode: ['edit', 'create'],
           min_version: 90100, canAdd: true,
           canEdit: false, canDelete: true,
-          control: 'unique-col-collection', uniqueCol : ['provider']
-        }
+          control: 'unique-col-collection', uniqueCol : ['provider'],
+        },
         ],
         validate: function()
         {
           var err = {},
-              errmsg,
-              seclabels = this.get('seclabels');
+            errmsg = null;
 
           if (_.isUndefined(this.get('name')) || String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
             err['name'] = gettext('Name cannot be empty.');
@@ -680,8 +656,8 @@ define('pgadmin.node.foreign_table', [
 
           this.errorModel.clear().set(err);
 
-          return null;
-        }
+          return errmsg;
+        },
       }),
       canCreate: function(itemData, item, data) {
         //If check is false then , we will allow create menu
@@ -710,8 +686,8 @@ define('pgadmin.node.foreign_table', [
         }
         // by default we do not want to allow create menu
         return true;
-      }
-  });
+      },
+    });
 
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.js
index 7e266cba..89806681 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.js
@@ -1,65 +1,65 @@
 define('pgadmin.node.fts_configuration', [
-  'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform', 'pgadmin.backgrid',
+  'pgadmin.browser.collection',
+], function(
+  gettext, url_for, $, _, Backbone, pgAdmin, pgBrowser, Backform, Backgrid
+) {
 
   // Model for tokens control
   var TokenModel = pgAdmin.Browser.Node.Model.extend({
-        defaults: {
-          token: undefined,
-          dictname: undefined
-        },
-        keys: ['token'],
+    defaults: {
+      token: undefined,
+      dictname: undefined,
+    },
+    keys: ['token'],
         // Define the schema for the token/dictionary list
-        schema: [{
-          id: 'token', label: gettext('Token'), type:'text', group: null,
-          cellHeaderClasses:'width_percent_50',
-          editable: false, cell: 'string', url: 'tokens'
-        },{
-          id: 'dictname', label: gettext('Dictionaries'), type: 'text', group:null,
-          cellHeaderClasses:'width_percent_50', editable: true,
-          cell:Backgrid.Extension.MultiSelectAjaxCell, url: 'dictionaries'
-        }],
+    schema: [{
+      id: 'token', label: gettext('Token'), type:'text', group: null,
+      cellHeaderClasses:'width_percent_50',
+      editable: false, cell: 'string', url: 'tokens',
+    },{
+      id: 'dictname', label: gettext('Dictionaries'), type: 'text', group:null,
+      cellHeaderClasses:'width_percent_50', editable: true,
+      cell:Backgrid.Extension.MultiSelectAjaxCell, url: 'dictionaries',
+    }],
         // Validation for token and dictionary list
-        validate: function() {
+    validate: function() {
             // Clear any existing errors.
-          var msg;
-          this.errorModel.clear();
-          var token = this.get('token');
-          var dictionary = this.get('dictname');
+      var msg;
+      this.errorModel.clear();
+      var token = this.get('token');
+      var dictionary = this.get('dictname');
 
-          if (_.isNull(token) ||
+      if (_.isNull(token) ||
               _.isUndefined(token) ||
               String(token).replace(/^\s+|\s+$/g, '') == '') {
-            msg = gettext('Token cannot be empty.');
-            this.errorModel.set('token',msg);
-            return msg;
-          }
+        msg = gettext('Token cannot be empty.');
+        this.errorModel.set('token',msg);
+        return msg;
+      }
 
-          if (_.isNull(dictionary) ||
+      if (_.isNull(dictionary) ||
               _.isUndefined(dictionary) ||
               String(dictionary).replace(/^\s+|\s+$/g, '') == '') {
-            msg = gettext('Dictionary name cannot be empty.');
-            this.errorModel.set('dictname',msg);
-            return msg;
-          }
-          return null;
-        }
+        msg = gettext('Dictionary name cannot be empty.');
+        this.errorModel.set('dictname',msg);
+        return msg;
+      }
+      return null;
+    },
   });
 
 // Customized control for token control
   var TokenControl =  Backform.TokenControl =
     Backform.UniqueColCollectionControl.extend({
 
-    initialize: function(opts) {
-      Backform.UniqueColCollectionControl.prototype.initialize.apply(
+      initialize: function() {
+        Backform.UniqueColCollectionControl.prototype.initialize.apply(
         this, arguments
       );
 
-      var that;
-      var self = that = this,
-          node = 'fts_configuration',
+        var self = this,
           headerSchema = [{
             id: 'token', label:'', type:'text', url: 'tokens',
             node:'fts_configuration', canAdd: true, 'url_with_id': true,
@@ -76,11 +76,10 @@ define('pgadmin.node.fts_configuration', [
                   url = self.field.get('url') || self.defaults.url,
                   m = self.model.top || self.model;
 
-                /* Fetch the tokens/dict list from 'that' node.
-                 * Here 'that' refers to unique collection control where
+                /* Fetch the tokens/dict list from 'self' node.
+                 * Here 'self' refers to unique collection control where
                  * 'self' refers to nodeAjaxOptions control for dictionary
                  */
-                var cfgid = that.model.get('oid');
                 if (url) {
                   var node = this.field.get('schema_node'),
                     node_info = this.field.get('node_info'),
@@ -88,7 +87,7 @@ define('pgadmin.node.fts_configuration', [
                       node, [
                         null, url, this.field.get('node_data'),
                         this.field.get('url_with_id') || false,
-                        node_info
+                        node_info,
                       ]),
                     cache_level = this.field.get('cache_level') || node.type,
                     cache_node = this.field.get('cache_node');
@@ -124,7 +123,7 @@ define('pgadmin.node.fts_configuration', [
                       },
                       error: function() {
                         m.trigger('pgadmin:view:fetch:error', m, self.field);
-                      }
+                      },
                     });
                     m.trigger('pgadmin:view:fetched', m, self.field);
                   }
@@ -143,272 +142,271 @@ define('pgadmin.node.fts_configuration', [
                     self.field.set('options', data);
                   }
                 }
-              }
+              },
             }),
             // Select2 control for adding new tokens
             select2: {
               allowClear: true, width: 'style',
-              placeholder: gettext('Select token')
+              placeholder: gettext('Select token'),
             },
             first_empty: true,
-            disabled: function(m) {
+            disabled: function() {
               return _.isUndefined(self.model.get('oid'));
-            }
+            },
           }],
           headerDefaults = {token: null},
           // Grid columns backgrid
           gridCols = ['token', 'dictname'];
 
       // Creating model for header control which is used to add new tokens
-      self.headerData = new (Backbone.Model.extend({
-        defaults: headerDefaults,
-        schema: headerSchema
-      }))({});
+        self.headerData = new (Backbone.Model.extend({
+          defaults: headerDefaults,
+          schema: headerSchema,
+        }))({});
 
       // Creating view from header schema in tokens control
-      var headerGroups = Backform.generateViewSchema(
+        var headerGroups = Backform.generateViewSchema(
           self.field.get('node_info'), self.headerData, 'create',
           self.field.get('schema_node'), self.field.get('node_data')
           ),
           fields = [];
 
-      _.each(headerGroups, function(o) {
-        fields = fields.concat(o.fields);
-      });
-      self.headerFields = new Backform.Fields(fields);
+        _.each(headerGroups, function(o) {
+          fields = fields.concat(o.fields);
+        });
+        self.headerFields = new Backform.Fields(fields);
 
       // creating grid using grid columns
-      self.gridSchema = Backform.generateGridColumnsFromModel(
+        self.gridSchema = Backform.generateGridColumnsFromModel(
           self.field.get('node_info'), self.field.get('model'),
           'edit', gridCols, self.field.get('schema_node')
       );
 
       // Providing behaviour control functions to header and grid control
-      self.controls = [];
-      self.listenTo(self.headerData, "change", self.headerDataChanged);
-      self.listenTo(self.headerData, "select2", self.headerDataChanged);
-      self.listenTo(self.collection, "add", self.onAddorRemoveTokens);
-      self.listenTo(self.collection, "remove", self.onAddorRemoveTokens);
-    },
+        self.controls = [];
+        self.listenTo(self.headerData, 'change', self.headerDataChanged);
+        self.listenTo(self.headerData, 'select2', self.headerDataChanged);
+        self.listenTo(self.collection, 'add', self.onAddorRemoveTokens);
+        self.listenTo(self.collection, 'remove', self.onAddorRemoveTokens);
+      },
 
     // Template for creating header view
-    generateHeader: function(data) {
-      var header = [
-        '<div class="subnode-header-form">',
-        ' <div class="container-fluid">',
-        '  <div class="row">',
-        '   <div class="col-xs-3">',
-        '    <label class="control-label"><%-token_label%></label>',
-        '   </div>',
-        '   <div class="col-xs-6" header="token"></div>',
-        '   <div class="col-xs-2">',
-        '     <button class="btn-sm btn-default add fa fa-plus" <%=canAdd ? "" : "disabled=\'disabled\'"%> ></button>',
-        '   </div>',
-        '  </div>',
-        ' </div>',
-        '</div>',].join("\n")
-
-      _.extend(data, {
-        token_label: gettext('Tokens')
-      });
+      generateHeader: function(data) {
+        var header = [
+          '<div class="subnode-header-form">',
+          ' <div class="container-fluid">',
+          '  <div class="row">',
+          '   <div class="col-xs-3">',
+          '    <label class="control-label"><%-token_label%></label>',
+          '   </div>',
+          '   <div class="col-xs-6" header="token"></div>',
+          '   <div class="col-xs-2">',
+          '     <button class="btn-sm btn-default add fa fa-plus" <%=canAdd ? "" : "disabled=\'disabled\'"%> ></button>',
+          '   </div>',
+          '  </div>',
+          ' </div>',
+          '</div>'].join('\n');
+
+        _.extend(data, {
+          token_label: gettext('Tokens'),
+        });
 
-      var self = this,
+        var self = this,
           headerTmpl = _.template(header),
           $header = $(headerTmpl(data)),
           controls = this.controls;
 
-      self.headerFields.each(function(field) {
-        var control = new (field.get("control"))({
-          field: field,
-          model: self.headerData
-        });
+        self.headerFields.each(function(field) {
+          var control = new (field.get('control'))({
+            field: field,
+            model: self.headerData,
+          });
 
-        $header.find('div[header="' + field.get('name') + '"]').append(
+          $header.find('div[header="' + field.get('name') + '"]').append(
           control.render().$el
         );
 
-        control.$el.find('.control-label').remove();
-        controls.push(control);
-      });
+          control.$el.find('.control-label').remove();
+          controls.push(control);
+        });
 
       // We should not show add button in properties mode
-      if (data.mode == 'properties') {
-        $header.find("button.add").remove();
-      }
+        if (data.mode == 'properties') {
+          $header.find('button.add').remove();
+        }
 
       // Disable add button in token control in create mode
-      if(data.mode == 'create') {
-        $header.find("button.add").attr('disabled', true);
-      }
+        if(data.mode == 'create') {
+          $header.find('button.add').attr('disabled', true);
+        }
 
-      self.$header = $header;
-      return $header;
-    },
+        self.$header = $header;
+        return $header;
+      },
 
     // Providing event handler for add button in header
-    events: _.extend(
+      events: _.extend(
               {}, Backform.UniqueColCollectionControl.prototype.events,
               {'click button.add': 'addTokens'}
             ),
 
     // Show token/dictionary grid
-    showGridControl: function(data) {
+      showGridControl: function(data) {
 
-      var self = this,
-          titleTmpl = _.template("<div class='subnode-header'></div>"),
-          $gridBody = $("<div></div>", {
-            class:'pgadmin-control-group backgrid form-group col-xs-12 object subnode'
+        var self = this,
+          titleTmpl = _.template('<div class=\'subnode-header\'></div>'),
+          $gridBody = $('<div></div>', {
+            class:'pgadmin-control-group backgrid form-group col-xs-12 object subnode',
           }).append(
                titleTmpl({label: data.label})
           );
 
-      $gridBody.append(self.generateHeader(data));
+        $gridBody.append(self.generateHeader(data));
 
-      var gridColumns = _.clone(this.gridSchema.columns);
+        var gridColumns = _.clone(this.gridSchema.columns);
 
       // Insert Delete Cell into Grid
-      if (data.disabled == false && data.canDelete) {
+        if (data.disabled == false && data.canDelete) {
           gridColumns.unshift({
-            name: "pg-backform-delete", label: "",
+            name: 'pg-backform-delete', label: '',
             cell: Backgrid.Extension.DeleteCell,
-            editable: false, cell_priority: -1
+            editable: false, cell_priority: -1,
           });
-      }
+        }
 
-      if (self.grid) {
-        self.grid.remove();
-        self.grid.null;
-      }
+        if (self.grid) {
+          self.grid.remove();
+          self.grid.null;
+        }
       // Initialize a new Grid instance
-      var grid = self.grid = new Backgrid.Grid({
-        columns: gridColumns,
-        collection: self.collection,
-        className: "backgrid table-bordered"
-      });
-      self.$grid = grid.render().$el;
+        var grid = self.grid = new Backgrid.Grid({
+          columns: gridColumns,
+          collection: self.collection,
+          className: 'backgrid table-bordered',
+        });
+        self.$grid = grid.render().$el;
 
-      $gridBody.append(self.$grid);
+        $gridBody.append(self.$grid);
 
       // Find selected dictionaries in grid and show it all together
-      setTimeout(function() {
-        self.headerData.set({
-          'token': self.$header.find(
+        setTimeout(function() {
+          self.headerData.set({
+            'token': self.$header.find(
             'div[header="token"] select'
-            ).val()
-            }, {silent:true}
+            ).val(),
+          }, {silent:true}
           );
-      }, 10);
+        }, 10);
 
       // Render node grid
-      return $gridBody;
-    },
+        return $gridBody;
+      },
 
     // When user change the header control to add a new token
-    headerDataChanged: function() {
-      var self = this, val,
+      headerDataChanged: function() {
+        var self = this,
           data = this.headerData.toJSON(),
-          inSelected = (_.isEmpty(data) || _.isUndefined(data)),
-          checkVars = ['token'];
+          inSelected = (_.isEmpty(data) || _.isUndefined(data));
 
-      if (!self.$header) {
-        return;
-      }
+        if (!self.$header) {
+          return;
+        }
 
-      self.$header.find('button.add').prop('disabled', inSelected);
-    },
+        self.$header.find('button.add').prop('disabled', inSelected);
+      },
 
     // Get called when user click on add button header
-    addTokens: function(ev) {
-      ev.preventDefault();
-      var self = this,
+      addTokens: function(ev) {
+        ev.preventDefault();
+        var self = this,
           token = self.headerData.get('token');
 
-      if (!token || token == '') {
-        return false;
-      }
+        if (!token || token == '') {
+          return false;
+        }
 
-      var coll = self.model.get(self.field.get('name')),
+        var coll = self.model.get(self.field.get('name')),
           m = new (self.field.get('model'))(
                 self.headerData.toJSON(), {
                   silent: true, top: self.model.top,
-                  collection: coll, handler: coll
+                  collection: coll, handler: coll,
                 }),
           checkVars = ['token'],
           idx = -1;
 
       // Find if token exists in grid
-      self.collection.each(function(m) {
-        _.each(checkVars, function(v) {
-          var val = m.get(v);
-          if(val == token) {
-            idx = coll.indexOf(m);
-          }
+        self.collection.each(function(m) {
+          _.each(checkVars, function(v) {
+            var val = m.get(v);
+            if(val == token) {
+              idx = coll.indexOf(m);
+            }
+          });
         });
-      });
 
 
 
       // remove 'm' if duplicate value found.
-      if (idx == -1) {
-        coll.add(m);
-        idx = coll.indexOf(m);
-      }
-      self.$grid.find('.new').removeClass('new');
-      var newRow = self.grid.body.rows[idx].$el;
-      newRow.addClass("new");
+        if (idx == -1) {
+          coll.add(m);
+          idx = coll.indexOf(m);
+        }
+        self.$grid.find('.new').removeClass('new');
+        var newRow = self.grid.body.rows[idx].$el;
+        newRow.addClass('new');
       //$(newRow).pgMakeVisible('table-bordered');
-      $(newRow).pgMakeVisible('backform-tab');
+        $(newRow).pgMakeVisible('backform-tab');
 
 
-      return false;
-    },
+        return false;
+      },
 
     // When user delete token/dictionary entry from grid
-    onAddorRemoveTokens: function() {
-      var self = this;
+      onAddorRemoveTokens: function() {
+        var self = this;
 
       /*
        * Wait for collection to be updated before checking for the button to
        * be enabled, or not.
        */
-      setTimeout(function() {
+        setTimeout(function() {
           self.collection.trigger('pgadmin:tokens:updated', self.collection);
-        self.headerDataChanged();
-      }, 10);
-    },
+          self.headerDataChanged();
+        }, 10);
+      },
 
     // When control is about to destroy
-    remove: function() {
+      remove: function() {
       /*
        * Stop listening the events registered by this control.
        */
-      this.stopListening(this.headerData, "change", this.headerDataChanged);
-      this.listenTo(this.headerData, "select2", this.headerDataChanged);
-      this.listenTo(this.collection, "remove", this.onAddorRemoveTokens);
+        this.stopListening(this.headerData, 'change', this.headerDataChanged);
+        this.listenTo(this.headerData, 'select2', this.headerDataChanged);
+        this.listenTo(this.collection, 'remove', this.onAddorRemoveTokens);
 
       // Remove header controls.
-      _.each(this.controls, function(control) {
-        control.remove();
-      });
-      TokenControl.__super__.remove.apply(this, arguments);
+        _.each(this.controls, function(control) {
+          control.remove();
+        });
+        TokenControl.__super__.remove.apply(this, arguments);
 
       // Remove the header model
-      delete (this.headerData);
+        delete (this.headerData);
 
-    }
-  });
+      },
+    });
 
 
   // Extend the collection class for FTS Configuration
   if (!pgBrowser.Nodes['coll-fts_configuration']) {
-    var fts_configurations = pgAdmin.Browser.Nodes['coll-fts_configuration'] =
+    pgAdmin.Browser.Nodes['coll-fts_configuration'] =
       pgAdmin.Browser.Collection.extend({
         node: 'fts_configuration',
         label: gettext('FTS Configurations'),
         type: 'coll-fts_configuration',
-        columns: ['name', 'description']
+        columns: ['name', 'description'],
       });
-  };
+  }
 
   // Extend the node class for FTS Configuration
   if (!pgBrowser.Nodes['fts_configuration']) {
@@ -438,20 +436,20 @@ define('pgadmin.node.fts_configuration', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           label: gettext('FTS Configuration...'),
           icon: 'wcTabIcon icon-fts_configuration', data: {action: 'create'},
-          enable: 'canCreate'
-          },{
+          enable: 'canCreate',
+        },{
           name: 'create_fts_configuration_on_coll', module: this, priority: 4,
           node: 'coll-fts_configuration', applies: ['object', 'context'],
           callback: 'show_obj_properties', category: 'create',
           label: gettext('FTS Configuration...'), data: {action: 'create'},
-          icon: 'wcTabIcon icon-fts_configuration', enable: 'canCreate'
-          },{
+          icon: 'wcTabIcon icon-fts_configuration', enable: 'canCreate',
+        },{
           name: 'create_fts_configuration', node: 'fts_configuration',
           module: this, applies: ['object', 'context'],
           callback: 'show_obj_properties', category: 'create', priority: 4,
           label: gettext('FTS Configuration...'), data: {action: 'create'},
-          icon: 'wcTabIcon icon-fts_configuration', enable: 'canCreate'
-          }]);
+          icon: 'wcTabIcon icon-fts_configuration', enable: 'canCreate',
+        }]);
       },
 
       // Defining model for FTS Configuration node
@@ -463,7 +461,7 @@ define('pgadmin.node.fts_configuration', [
           schema: undefined,      // Schema name FTS Configuration belongs to
           prsname: undefined,    // FTS parser list for FTS Configuration node
           copy_config: undefined, // FTS configuration list to copy from
-          tokens: undefined      // token/dictionary pair list for node
+          tokens: undefined,      // token/dictionary pair list for node
         },
         initialize: function(attrs, opts) {
           var isNew = (_.size(attrs) === 0);
@@ -473,29 +471,29 @@ define('pgadmin.node.fts_configuration', [
             var user = pgBrowser.serverInfo[opts.node_info.server._id].user;
             this.set({
               'owner': user.name,
-              'schema': opts.node_info.schema._id
+              'schema': opts.node_info.schema._id,
             }, {silent: true});
           }
         },
         // Defining schema for FTS Configuration
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text', cellHeaderClasses: 'width_percent_50'
+          type: 'text', cellHeaderClasses: 'width_percent_50',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          editable: false, type: 'text', disabled: true, mode:['properties']
+          editable: false, type: 'text', disabled: true, mode:['properties'],
         },{
           id: 'owner', label: gettext('Owner'), cell: 'string',
           type: 'text', mode: ['properties', 'edit','create'], node: 'role',
-          control: Backform.NodeListByNameControl, select2: { allowClear: false }
+          control: Backform.NodeListByNameControl, select2: { allowClear: false },
         },{
           id: 'schema', label: gettext('Schema'), cell: 'string',
           type: 'text', mode: ['create','edit'], node: 'schema',
           control: 'node-list-by-id', cache_node: 'database',
-          cache_level: 'database'
+          cache_level: 'database',
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
-          type: 'multiline', cellHeaderClasses: 'width_percent_50'
+          type: 'multiline', cellHeaderClasses: 'width_percent_50',
         },{
           id: 'prsname', label: gettext('Parser'),type: 'text',
           url: 'parsers', first_empty: true,
@@ -508,7 +506,7 @@ define('pgadmin.node.fts_configuration', [
                     (_.isNull(copy_config) ||
                     _.isUndefined(copy_config) ||
                     copy_config === '') ? false : true;
-          }
+          },
         },{
           id: 'copy_config', label: gettext('Copy Config'),type: 'text',
           mode: ['create'], group: gettext('Definition'),
@@ -521,21 +519,21 @@ define('pgadmin.node.fts_configuration', [
                     (_.isNull(parser) ||
                     _.isUndefined(parser) ||
                     parser === '') ? false : true;
-          }
+          },
         },{
           id: 'tokens', label: gettext('Tokens'), type: 'collection',
           group: gettext('Tokens'), control: TokenControl,
           model: TokenModel, columns: ['token', 'dictionary'],
           uniqueCol : ['token'], mode: ['create','edit'],
-          canAdd: true, canEdit: false, canDelete: true
-         }],
+          canAdd: true, canEdit: false, canDelete: true,
+        }],
 
         /*
          * Triggers control specific error messages for name,
          * copy_config/parser and schema, if any one of them is not specified
          * while creating new fts configuration
          */
-        validate: function(keys){
+        validate: function() {
           var msg;
           var name = this.get('name');
           var parser = this.get('prsname');
@@ -577,7 +575,7 @@ define('pgadmin.node.fts_configuration', [
           }
 
           return null;
-        }
+        },
       }),
       canCreate: function(itemData, item, data) {
         //If check is false then , we will allow create menu
@@ -606,9 +604,9 @@ define('pgadmin.node.fts_configuration', [
         }
         // by default we do not want to allow create menu
         return true;
-      }
+      },
     });
   }
 
-return pgBrowser.Nodes['coll-fts_configuration'];
+  return pgBrowser.Nodes['coll-fts_configuration'];
 });
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/static/js/fts_dictionary.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/static/js/fts_dictionary.js
index 2192ef36..ed83feb1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/static/js/fts_dictionary.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/static/js/fts_dictionary.js
@@ -1,55 +1,57 @@
 define('pgadmin.node.fts_dictionary', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
+  'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform) {
 
   // Extend the browser's node model class to create a option/value pair
   var OptionLabelModel = pgAdmin.Browser.Node.Model.extend({
-        defaults: {
-          options: undefined,
-          value: undefined
-        },
+    defaults: {
+      options: undefined,
+      value: undefined,
+    },
         // Define the schema for the Options
-        schema: [
-          {
-            id: 'option', label: gettext('Option'), type:'text', group: null,
-            cellHeaderClasses: 'width_percent_50', editable: true
-          },{
-            id: 'value', label: gettext('Value'), type: 'text', group:null,
-            cellHeaderClasses: 'width_percent_50', editable: true
-            },
-        ],
-        validate: function() {
-            // Clear any existing errors.
-            this.errorModel.clear()
+    schema: [
+      {
+        id: 'option', label: gettext('Option'), type:'text', group: null,
+        cellHeaderClasses: 'width_percent_50', editable: true,
+      },{
+        id: 'value', label: gettext('Value'), type: 'text', group:null,
+        cellHeaderClasses: 'width_percent_50', editable: true,
+      },
+    ],
+    validate: function() {
+      // Clear any existing errors.
+      this.errorModel.clear();
+
+      var msg;
 
-            if (_.isUndefined(this.get('option')) ||
+      if (_.isUndefined(this.get('option')) ||
                 String(this.get('option')).replace(/^\s+|\s+$/g, '') == '') {
-                var msg = gettext('Option cannot be empty.');
-                this.errorModel.set('option',msg);
-                return msg;
-            }
-            if (_.isUndefined(this.get('value')) ||
+        msg = gettext('Option cannot be empty.');
+        this.errorModel.set('option',msg);
+        return msg;
+      }
+      if (_.isUndefined(this.get('value')) ||
                 String(this.get('value')).replace(/^\s+|\s+$/g, '') == '') {
-                var msg = gettext('Value cannot be empty.');
-                this.errorModel.set('value',msg);
-                return msg;
-            }
-            return null;
-        }
-    });
+        msg = gettext('Value cannot be empty.');
+        this.errorModel.set('value',msg);
+        return msg;
+      }
+      return msg;
+    },
+  });
 
   // Extend the collection class for FTS Dictionary
   if (!pgBrowser.Nodes['coll-fts_dictionary']) {
-    var fts_dictionaries = pgAdmin.Browser.Nodes['coll-fts_dictionary'] =
+    pgAdmin.Browser.Nodes['coll-fts_dictionary'] =
       pgAdmin.Browser.Collection.extend({
         node: 'fts_dictionary',
         label: gettext('FTS Dictionaries'),
         type: 'coll-fts_dictionary',
-        columns: ['name', 'description']
+        columns: ['name', 'description'],
       });
-  };
+  }
 
   // Extend the node class for FTS Dictionary
   if (!pgBrowser.Nodes['fts_dictionary']) {
@@ -78,20 +80,20 @@ define('pgadmin.node.fts_dictionary', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('FTS Dictionary...'),
           icon: 'wcTabIcon icon-fts_dictionary', data: {action: 'create'},
-          enable: 'canCreate'
-          },{
+          enable: 'canCreate',
+        },{
           name: 'create_fts_dictionary_on_coll', node: 'coll-fts_dictionary',
           module: this, applies: ['object', 'context'],  priority: 4,
           callback: 'show_obj_properties', category: 'create',
           label: gettext('FTS Dictionary...'), data: {action: 'create'},
-          icon: 'wcTabIcon icon-fts_dictionary', enable: 'canCreate'
-          },{
+          icon: 'wcTabIcon icon-fts_dictionary', enable: 'canCreate',
+        },{
           name: 'create_fts_dictionary', node: 'fts_dictionary', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('FTS Dictionary...'),
           icon: 'wcTabIcon icon-fts_dictionary', data: {action: 'create'},
-          enable: 'canCreate'
-          }]);
+          enable: 'canCreate',
+        }]);
       },
 
       // Defining backform model for FTS Dictionary node
@@ -102,7 +104,7 @@ define('pgadmin.node.fts_dictionary', [
           description: undefined, // Comment on FTS Dictionary
           schema: undefined,      // Schema name FTS dictionary belongs to
           template: undefined,    // Template list for FTS dictionary node
-          options: undefined      // option/value pair list for FTS Dictionary
+          options: undefined,      // option/value pair list for FTS Dictionary
         },
         initialize: function(attrs, args) {
           var isNew = (_.size(attrs) === 0);
@@ -112,28 +114,28 @@ define('pgadmin.node.fts_dictionary', [
             var user = pgBrowser.serverInfo[args.node_info.server._id].user;
             this.set({
               'owner': user.name,
-              'schema': args.node_info.schema._id
+              'schema': args.node_info.schema._id,
             }, {silent: true});
           }
         },
         // Defining schema for fts dictionary
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text', cellHeaderClasses: 'width_percent_50'
+          type: 'text', cellHeaderClasses: 'width_percent_50',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          editable: false, type: 'text', disabled: true, mode:['properties']
+          editable: false, type: 'text', disabled: true, mode:['properties'],
         },{
           id: 'owner', label: gettext('Owner'), cell: 'string',
           type: 'text', mode: ['properties', 'edit','create'], node: 'role',
-          control: Backform.NodeListByNameControl
+          control: Backform.NodeListByNameControl,
         },{
           id: 'schema', label: gettext('Schema'), cell: 'string',
           type: 'text', mode: ['create','edit'], node: 'schema',
-          cache_node: 'database', control: 'node-list-by-id'
+          cache_node: 'database', control: 'node-list-by-id',
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
-          type: 'multiline', cellHeaderClasses: 'width_percent_50'
+          type: 'multiline', cellHeaderClasses: 'width_percent_50',
         },{
           id: 'template', label: gettext('Template'),type: 'text',
           disabled: function(m) { return !m.isNew(); }, url: 'fetch_templates',
@@ -144,36 +146,37 @@ define('pgadmin.node.fts_dictionary', [
           group: gettext('Options'), control: 'unique-col-collection',
           model: OptionLabelModel, columns: ['option', 'value'],
           uniqueCol : ['option'], mode: ['edit', 'create'],
-          canAdd: true, canEdit: false,canDelete: true
-         }],
+          canAdd: true, canEdit: false,canDelete: true,
+        }],
 
         /*
          * Triggers control specific error messages for dictionary name,
          * template and schema, if any one of them is not specified
          * while creating new fts dictionary
          */
-        validate: function(keys){
-          var name = this.get('name');
-          var template = this.get('template');;
-          var schema = this.get('schema');
+        validate: function() {
+          var name = this.get('name'),
+            template = this.get('template'),
+            schema = this.get('schema'),
+            msg;
 
           // Validate FTS Dictionary name
           if (_.isUndefined(name) || _.isNull(name) || String(name).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Name must be specified.');
+            msg = gettext('Name must be specified.');
             this.errorModel.set('name', msg);
             return msg;
           }
 
           // Validate template name
           else if (_.isUndefined(template) || _.isNull(template) || String(template).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Template must be selected.');
+            msg = gettext('Template must be selected.');
             this.errorModel.set('template', msg);
             return msg;
           }
 
           // Validate schema
           else if (_.isUndefined(schema) || _.isNull(schema) || String(schema).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Schema must be selected.');
+            msg = gettext('Schema must be selected.');
             this.errorModel.set('schema', msg);
             return msg;
           }
@@ -181,7 +184,7 @@ define('pgadmin.node.fts_dictionary', [
 
           this.trigger('on-status-clear');
           return null;
-        }
+        },
       }),
       canCreate: function(itemData, item, data) {
         //If check is false then , we will allow create menu
@@ -210,9 +213,9 @@ define('pgadmin.node.fts_dictionary', [
         }
         // by default we do not want to allow create menu
         return true;
-      }
+      },
     });
   }
 
-return pgBrowser.Nodes['fts_dictionary'];
+  return pgBrowser.Nodes['fts_dictionary'];
 });
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/static/js/fts_parser.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/static/js/fts_parser.js
index 0f1d787f..92c0786e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/static/js/fts_parser.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parser/static/js/fts_parser.js
@@ -1,19 +1,18 @@
 define('pgadmin.node.fts_parser', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, pgAdmin, pgBrowser) {
 
   // Extend the collection class for fts parser
   if (!pgBrowser.Nodes['coll-fts_parser']) {
-    var fts_parsers = pgAdmin.Browser.Nodes['coll-fts_parser'] =
+    pgAdmin.Browser.Nodes['coll-fts_parser'] =
       pgAdmin.Browser.Collection.extend({
         node: 'fts_parser',
         label: gettext('FTS Parsers'),
         type: 'coll-fts_parser',
-        columns: ['name', 'description']
+        columns: ['name', 'description'],
       });
-  };
+  }
 
   // Extend the node class for fts parser
   if (!pgBrowser.Nodes['fts_parser']) {
@@ -42,20 +41,20 @@ define('pgadmin.node.fts_parser', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('FTS Parser...'),
           icon: 'wcTabIcon icon-fts_parser', data: {action: 'create'},
-          enable: 'canCreate'
-          },{
+          enable: 'canCreate',
+        },{
           name: 'create_fts_parser_on_coll', node: 'coll-fts_parser',
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('FTS Parser...'),
           icon: 'wcTabIcon icon-fts_parser', data: {action: 'create'},
-          module: this, enable: 'canCreate'
-          },{
+          module: this, enable: 'canCreate',
+        },{
           name: 'create_fts_parser', node: 'fts_parser', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('FTS Parser...'),
           icon: 'wcTabIcon icon-fts_parser', data: {action: 'create'},
-          enable: 'canCreate'
-          }]);
+          enable: 'canCreate',
+        }]);
 
       },
 
@@ -69,7 +68,7 @@ define('pgadmin.node.fts_parser', [
           prstoken: undefined,       // Token function for fts parser
           prsend: undefined,        // End function for fts parser
           prslextype: undefined,    // Lextype function for fts parser
-          prsheadline: undefined    // Headline function for fts parse
+          prsheadline: undefined,    // Headline function for fts parse
         },
         initialize: function(attrs, args) {
           var isNew = (_.size(attrs) === 0);
@@ -83,48 +82,48 @@ define('pgadmin.node.fts_parser', [
         // Defining schema for fts parser
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text', cellHeaderClasses: 'width_percent_50'
+          type: 'text', cellHeaderClasses: 'width_percent_50',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          editable: false, type: 'text', disabled: true, mode:['properties']
+          editable: false, type: 'text', disabled: true, mode:['properties'],
         },{
           id: 'schema', label: gettext('Schema'), cell: 'string',
           type: 'text', mode: ['create','edit'], node: 'schema',
           control: 'node-list-by-id', cache_node: 'database',
-          cache_level: 'database'
+          cache_level: 'database',
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
-          type: 'multiline', cellHeaderClasses: 'width_percent_50'
+          type: 'multiline', cellHeaderClasses: 'width_percent_50',
         },{
           id: 'prsstart', label: gettext('Start function'),
           type: 'text', disabled: function(m) { return !m.isNew(); },
           control: 'node-ajax-options', url: 'start_functions',
           group: gettext('Definition'), cache_level: 'database',
-          cache_node: 'schema'
+          cache_node: 'schema',
         },{
           id: 'prstoken', label: gettext('Get next token function'),
           type: 'text', disabled: function(m) { return !m.isNew(); },
           control: 'node-ajax-options', url: 'token_functions',
           group: gettext('Definition'), cache_level: 'database',
-          cache_node: 'schema'
+          cache_node: 'schema',
         },{
           id: 'prsend', label: gettext('End function'),
           type: 'text', disabled: function(m) { return !m.isNew(); },
           control: 'node-ajax-options', url: 'end_functions',
           group: gettext('Definition'), cache_level: 'database',
-          cache_node: 'schema'
+          cache_node: 'schema',
         },{
           id: 'prslextype', label: gettext('Lextypes function'),
           type: 'text', disabled: function(m) { return !m.isNew(); },
           control: 'node-ajax-options', url: 'lextype_functions',
           group: gettext('Definition'), cache_level: 'database',
-          cache_node: 'schema'
+          cache_node: 'schema',
         },{
           id: 'prsheadline', label: gettext('Headline function'),
           type: 'text', disabled: function(m) { return !m.isNew(); },
           control: 'node-ajax-options', url: 'headline_functions',
           group: gettext('Definition'), cache_level: 'database',
-          cache_node: 'schema'
+          cache_node: 'schema',
         }],
 
         /*
@@ -132,19 +131,20 @@ define('pgadmin.node.fts_parser', [
          * start, token, end, lextype functions and schema, if any one of them is not specified
          * while creating new fts parser
          */
-        validate: function(keys){
-          var name = this.get('name');
-          var start = this.get('prsstart');
-          var token = this.get('prstoken');
-          var end = this.get('prsend');
-          var lextype = this.get('prslextype');
-          var schema = this.get('schema');
+        validate: function() {
+          var name = this.get('name'),
+            start = this.get('prsstart'),
+            token = this.get('prstoken'),
+            end = this.get('prsend'),
+            lextype = this.get('prslextype'),
+            schema = this.get('schema'),
+            msg;
 
           // Validate fts parser name
           if (_.isUndefined(name) ||
                 _.isNull(name) ||
                 String(name).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Name must be specified.');
+            msg = gettext('Name must be specified.');
             this.errorModel.set('name', msg);
             return msg;
           }
@@ -153,7 +153,7 @@ define('pgadmin.node.fts_parser', [
           else if (_.isUndefined(start) ||
                     _.isNull(start) ||
                     String(start).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Start function must be selected.');
+            msg = gettext('Start function must be selected.');
             this.errorModel.set('prsstart', msg);
             return msg;
           }
@@ -162,7 +162,7 @@ define('pgadmin.node.fts_parser', [
           else if (_.isUndefined(token) ||
                     _.isNull(token) ||
                     String(token).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Get next token function must be selected.');
+            msg = gettext('Get next token function must be selected.');
             this.errorModel.set('prstoken', msg);
             return msg;
           }
@@ -171,7 +171,7 @@ define('pgadmin.node.fts_parser', [
           else if (_.isUndefined(end) ||
                     _.isNull(end) ||
                     String(end).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('End function must be selected.');
+            msg = gettext('End function must be selected.');
             this.errorModel.set('prsend', msg);
             return msg;
           }
@@ -180,7 +180,7 @@ define('pgadmin.node.fts_parser', [
           else if (_.isUndefined(lextype) ||
                     _.isNull(lextype) ||
                     String(lextype).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Lextype function must be selected.');
+            msg = gettext('Lextype function must be selected.');
             this.errorModel.set('prslextype', msg);
             return msg;
           }
@@ -189,7 +189,7 @@ define('pgadmin.node.fts_parser', [
           else if (_.isUndefined(schema) ||
                     _.isNull(schema) ||
                     String(schema).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Schema must be selected.');
+            msg = gettext('Schema must be selected.');
             this.errorModel.set('schema', msg);
             return msg;
           }
@@ -197,7 +197,7 @@ define('pgadmin.node.fts_parser', [
 
           this.trigger('on-status-clear');
           return null;
-        }
+        },
       }),
       canCreate: function(itemData, item, data) {
         //If check is false then , we will allow create menu
@@ -226,9 +226,9 @@ define('pgadmin.node.fts_parser', [
         }
         // by default we do not want to allow create menu
         return true;
-      }
+      },
     });
   }
 
-return pgBrowser.Nodes['coll-fts_parser'];
+  return pgBrowser.Nodes['coll-fts_parser'];
 });
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/static/js/fts_template.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/static/js/fts_template.js
index 853b9924..606a57a6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/static/js/fts_template.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/static/js/fts_template.js
@@ -1,19 +1,18 @@
 define('pgadmin.node.fts_template', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, pgAdmin, pgBrowser) {
 
   // Extend the collection class for fts template
   if (!pgBrowser.Nodes['coll-fts_template']) {
-    var fts_templates = pgAdmin.Browser.Nodes['coll-fts_template'] =
+    pgAdmin.Browser.Nodes['coll-fts_template'] =
       pgAdmin.Browser.Collection.extend({
         node: 'fts_template',
         label: gettext('FTS Templates'),
         type: 'coll-fts_template',
-        columns: ['name', 'description']
+        columns: ['name', 'description'],
       });
-  };
+  }
 
   // Extend the node class for fts template
   if (!pgBrowser.Nodes['fts_template']) {
@@ -42,20 +41,20 @@ define('pgadmin.node.fts_template', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('FTS Template...'),
           icon: 'wcTabIcon icon-fts_template', data: {action: 'create'},
-          enable: 'canCreate'
-          },{
+          enable: 'canCreate',
+        },{
           name: 'create_fts_template_on_coll', node: 'coll-fts_template', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('FTS Template...'),
           icon: 'wcTabIcon icon-fts_template', data: {action: 'create'},
-          enable: 'canCreate'
-          },{
+          enable: 'canCreate',
+        },{
           name: 'create_fts_template', node: 'fts_template', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('FTS Template...'),
           icon: 'wcTabIcon icon-fts_template', data: {action: 'create'},
-          enable: 'canCreate'
-          }]);
+          enable: 'canCreate',
+        }]);
 
       },
 
@@ -66,7 +65,7 @@ define('pgadmin.node.fts_template', [
           description: undefined,   // Comment on template
           schema: undefined,        // Schema name to which template belongs
           tmplinit: undefined,      // Init function for fts template
-          tmpllexize: undefined     // Lexize function for fts template
+          tmpllexize: undefined,     // Lexize function for fts template
         },
         initialize: function(attrs, args) {
           var isNew = (_.size(attrs) === 0);
@@ -78,29 +77,29 @@ define('pgadmin.node.fts_template', [
         // Defining schema for fts template
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text', cellHeaderClasses: 'width_percent_50'
+          type: 'text', cellHeaderClasses: 'width_percent_50',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          editable: false, type: 'text', disabled: true, mode:['properties']
+          editable: false, type: 'text', disabled: true, mode:['properties'],
         },{
           id: 'schema', label: gettext('Schema'), cell: 'string',
           type: 'text', mode: ['create','edit'], node: 'schema',
           control: 'node-list-by-id', cache_node: 'database',
-          cache_level: 'database'
+          cache_level: 'database',
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
-          type: 'multiline', cellHeaderClasses: 'width_percent_50'
+          type: 'multiline', cellHeaderClasses: 'width_percent_50',
         },{
           id: 'tmplinit', label: gettext('Init function'),
           group: gettext('Definition'), type: 'text', disabled: function(m) {
             return !m.isNew();
           }, control: 'node-ajax-options', url: 'get_init',
-          cache_level: 'database', cache_node: 'schema'
+          cache_level: 'database', cache_node: 'schema',
         },{
           id: 'tmpllexize', label: gettext('Lexize function'), group: gettext('Definition'),
           type: 'text', disabled: function(m) { return !m.isNew(); },
           control: 'node-ajax-options', url: 'get_lexize', cache_level: 'database',
-          cache_node: 'schema'
+          cache_node: 'schema',
         }],
 
         /*
@@ -108,28 +107,29 @@ define('pgadmin.node.fts_template', [
          * lexize function and schema, if any one of them is not specified
          * while creating new fts template
          */
-        validate: function(keys){
-          var name = this.get('name');
-          var lexize = this.get('tmpllexize');
-          var schema = this.get('schema');
+        validate: function() {
+          var name = this.get('name'),
+            lexize = this.get('tmpllexize'),
+            schema = this.get('schema'),
+            msg;
 
           // Validate fts template name
           if (_.isUndefined(name) || _.isNull(name) || String(name).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Name must be specified.');
+            msg = gettext('Name must be specified.');
             this.errorModel.set('name', msg);
             return msg;
           }
 
           // Validate lexize function control
           else if (_.isUndefined(lexize) || _.isNull(lexize) || String(lexize).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Lexize function must be selected.');
+            msg = gettext('Lexize function must be selected.');
             this.errorModel.set('tmpllexize', msg);
             return msg;
           }
 
           // Validate schema for fts template
           else if (_.isUndefined(schema) || _.isNull(schema) || String(schema).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Schema must be selected.');
+            msg = gettext('Schema must be selected.');
             this.errorModel.set('schema', msg);
             return msg;
           }
@@ -137,7 +137,7 @@ define('pgadmin.node.fts_template', [
 
           this.trigger('on-status-clear');
           return null;
-        }
+        },
       }),
       canCreate: function(itemData, item, data) {
         //If check is false then , we will allow create menu
@@ -166,9 +166,9 @@ define('pgadmin.node.fts_template', [
         }
         // by default we do not want to allow create menu
         return true;
-      }
+      },
     });
   }
 
-return pgBrowser.Nodes['fts_template'];
+  return pgBrowser.Nodes['fts_template'];
 });
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/function.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/function.js
index bd3ad137..7622cd0b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/function.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/function.js
@@ -1,20 +1,20 @@
 /* Create and Register Function Collection and Node. */
 define('pgadmin.node.function', [
-  'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection', 'pgadmin.browser.server.privilege'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
+  'pgadmin.browser.collection', 'pgadmin.browser.server.privilege',
+], function(gettext, url_for, $, _, Backbone, pgAdmin, pgBrowser, Backform) {
 
   if (!pgBrowser.Nodes['coll-function']) {
-    var functions = pgBrowser.Nodes['coll-function'] =
+    pgBrowser.Nodes['coll-function'] =
       pgBrowser.Collection.extend({
         node: 'function',
         label: gettext('Functions'),
         type: 'coll-function',
         columns: ['name', 'funcowner', 'description'],
-        hasStatistics: true
+        hasStatistics: true,
       });
-  };
+  }
 
   // Argument Model
   var ArgumentModel = pgBrowser.Node.Model.extend({
@@ -24,44 +24,44 @@ define('pgadmin.node.function', [
       argtype: undefined,
       argmode: undefined,
       argname: undefined,
-      argdefval: undefined
+      argdefval: undefined,
     },
     schema: [{
       id: 'argid', visible: false, type: 'text',
-      mode: ['properties', 'edit','create']
-      },{
-        id: 'argtype', label: gettext('Data Type'), cell:
+      mode: ['properties', 'edit','create'],
+    },{
+      id: 'argtype', label: gettext('Data Type'), cell:
         'node-ajax-options', cellHeaderClasses: 'width_percent_30',
-        control: 'node-ajax-options', type: 'text', url: 'get_types',
-        editable: function(m) {
-          var node_info = this.get('node_info');
-          if(node_info && 'catalog' in node_info) {
-            return false;
-          }
-          return _.isUndefined(m.isNew) ? true : m.isNew();
-        }, first_empty: true
-      },{
-        id: 'argmode', label: gettext('Mode'), type: 'options',
-        control: 'node-ajax-options', cellHeaderClasses:'width_percent_20',
-        options:[
+      control: 'node-ajax-options', type: 'text', url: 'get_types',
+      editable: function(m) {
+        var node_info = this.get('node_info');
+        if(node_info && 'catalog' in node_info) {
+          return false;
+        }
+        return _.isUndefined(m.isNew) ? true : m.isNew();
+      }, first_empty: true,
+    },{
+      id: 'argmode', label: gettext('Mode'), type: 'options',
+      control: 'node-ajax-options', cellHeaderClasses:'width_percent_20',
+      options:[
           {'label': 'IN', 'value': 'IN'},
           {'label': 'OUT', 'value': 'OUT'},
           {'label': 'INOUT', 'value': 'INOUT'},
-          {'label': 'VARIADIC', 'value': 'VARIADIC'}
-        ], editable: function(m) {
-             var node_info = this.get('node_info');
-             if(node_info && 'catalog' in node_info) {
-               return false;
-             }
-             return _.isUndefined(m.isNew) ? true : m.isNew();
-           }
-      },{
-        id: 'argname', label: gettext('Argument Name'), type: 'text',
-        cell: 'string', editable: 'isInCatalog', cellHeaderClasses:'width_percent_30'
-      },{
-        id: 'argdefval', label: gettext('Default Value'), type: 'text',
-        cell: 'string', editable: 'isInCatalog',  cellHeaderClasses:'width_percent_20'
-      }
+          {'label': 'VARIADIC', 'value': 'VARIADIC'},
+      ], editable: function(m) {
+        var node_info = this.get('node_info');
+        if(node_info && 'catalog' in node_info) {
+          return false;
+        }
+        return _.isUndefined(m.isNew) ? true : m.isNew();
+      },
+    },{
+      id: 'argname', label: gettext('Argument Name'), type: 'text',
+      cell: 'string', editable: 'isInCatalog', cellHeaderClasses:'width_percent_30',
+    },{
+      id: 'argdefval', label: gettext('Default Value'), type: 'text',
+      cell: 'string', editable: 'isInCatalog',  cellHeaderClasses:'width_percent_20',
+    },
     ],
     toJSON: Backbone.Model.prototype.toJSON,
     isInCatalog: function(m){
@@ -79,7 +79,7 @@ define('pgadmin.node.function', [
       return true;
     },
     validate: function() {
-    }
+    },
   });
 
   if (!pgBrowser.Nodes['function']) {
@@ -95,10 +95,10 @@ define('pgadmin.node.function', [
       hasStatistics: true,
       hasScriptTypes: ['create', 'select'],
       parent_type: ['schema', 'catalog'],
-      Init: function(args) {
+      Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -107,20 +107,20 @@ define('pgadmin.node.function', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Function...'),
           icon: 'wcTabIcon icon-function', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_function', node: 'function', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Function...'),
           icon: 'wcTabIcon icon-function', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_function', node: 'schema', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Function...'),
           icon: 'wcTabIcon icon-function', data: {action: 'create', check: false},
-          enable: 'canCreate'
-        }
+          enable: 'canCreate',
+        },
         ]);
 
       },
@@ -171,58 +171,58 @@ define('pgadmin.node.function', [
           seclabels: [],
           acl: [],
           sysfunc: undefined,
-          sysproc: undefined
+          sysproc: undefined,
         },
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'],
-          disabled: 'isDisabled'
+          disabled: 'isDisabled',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text' , mode: ['properties']
+          type: 'text' , mode: ['properties'],
         },{
           id: 'funcowner', label: gettext('Owner'), cell: 'string',
           control: Backform.NodeListByNameControl, node: 'role',  type:
-          'text', disabled: 'isDisabled'
+          'text', disabled: 'isDisabled',
         },{
           id: 'pronamespace', label: gettext('Schema'), cell: 'string',
           control: 'node-list-by-id', type: 'text', cache_level: 'database',
-          node: 'schema', disabled: 'isDisabled', mode: ['create', 'edit']
+          node: 'schema', disabled: 'isDisabled', mode: ['create', 'edit'],
         },{
           id: 'sysfunc', label: gettext('System function?'),
-           cell:'boolean', type: 'switch',
-           mode: ['properties'], visible: 'isVisible'
+          cell:'boolean', type: 'switch',
+          mode: ['properties'], visible: 'isVisible',
         },{
           id: 'sysproc', label: gettext('System procedure?'),
-           cell:'boolean', type: 'switch',
-           mode: ['properties'], visible: 'isVisible'
+          cell:'boolean', type: 'switch',
+          mode: ['properties'], visible: 'isVisible',
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
-          type: 'multiline', disabled: 'isDisabled'
+          type: 'multiline', disabled: 'isDisabled',
         },{
           id: 'pronargs', label: gettext('Argument count'), cell: 'string',
-          type: 'text', group: gettext('Definition'), mode: ['properties']
+          type: 'text', group: gettext('Definition'), mode: ['properties'],
         },{
           id: 'proargs', label: gettext('Arguments'), cell: 'string',
           type: 'text', group: gettext('Definition'), mode: ['properties', 'edit'],
-          disabled: 'isDisabled'
+          disabled: 'isDisabled',
         },{
           id: 'proargtypenames', label: gettext('Signature arguments'), cell:
           'string', type: 'text', group: gettext('Definition'), mode: ['properties'],
-          disabled: 'isDisabled'
+          disabled: 'isDisabled',
         },{
           id: 'prorettypename', label: gettext('Return type'), cell: 'string',
           control: 'node-ajax-options', type: 'text', group: gettext('Definition'),
           url: 'get_types', disabled: 'isDisabled', first_empty: true,
-          mode: ['create'], visible: 'isVisible'
+          mode: ['create'], visible: 'isVisible',
         },{
           id: 'prorettypename', label: gettext('Return type'), cell: 'string',
           type: 'text', group: gettext('Definition'),
-          mode: ['properties', 'edit'], disabled: 'isDisabled', visible: 'isVisible'
+          mode: ['properties', 'edit'], disabled: 'isDisabled', visible: 'isVisible',
         },  {
           id: 'lanname', label: gettext('Language'), cell: 'string',
           control: 'node-ajax-options', type: 'text', group: gettext('Definition'),
-          url: 'get_languages', disabled: 'isDisabled'
+          url: 'get_languages', disabled: 'isDisabled',
         },{
           id: 'prosrc', label: gettext('Code'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'],
@@ -234,21 +234,21 @@ define('pgadmin.node.function', [
               return false;
             }
             return true;
-          }, disabled: 'isDisabled'
+          }, disabled: 'isDisabled',
         },{
           id: 'probin', label: gettext('Object file'), cell: 'string',
           type: 'text', group: gettext('Definition'), deps: ['lanname'], visible:
           function(m) {
             if (m.get('lanname') == 'c') { return true; }
             return false;
-          }, disabled: 'isDisabled'
+          }, disabled: 'isDisabled',
         },{
           id: 'prosrc_c', label: gettext('Link symbol'), cell: 'string',
           type: 'text', group: gettext('Definition'),  deps: ['lanname'], visible:
           function(m) {
             if (m.get('lanname') == 'c') { return true; }
             return false;
-          }, disabled: 'isDisabled'
+          }, disabled: 'isDisabled',
         },{
           id: 'provolatile', label: gettext('Volatility'), cell: 'string',
           control: 'node-ajax-options', type: 'text', group: gettext('Options'),
@@ -256,27 +256,27 @@ define('pgadmin.node.function', [
             {'label': 'VOLATILE', 'value': 'v'},
             {'label': 'STABLE', 'value': 's'},
             {'label': 'IMMUTABLE', 'value': 'i'},
-          ], disabled: 'isDisabled', select2: {allowClear: false}
+          ], disabled: 'isDisabled', select2: {allowClear: false},
         },{
           id: 'proretset', label: gettext('Returns a set?'), type: 'switch',
           disabled: 'isDisabled', group: gettext('Options'),
-          visible: 'isVisible'
+          visible: 'isVisible',
         },{
           id: 'proisstrict', label: gettext('Strict?'), type: 'switch',
           group: gettext('Options'), disabled: 'isDisabled',
           options: {
             'onText': gettext('Yes'), 'offText': gettext('No'),
             'onColor': 'success', 'offColor': 'primary',
-            'size': 'small'
-           }
+            'size': 'small',
+          },
         },{
           id: 'prosecdef', label: gettext('Security of definer?'),
-           group: gettext('Options'), type: 'switch',
-           disabled: 'isDisabled'
+          group: gettext('Options'), type: 'switch',
+          disabled: 'isDisabled',
         },{
           id: 'proiswindow', label: gettext('Window?'),
-           group: gettext('Options'), cell:'boolean', type: 'switch',
-            disabled: 'isDisabled', visible: 'isVisible'
+          group: gettext('Options'), cell:'boolean', type: 'switch',
+          disabled: 'isDisabled', visible: 'isVisible',
         },{
           id: 'proparallel', label: gettext('Parallel'), cell: 'string',
           control: 'node-ajax-options', type: 'text', group: gettext('Options'),
@@ -285,21 +285,21 @@ define('pgadmin.node.function', [
             {'label': 'RESTRICTED', 'value': 'r'},
             {'label': 'SAFE', 'value': 's'},
           ], disabled: 'isDisabled', min_version: 90600,
-          select2: {allowClear: false}
+          select2: {allowClear: false},
         },{
           id: 'procost', label: gettext('Estimated cost'), group: gettext('Options'),
-          cell:'string', type: 'text', disabled: 'isDisabled'
+          cell:'string', type: 'text', disabled: 'isDisabled',
         },{
           id: 'prorows', label: gettext('Estimated rows'), type: 'text',
           deps: ['proretset'], visible: 'isVisible', disabled: 'isDisabled',
-          group: gettext('Options')
+          group: gettext('Options'),
         },{
           id: 'proleakproof', label: gettext('Leak proof?'),
           group: gettext('Options'), cell:'boolean', type: 'switch', min_version: 90200,
-          disabled: 'isDisabled'
+          disabled: 'isDisabled',
         },{
           id: 'proacl', label: gettext('Privileges'), type: 'text',
-          mode: ['properties'], group: gettext('Security')
+          mode: ['properties'], group: gettext('Security'),
         },{
           id: 'arguments', label: gettext('Arguments'), cell: 'string',
           group: gettext('Arguments'), type: 'collection', canAdd: function(m){
@@ -315,15 +315,15 @@ define('pgadmin.node.function', [
           group: gettext('Parameters'), control: 'variable-collection',
           model: pgBrowser.Node.VariableModel,
           mode: ['edit', 'create'], canAdd: 'canVarAdd', canEdit: false,
-          canDelete: true, disabled: 'isDisabled'
+          canDelete: true, disabled: 'isDisabled',
         }, pgBrowser.SecurityGroupSchema, {
           id: 'acl', label: gettext('Privileges'), editable: false,
           model: pgBrowser.Node.PrivilegeRoleModel.extend({
-            privileges: ['X']
+            privileges: ['X'],
           }), uniqueCol : ['grantee', 'grantor'], type: 'collection',
           group: 'security', mode: ['edit', 'create'], canAdd: true,
           canDelete: true, control: 'unique-col-collection',
-          disabled: 'isDisabled'
+          disabled: 'isDisabled',
         },{
           id: 'seclabels', label: gettext('Security Labels'), canAdd: true,
           model: pgBrowser.SecLabelModel, type: 'collection',
@@ -331,15 +331,15 @@ define('pgadmin.node.function', [
           canEdit: false, canDelete: true, uniqueCol : ['provider'],
           disabled: 'isDisabled', control: 'unique-col-collection',
           visible: function() {
-            return this.node && this.node.type != "procedure";
-          }
-        }
+            return this.node && this.node.type != 'procedure';
+          },
+        },
         ],
         validate: function()
         {
           var err = {},
-              errmsg,
-              seclabels = this.get('seclabels');
+            errmsg,
+            seclabels = this.get('seclabels');
 
           if (_.isUndefined(this.get('name')) || String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
             err['name'] = gettext('Name cannot be empty.');
@@ -405,43 +405,36 @@ define('pgadmin.node.function', [
 
           return null;
         },
-        isVisible: function(m){
+        isVisible: function() {
           if (this.name == 'sysproc') { return false; }
           return true;
         },
-        isDisabled: function(m){
-          if(this.node_info &&  'catalog' in this.node_info) {
+        isDisabled: function(m) {
+          if(this.node_info && 'catalog' in this.node_info) {
             return true;
           }
-          name = this.name;
-          switch(name){
-            case 'proargs':
-            case 'proargtypenames':
-            case 'prorettypename':
-            case 'proretset':
-            case 'proiswindow':
-              return !m.isNew();
-              break;
-            case 'prorows':
-              if(m.get('proretset') == true) {
-                return false;
-              }
-              else {
-                return true;
-              }
-              break;
-            default:
+          switch(this.name){
+          case 'proargs':
+          case 'proargtypenames':
+          case 'prorettypename':
+          case 'proretset':
+          case 'proiswindow':
+            return !m.isNew();
+          case 'prorows':
+            if(m.get('proretset') == true) {
               return false;
-              break;
+            }
+            return true;
+          default:
+            return false;
           }
-          return false;
         },
-        canVarAdd: function(m) {
+        canVarAdd: function() {
           if(this.node_info &&  'catalog' in this.node_info) {
             return false;
           }
-         return true;
-        }
+          return true;
+        },
       }),
       canCreate: function(itemData, item, data) {
         //If check is false then , we will allow create menu
@@ -470,8 +463,8 @@ define('pgadmin.node.function', [
         }
         // by default we do not want to allow create menu
         return true;
-      }
-  });
+      },
+    });
 
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/procedure.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/procedure.js
index 17801de2..041b5091 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/procedure.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/procedure.js
@@ -3,19 +3,19 @@ define('pgadmin.node.procedure', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
   'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
   'pgadmin.node.function', 'pgadmin.browser.collection',
-  'pgadmin.browser.server.privilege'
+  'pgadmin.browser.server.privilege',
 ], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, Function) {
 
   if (!pgBrowser.Nodes['coll-procedure']) {
-    var procedures = pgAdmin.Browser.Nodes['coll-procedure'] =
+    pgAdmin.Browser.Nodes['coll-procedure'] =
       pgAdmin.Browser.Collection.extend({
         node: 'procedure',
         label: gettext('Procedures'),
         type: 'coll-procedure',
         columns: ['name', 'funcowner', 'description'],
-        hasStatistics: true
+        hasStatistics: true,
       });
-  };
+  }
 
   var pgSchemaNode = pgBrowser.Nodes['schema'];
 
@@ -36,7 +36,7 @@ define('pgadmin.node.procedure', [
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.proc_initialized)
-            return;
+          return;
 
         this.proc_initialized = true;
 
@@ -46,25 +46,25 @@ define('pgadmin.node.procedure', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Procedure...'),
           icon: 'wcTabIcon icon-procedure', data: {action: 'create', check:
-          false}, enable: 'canCreateProc'
+          false}, enable: 'canCreateProc',
         },{
           name: 'create_procedure', node: 'procedure', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Procedure...'),
           icon: 'wcTabIcon icon-procedure', data: {action: 'create', check:
-          true}, enable: 'canCreateProc'
+          true}, enable: 'canCreateProc',
         },{
           name: 'create_procedure', node: 'schema', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Procedure...'),
           icon: 'wcTabIcon icon-procedure', data: {action: 'create', check:
-          true}, enable: 'canCreateProc'
-        }
+          true}, enable: 'canCreateProc',
+        },
         ]);
       },
       canDrop: pgSchemaNode.canChildDrop,
       canDropCascade: false,
-      canCreateProc: function(itemData, item, data) {
+      canCreateProc: function(itemData, item) {
         var node_hierarchy = this.getTreeNodeHierarchy.apply(this, [item]);
 
         // Do not provide Create option in catalog
@@ -72,28 +72,28 @@ define('pgadmin.node.procedure', [
           return false;
 
         // Procedures supported only in PPAS
-        if ('server' in node_hierarchy && node_hierarchy['server'].server_type == "ppas")
-          return true;
-
-        return false;
+        return (
+          'server' in node_hierarchy &&
+            node_hierarchy['server'].server_type == 'ppas'
+        );
       },
       model: Function.model.extend({
         defaults: _.extend({},
           Function.model.prototype.defaults,
           {
-            lanname: 'edbspl'
+            lanname: 'edbspl',
           }
         ),
-        canVarAdd: function(m){
+        canVarAdd: function() {
           var server = this.node_info.server;
-            if (server.version < 90500) {
-              return false;
-           }
-           else {
-             return true;
-           }
+          if (server.version < 90500) {
+            return false;
+          }
+          else {
+            return true;
+          }
         },
-        isVisible: function(m){
+        isVisible: function() {
           if (this.name == 'sysfunc') { return false; }
           else if (this.name == 'sysproc') { return true; }
           return false;
@@ -102,46 +102,30 @@ define('pgadmin.node.procedure', [
           if(this.node_info &&  'catalog' in this.node_info) {
             return true;
           }
-          name = this.name;
-          switch(name){
-            case 'provolatility':
-            case 'proisstrict':
-            case 'prosecdef':
-            case 'procost':
-            case 'proleakproof':
-            case 'variables':
-               var server = this.node_info.server;
-               if (server.version < 90500) {
-                 return true;
-               }
-               else {
-                 return false;
-               }
-               break;
-            case 'prorows':
-              var server = this.node_info.server;
-              if(server.version >= 90500 && m.get('proretset') == true) {
-                return false;
-              }
-              else {
-                return true;
-              }
-              break;
-            case 'funcowner':
-            case 'lanname':
-            case 'proargs':
-              return true;
-            default:
-              return false;
-              break;
+          switch(this.name){
+          case 'provolatility':
+          case 'proisstrict':
+          case 'prosecdef':
+          case 'procost':
+          case 'proleakproof':
+          case 'variables':
+            return this.node_info.server.version < 90500;
+          case 'prorows':
+            var server = this.node_info.server;
+            return !(server.version >= 90500 && m.get('proretset') == true);
+          case 'funcowner':
+          case 'lanname':
+          case 'proargs':
+            return true;
+          default:
+            return false;
           }
-          return false;
-       },
-       validate: function()
+        },
+        validate: function()
         {
           var err = {},
-              errmsg,
-              seclabels = this.get('seclabels');
+            errmsg,
+            seclabels = this.get('seclabels');
 
           if (_.isUndefined(this.get('name')) || String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
             err['name'] = gettext('Name cannot be empty.');
@@ -179,8 +163,8 @@ define('pgadmin.node.procedure', [
 
           return null;
         },
-      })
-  });
+      }),
+    });
 
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/trigger_function.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/trigger_function.js
index dc85515c..aeb8271b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/trigger_function.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/trigger_function.js
@@ -1,20 +1,20 @@
 /* Create and Register Function Collection and Node. */
 define('pgadmin.node.trigger_function', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection', 'pgadmin.browser.server.privilege'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
+  'pgadmin.browser.collection', 'pgadmin.browser.server.privilege',
+], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform) {
 
   if (!pgBrowser.Nodes['coll-trigger_function']) {
-    var trigger_functions = pgBrowser.Nodes['coll-trigger_function'] =
+    pgBrowser.Nodes['coll-trigger_function'] =
       pgBrowser.Collection.extend({
         node: 'trigger_function',
         label: gettext('Trigger functions'),
         type: 'coll-trigger_function',
         columns: ['name', 'funcowner', 'description'],
-        hasStatistics: true
+        hasStatistics: true,
       });
-  };
+  }
 
   if (!pgBrowser.Nodes['trigger_function']) {
     pgBrowser.Nodes['trigger_function'] = pgBrowser.Node.extend({
@@ -28,10 +28,10 @@ define('pgadmin.node.trigger_function', [
       hasDepends: true,
       hasStatistics: true,
       parent_type: ['schema', 'catalog'],
-      Init: function(args) {
+      Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -40,20 +40,20 @@ define('pgadmin.node.trigger_function', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Trigger function...'),
           icon: 'wcTabIcon icon-trigger_function', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_trigger_function', node: 'trigger_function', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Trigger function...'),
           icon: 'wcTabIcon icon-trigger_function', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_trigger_function', node: 'schema', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Trigger function...'),
           icon: 'wcTabIcon icon-trigger_function', data: {action: 'create', check: false},
-          enable: 'canCreate'
-        }
+          enable: 'canCreate',
+        },
         ]);
 
       },
@@ -64,7 +64,7 @@ define('pgadmin.node.trigger_function', [
           var isNew = (_.size(attrs) === 0);
           if (isNew) {
             // Set Selected Schema
-            var schema_id = args.node_info.schema._id
+            var schema_id = args.node_info.schema._id;
             this.set({'pronamespace': schema_id}, {silent: true});
 
             // Set Current User
@@ -103,64 +103,67 @@ define('pgadmin.node.trigger_function', [
           seclabels: [],
           acl: [],
           sysfunc: undefined,
-          sysproc: undefined
+          sysproc: undefined,
         },
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'],
-          disabled: 'isDisabled'
+          disabled: 'isDisabled',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text' , mode: ['properties']
+          type: 'text' , mode: ['properties'],
         },{
           id: 'funcowner', label: gettext('Owner'), cell: 'string',
           control: Backform.NodeListByNameControl, node: 'role',  type:
-          'text', disabled: 'isDisabled'
+          'text', disabled: 'isDisabled',
         },{
           id: 'pronamespace', label: gettext('Schema'), cell: 'string',
           control: 'node-list-by-id', type: 'text', cache_level: 'database',
-          node: 'schema', disabled: 'isDisabled', mode: ['create', 'edit']
+          node: 'schema', disabled: 'isDisabled', mode: ['create', 'edit'],
         },{
           id: 'sysfunc', label: gettext('System function?'),
-           cell:'boolean', type: 'switch',
-           mode: ['properties'], visible: 'isVisible'
+          cell:'boolean', type: 'switch',
+          mode: ['properties'], visible: 'isVisible',
         },{
           id: 'sysproc', label: gettext('System procedure?'),
-           cell:'boolean', type: 'switch',
-           mode: ['properties'], visible: 'isVisible'
+          cell:'boolean', type: 'switch',
+          mode: ['properties'], visible: 'isVisible',
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
-          type: 'multiline', disabled: 'isDisabled'
+          type: 'multiline', disabled: 'isDisabled',
         },{
           id: 'pronargs', label: gettext('Argument count'), cell: 'string',
-          type: 'text', group: gettext('Definition'), mode: ['properties']
+          type: 'text', group: gettext('Definition'), mode: ['properties'],
         },{
           id: 'proargs', label: gettext('Arguments'), cell: 'string',
           type: 'text', group: gettext('Definition'), mode: ['properties', 'edit'],
-          disabled: 'isDisabled'
+          disabled: 'isDisabled',
         },{
           id: 'proargtypenames', label: gettext('Signature arguments'), cell:
           'string', type: 'text', group: gettext('Definition'), mode: ['properties'],
-          disabled: 'isDisabled'
+          disabled: 'isDisabled',
         },{
           id: 'prorettypename', label: gettext('Return type'), cell: 'string',
           control: 'select2', type: 'text', group: gettext('Definition'),
           disabled: 'isDisabled', first_empty: true,
-          select2: { width: "100%", allowClear: false },
+          select2: { width: '100%', allowClear: false },
           mode: ['create'], visible: 'isVisible', options: [
             {label: gettext('trigger'), value: 'trigger'},
-            {label: gettext('event_trigger'), value: 'event_trigger'}
-          ]
+            {label: gettext('event_trigger'), value: 'event_trigger'},
+          ],
         },{
           id: 'prorettypename', label: gettext('Return type'), cell: 'string',
           type: 'text', group: gettext('Definition'),
-          mode: ['properties', 'edit'], disabled: 'isDisabled', visible: 'isVisible'
+          mode: ['properties', 'edit'], disabled: 'isDisabled', visible: 'isVisible',
         },  {
           id: 'lanname', label: gettext('Language'), cell: 'string',
           control: 'node-ajax-options', type: 'text', group: gettext('Definition'),
-          url: 'get_languages', disabled: 'isDisabled', transform: function(d, self) {
-             return _.reject(d, function(o){ return o.label == 'sql' || o.label == 'edbspl'; });
-          }, select2: { allowClear: false }
+          url: 'get_languages', disabled: 'isDisabled',
+          transform: function(d) {
+            return _.reject(d, function(o) {
+              return o.label == 'sql' || o.label == 'edbspl';
+            });
+          }, select2: { allowClear: false },
         },{
           id: 'prosrc', label: gettext('Code'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'],
@@ -172,21 +175,21 @@ define('pgadmin.node.trigger_function', [
               return false;
             }
             return true;
-          }, disabled: 'isDisabled'
+          }, disabled: 'isDisabled',
         },{
           id: 'probin', label: gettext('Object file'), cell: 'string',
           type: 'text', group: gettext('Definition'), deps: ['lanname'], visible:
           function(m) {
             if (m.get('lanname') == 'c') { return true; }
             return false;
-          }, disabled: 'isDisabled'
+          }, disabled: 'isDisabled',
         },{
           id: 'prosrc_c', label: gettext('Link symbol'), cell: 'string',
           type: 'text', group: gettext('Definition'),  deps: ['lanname'], visible:
           function(m) {
             if (m.get('lanname') == 'c') { return true; }
             return false;
-          }, disabled: 'isDisabled'
+          }, disabled: 'isDisabled',
         },{
           id: 'provolatile', label: gettext('Volatility'), cell: 'string',
           control: 'node-ajax-options', type: 'text', group: gettext('Options'),
@@ -194,67 +197,67 @@ define('pgadmin.node.trigger_function', [
             {'label': 'VOLATILE', 'value': 'v'},
             {'label': 'STABLE', 'value': 's'},
             {'label': 'IMMUTABLE', 'value': 'i'},
-          ], disabled: 'isDisabled', select2: { allowClear: false }
+          ], disabled: 'isDisabled', select2: { allowClear: false },
         },{
           id: 'proretset', label: gettext('Returns a set?'), type: 'switch',
           group: gettext('Options'), disabled: 'isDisabled',
-          visible: 'isVisible'
+          visible: 'isVisible',
         },{
           id: 'proisstrict', label: gettext('Strict?'), type: 'switch',
           disabled: 'isDisabled', group: gettext('Options'),
           options: {
             'onText': gettext('Yes'), 'offText': gettext('No'),
             'onColor': 'success', 'offColor': 'primary',
-            'size': 'small'
-           }
+            'size': 'small',
+          },
         },{
           id: 'prosecdef', label: gettext('Security of definer?'),
-           group: gettext('Options'), cell:'boolean', type: 'switch',
-           disabled: 'isDisabled'
+          group: gettext('Options'), cell:'boolean', type: 'switch',
+          disabled: 'isDisabled',
         },{
           id: 'proiswindow', label: gettext('Window?'),
-           group: gettext('Options'), cell:'boolean', type: 'switch',
-            disabled: 'isDisabled', visible: 'isVisible'
+          group: gettext('Options'), cell:'boolean', type: 'switch',
+          disabled: 'isDisabled', visible: 'isVisible',
         },{
           id: 'procost', label: gettext('Estimated cost'), type: 'text',
-          group: gettext('Options'), disabled: 'isDisabled'
+          group: gettext('Options'), disabled: 'isDisabled',
         },{
           id: 'prorows', label: gettext('Estimated rows'), type: 'text',
           group: gettext('Options'),
           disabled: 'isDisabled',
-          deps: ['proretset'], visible: 'isVisible'
+          deps: ['proretset'], visible: 'isVisible',
         },{
           id: 'proleakproof', label: gettext('Leak proof?'),
           group: gettext('Options'), cell:'boolean', type: 'switch', min_version: 90200,
-          disabled: 'isDisabled'
+          disabled: 'isDisabled',
         }, pgBrowser.SecurityGroupSchema, {
           id: 'proacl', label: gettext('Privileges'), mode: ['properties'],
-           group: gettext('Security'), type: 'text'
+          group: gettext('Security'), type: 'text',
         },{
           id: 'variables', label: gettext('Parameters'), type: 'collection',
           group: gettext('Parameters'), control: 'variable-collection',
           model: pgBrowser.Node.VariableModel,
           mode: ['edit', 'create'], canAdd: 'canVarAdd', canEdit: false,
-          canDelete: true, disabled: 'isDisabled'
-         },{
+          canDelete: true, disabled: 'isDisabled',
+        },{
           id: 'acl', label: gettext('Privileges'), editable: false,
           type: 'collection', group: 'security', mode: ['edit', 'create'],
           model: pgBrowser.Node.PrivilegeRoleModel.extend({
-            privileges: ['X']
+            privileges: ['X'],
           }), uniqueCol : ['grantee', 'grantor'], disabled: 'isDisabled',
-          canAdd: true, canDelete: true, control: 'unique-col-collection'
+          canAdd: true, canDelete: true, control: 'unique-col-collection',
         },{
           id: 'seclabels', label: gettext('Security Labels'), canEdit: true,
           model: pgBrowser.SecLabelModel, type: 'collection',
           min_version: 90100, group: 'security', mode: ['edit', 'create'],
-           canDelete: true, control: 'unique-col-collection', canAdd: true,
-          uniqueCol : ['provider'], disabled: 'isDisabled'
+          canDelete: true, control: 'unique-col-collection', canAdd: true,
+          uniqueCol : ['provider'], disabled: 'isDisabled',
         }],
         validate: function(keys)
         {
           var err = {},
-              errmsg,
-              seclabels = this.get('seclabels');
+            errmsg,
+            seclabels = this.get('seclabels');
 
           // Nothing to validate
           if(keys && keys.length == 0) {
@@ -326,43 +329,33 @@ define('pgadmin.node.trigger_function', [
 
           return null;
         },
-        isVisible: function(m){
+        isVisible: function() {
           if (this.name == 'sysproc') { return false; }
           return true;
         },
-        isDisabled: function(m){
+        isDisabled: function(m) {
           if(this.node_info &&  'catalog' in this.node_info) {
             return true;
           }
-          name = this.name;
-          switch(name){
-            case 'proargs':
-            case 'proargtypenames':
-            case 'prorettypename':
-            case 'proretset':
-            case 'proiswindow':
-              return !m.isNew();
-              break;
-            case 'prorows':
-              if(m.get('proretset') == true) {
-                return false;
-              }
-              else {
-                return true;
-              }
-              break;
-            default:
+          switch(this.name){
+          case 'proargs':
+          case 'proargtypenames':
+          case 'prorettypename':
+          case 'proretset':
+          case 'proiswindow':
+            return !m.isNew();
+          case 'prorows':
+            if(m.get('proretset') == true) {
               return false;
-              break;
-          }
-          return false;
-        },
-        canVarAdd: function(m) {
-          if(this.node_info &&  'catalog' in this.node_info) {
+            }
+            return true;
+          default:
             return false;
           }
-         return true;
-        }
+        },
+        canVarAdd: function() {
+          return !(this.node_info &&  'catalog' in this.node_info);
+        },
       }),
       canCreate: function(itemData, item, data) {
         //If check is false then , we will allow create menu
@@ -391,8 +384,8 @@ define('pgadmin.node.trigger_function', [
         }
         // by default we do not want to allow create menu
         return true;
-      }
-  });
+      },
+    });
 
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/edbfuncs/static/js/edbfunc.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/edbfuncs/static/js/edbfunc.js
index c9b20b89..7ea20063 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/edbfuncs/static/js/edbfunc.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/edbfuncs/static/js/edbfunc.js
@@ -1,9 +1,9 @@
 /* Create and Register Function Collection and Node. */
 define('pgadmin.node.edbfunc', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection', 'pgadmin.browser.server.privilege'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
+  'pgadmin.browser.collection', 'pgadmin.browser.server.privilege',
+], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform) {
 
   if (!pgBrowser.Nodes['coll-edbfunc']) {
     pgBrowser.Nodes['coll-edbfunc'] =
@@ -11,9 +11,9 @@ define('pgadmin.node.edbfunc', [
         node: 'edbfunc',
         label: gettext('Functions'),
         type: 'coll-edbfunc',
-        columns: ['name', 'funcowner', 'description']
+        columns: ['name', 'funcowner', 'description'],
       });
-  };
+  }
 
   if (!pgBrowser.Nodes['edbfunc']) {
     pgBrowser.Nodes['edbfunc'] = pgBrowser.Node.extend({
@@ -26,10 +26,10 @@ define('pgadmin.node.edbfunc', [
       hasSQL: true,
       hasScriptTypes: [],
       parent_type: ['package'],
-      Init: function(args) {
+      Init: function() {
         /* Avoid multiple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -48,40 +48,40 @@ define('pgadmin.node.edbfunc', [
           lanname: 'sql', /* Language Name in which function is being written */
           prosrc: undefined,
           proacl: undefined,
-          visibility: 'Unknown'
+          visibility: 'Unknown',
         },
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
           type: 'text', mode: ['properties'],
-          disabled: true
+          disabled: true,
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text' , mode: ['properties']
+          type: 'text' , mode: ['properties'],
         },{
           id: 'funcowner', label: gettext('Owner'), cell: 'string',
-          type: 'text', disabled: true
+          type: 'text', disabled: true,
         },{
           id: 'pronargs', label: gettext('Argument count'), cell: 'string',
-          type: 'text', group: gettext('Definition'), mode: ['properties']
+          type: 'text', group: gettext('Definition'), mode: ['properties'],
         },{
           id: 'proargs', label: gettext('Arguments'), cell: 'string',
           type: 'text', group: gettext('Definition'), mode: ['properties'],
-          disabled: true
+          disabled: true,
         },{
           id: 'proargtypenames', label: gettext('Signature arguments'), cell:
           'string', type: 'text', group: gettext('Definition'), mode: ['properties'],
-          disabled: true
+          disabled: true,
         },{
           id: 'prorettypename', label: gettext('Return type'), cell: 'string',
           type: 'text', group: gettext('Definition'), disabled: true,
-          mode: ['properties'], visible: 'isVisible'
+          mode: ['properties'], visible: 'isVisible',
         },{
           id: 'visibility', label: gettext('Visibility'), cell: 'string',
           type: 'text', mode: ['properties'],
-          disabled: true
+          disabled: true,
         },{
           id: 'lanname', label: gettext('Language'), cell: 'string',
-          type: 'text', group: gettext('Definition'), disabled: true
+          type: 'text', group: gettext('Definition'), disabled: true,
         },{
           id: 'prosrc', label: gettext('Code'), cell: 'string',
           type: 'text', mode: ['properties'],
@@ -93,18 +93,15 @@ define('pgadmin.node.edbfunc', [
               return false;
             }
             return true;
-          }, disabled: true
+          }, disabled: true,
         }],
-        validate: function()
-        {
-          return null;
-        },
-        isVisible: function(m){
+        validate: function() { return null; },
+        isVisible: function() {
           if (this.name == 'sysproc') { return false; }
           return true;
-        }
-      })
-  });
+        },
+      }),
+    });
 
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/edbfuncs/static/js/edbproc.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/edbfuncs/static/js/edbproc.js
index cb37acff..9109e668 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/edbfuncs/static/js/edbproc.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/edbfuncs/static/js/edbproc.js
@@ -1,11 +1,11 @@
 /* Create and Register Procedure Collection and Node. */
 define('pgadmin.node.edbproc', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
+  'sources/pgadmin', 'pgadmin.browser',
   'pgadmin.node.edbfunc', 'pgadmin.browser.collection',
-  'pgadmin.browser.server.privilege'
+  'pgadmin.browser.server.privilege',
 ], function(
-  gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, EdbFunction
+  gettext, url_for, $, _, pgAdmin, pgBrowser, EdbFunction
 ) {
 
   if (!pgBrowser.Nodes['coll-edbproc']) {
@@ -15,9 +15,9 @@ define('pgadmin.node.edbproc', [
         label: gettext('Procedures'),
         type: 'coll-edbproc',
         columns: ['name', 'funcowner', 'description'],
-        hasStatistics: true
+        hasStatistics: true,
       });
-  };
+  }
 
   // Inherit Functions Node
   if (!pgBrowser.Nodes['edbproc']) {
@@ -34,7 +34,7 @@ define('pgadmin.node.edbproc', [
       Init: function() {
         /* Avoid multiple registration of menus */
         if (this.proc_initialized)
-            return;
+          return;
 
         this.proc_initialized = true;
 
@@ -45,10 +45,10 @@ define('pgadmin.node.edbproc', [
         defaults: _.extend({},
           EdbFunction.model.prototype.defaults,
           {
-            lanname: 'edbspl'
+            lanname: 'edbspl',
           }
         ),
-        isVisible: function(m){
+        isVisible: function() {
           if (this.name == 'sysfunc') { return false; }
           else if (this.name == 'sysproc') { return true; }
           return false;
@@ -56,10 +56,10 @@ define('pgadmin.node.edbproc', [
         validate: function()
         {
           return null;
-        }
+        },
       }
-      )
-  });
+      ),
+    });
 
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/edbvars/static/js/edbvar.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/edbvars/static/js/edbvar.js
index fb77a2ce..7efa0540 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/edbvars/static/js/edbvar.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/edbvars/static/js/edbvar.js
@@ -1,9 +1,9 @@
 /* Create and Register Function Collection and Node. */
 define('pgadmin.node.edbvar', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection', 'pgadmin.browser.server.privilege'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'sources/pgadmin', 'pgadmin.browser',
+  'pgadmin.browser.collection', 'pgadmin.browser.server.privilege',
+], function(gettext, url_for, $, _, pgAdmin, pgBrowser) {
 
   if (!pgBrowser.Nodes['coll-edbvar']) {
     pgBrowser.Nodes['coll-edbvar'] =
@@ -11,9 +11,9 @@ define('pgadmin.node.edbvar', [
         node: 'edbvar',
         label: gettext('Variables'),
         type: 'coll-edbvar',
-        columns: ['name', 'funcowner', 'description']
+        columns: ['name', 'funcowner', 'description'],
       });
-  };
+  }
 
   if (!pgBrowser.Nodes['edbvar']) {
     pgBrowser.Nodes['edbvar'] = pgBrowser.Node.extend({
@@ -25,10 +25,10 @@ define('pgadmin.node.edbvar', [
       hasSQL: true,
       hasScriptTypes: [],
       parent_type: ['package'],
-      Init: function(args) {
+      Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -40,29 +40,29 @@ define('pgadmin.node.edbvar', [
           name: undefined,
           oid: undefined,
           datatype: undefined,
-          visibility: 'Unknown'
+          visibility: 'Unknown',
         },
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
           type: 'text', mode: ['properties'],
-          disabled: true
+          disabled: true,
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text' , mode: ['properties']
+          type: 'text' , mode: ['properties'],
         },{
           id: 'datatype', label: gettext('Data type'), cell: 'string',
-          type: 'text', disabled: true
+          type: 'text', disabled: true,
         },{
           id: 'visibility', label: gettext('Visibility'), cell: 'string',
           type: 'text', mode: ['properties'],
-          disabled: true
+          disabled: true,
         }],
         validate: function()
         {
           return null;
-        }
-      })
-  });
+        },
+      }),
+    });
 
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/static/js/package.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/static/js/package.js
index ba793095..282d507c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/static/js/package.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/static/js/package.js
@@ -1,19 +1,19 @@
 define('pgadmin.node.package', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
+  'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform) {
 
   // Extend the browser's collection class for package collection
   if (!pgBrowser.Nodes['coll-package']) {
-    var databases = pgBrowser.Nodes['coll-package'] =
+    pgBrowser.Nodes['coll-package'] =
       pgBrowser.Collection.extend({
         node: 'package',
         label: gettext('Packages'),
         type: 'coll-package',
-        columns: ['name' ,'owner', 'description']
+        columns: ['name' ,'owner', 'description'],
       });
-  };
+  }
 
   // Extend the browser's node class for package node
   if (!pgBrowser.Nodes['package']) {
@@ -28,7 +28,7 @@ define('pgadmin.node.package', [
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -37,20 +37,20 @@ define('pgadmin.node.package', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Package...'),
           icon: 'wcTabIcon icon-package', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_package', node: 'package', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Package...'),
           icon: 'wcTabIcon icon-package', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_package', node: 'schema', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Package...'),
           icon: 'wcTabIcon icon-package', data: {action: 'create', check: true},
-          enable: 'canCreate'
-        }
+          enable: 'canCreate',
+        },
         ]);
 
       },
@@ -58,21 +58,21 @@ define('pgadmin.node.package', [
       canDropCascade: pgBrowser.Nodes['schema'].canChildDrop,
       canCreate: function(itemData, item, data) {
           //If check is false then , we will allow create menu
-          if (data && data.check == false)
-            return true;
+        if (data && data.check == false)
+          return true;
 
-          var treeData = this.getTreeNodeHierarchy(item),
-                server = treeData['server'];
+        var treeData = this.getTreeNodeHierarchy(item),
+          server = treeData['server'];
 
-          if (server && server.server_type === 'pg')
-            return false;
+        if (server && server.server_type === 'pg')
+          return false;
 
           // If it is catalog then don't allow user to create package
-          if (treeData['catalog'] != undefined)
-            return false;
+        if (treeData['catalog'] != undefined)
+          return false;
 
           // by default we want to allow create menu
-          return true;
+        return true;
       },
       // Define the model for package node.
       model: pgBrowser.Node.Model.extend({
@@ -85,7 +85,7 @@ define('pgadmin.node.package', [
           pkgheadsrc: undefined,
           pkgbodysrc: undefined,
           acl: undefined,
-          pkgacl: []
+          pkgacl: [],
         },
         initialize: function(attrs, args) {
           if (_.size(attrs) === 0) {
@@ -93,7 +93,7 @@ define('pgadmin.node.package', [
             var schemaInfo = args.node_info.schema;
 
             this.set({
-              'owner': userInfo.name, 'schema': schemaInfo._label
+              'owner': userInfo.name, 'schema': schemaInfo._label,
             }, {silent: true});
           }
           pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments);
@@ -104,16 +104,16 @@ define('pgadmin.node.package', [
           type: 'text', mode: ['properties', 'create', 'edit'],
           disabled: function(m) {
             return !m.isNew();
-          }
+          },
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text', mode: ['properties']
+          type: 'text', mode: ['properties'],
         },{
           id: 'owner', label: gettext('Owner'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'],
           disabled: true, editable: false, visible: function(m) {
             return !m.isNew();
-          }
+          },
         },{
           id: 'schema', label: gettext('Schema'), type: 'text', node: 'schema',
           control: 'node-list-by-name',
@@ -124,28 +124,28 @@ define('pgadmin.node.package', [
               return false;
             }
             return true;
-          }, cache_node: 'database', cache_level: 'database'
+          }, cache_node: 'database', cache_level: 'database',
         },{
           id: 'is_sys_object', label: gettext('System package?'),
-           cell:'boolean', type: 'switch',mode: ['properties']
+          cell:'boolean', type: 'switch',mode: ['properties'],
         },{
           id: 'description', label: gettext('Comment'), type: 'multiline',
-          mode: ['properties', 'create', 'edit']
+          mode: ['properties', 'create', 'edit'],
         },{
           id: 'pkgheadsrc', label: gettext('Header'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'], group: gettext('Code'),
-          control: Backform.SqlFieldControl
+          control: Backform.SqlFieldControl,
         },{
           id: 'pkgbodysrc', label: gettext('Body'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'], group: gettext('Code'),
-          control: Backform.SqlFieldControl
+          control: Backform.SqlFieldControl,
         },{
           id: 'acl', label: gettext('Privileges'), type: 'text',
-          group: gettext('Security'), mode: ['properties',]
+          group: gettext('Security'), mode: ['properties'],
         },{
           id: 'pkgacl', label: gettext('Privileges'), type: 'collection',
           model: pgBrowser.Node.PrivilegeRoleModel.extend({
-            privileges: ['X']
+            privileges: ['X'],
           }), uniqueCol : ['grantee', 'grantor'], editable: false,
           group: gettext('Security'), mode: ['edit', 'create'],
           canAdd: true, canDelete: true, control: 'unique-col-collection',
@@ -174,8 +174,8 @@ define('pgadmin.node.package', [
           }
 
           return null;
-        }
-      })
+        },
+      }),
     });
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/static/js/sequence.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/static/js/sequence.js
index 959074c2..57c95acd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/static/js/sequence.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/static/js/sequence.js
@@ -1,20 +1,20 @@
 define('pgadmin.node.sequence', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
+  'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform) {
 
   // Extend the browser's collection class for sequence collection
   if (!pgBrowser.Nodes['coll-sequence']) {
-    var databases = pgBrowser.Nodes['coll-sequence'] =
+    pgBrowser.Nodes['coll-sequence'] =
       pgBrowser.Collection.extend({
         node: 'sequence',
         label: gettext('Sequences'),
         type: 'coll-sequence',
         columns: ['name', 'seqowner', 'comment'],
-        hasStatistics: true
+        hasStatistics: true,
       });
-  };
+  }
 
   // Extend the browser's node class for sequence node
   if (!pgBrowser.Nodes['sequence']) {
@@ -32,7 +32,7 @@ define('pgadmin.node.sequence', [
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -41,20 +41,20 @@ define('pgadmin.node.sequence', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Sequence...'),
           icon: 'wcTabIcon icon-sequence', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_sequence', node: 'sequence', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Sequence...'),
           icon: 'wcTabIcon icon-sequence', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_sequence', node: 'schema', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Sequence...'),
           icon: 'wcTabIcon icon-sequence', data: {action: 'create', check: false},
-          enable: 'canCreate'
-        }
+          enable: 'canCreate',
+        },
         ]);
 
       },
@@ -62,31 +62,31 @@ define('pgadmin.node.sequence', [
       canDropCascade: pgBrowser.Nodes['schema'].canChildDrop,
       canCreate: function(itemData, item, data) {
           //If check is false then , we will allow create menu
-          if (data && data.check == false)
-            return true;
+        if (data && data.check == false)
+          return true;
 
-          var t = pgBrowser.tree, i = item, d = itemData;
+        var t = pgBrowser.tree, i = item, d = itemData;
           // To iterate over tree to check parent node
-          while (i) {
+        while (i) {
             // If it is schema then allow user to create collation
-            if (_.indexOf(['schema'], d._type) > -1)
-              return true;
+          if (_.indexOf(['schema'], d._type) > -1)
+            return true;
 
-            if ('coll-sequence' == d._type) {
+          if ('coll-sequence' == d._type) {
               //Check if we are not child of catalog
-              var prev_i = t.hasParent(i) ? t.parent(i) : null,
-                prev_d = prev_i ? t.itemData(prev_i) : null;
-              if( prev_d._type == 'catalog') {
-                return false;
-              } else {
-                return true;
-              }
+            var prev_i = t.hasParent(i) ? t.parent(i) : null,
+              prev_d = prev_i ? t.itemData(prev_i) : null;
+            if( prev_d._type == 'catalog') {
+              return false;
+            } else {
+              return true;
             }
-            i = t.hasParent(i) ? t.parent(i) : null;
-            d = i ? t.itemData(i) : null;
           }
+          i = t.hasParent(i) ? t.parent(i) : null;
+          d = i ? t.itemData(i) : null;
+        }
           // by default we want to allow create menu
-          return true;
+        return true;
       },
       // Define the model for sequence node.
       model: pgBrowser.Node.Model.extend({
@@ -104,7 +104,7 @@ define('pgadmin.node.sequence', [
           cache: undefined,
           cycled: undefined,
           relacl: [],
-          securities: []
+          securities: [],
         },
 
         // Default values!
@@ -124,14 +124,14 @@ define('pgadmin.node.sequence', [
         // Define the schema for sequence node.
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text', mode: ['properties', 'create', 'edit']
+          type: 'text', mode: ['properties', 'create', 'edit'],
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text', mode: ['properties']
+          type: 'text', mode: ['properties'],
         },{
           id: 'seqowner', label: gettext('Owner'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'], node: 'role',
-          control: Backform.NodeListByNameControl
+          control: Backform.NodeListByNameControl,
         },{
           id: 'schema', label: gettext('Schema'), cell: 'string',
           control: 'node-list-by-name', node: 'schema',
@@ -142,48 +142,48 @@ define('pgadmin.node.sequence', [
               return false;
             }
             return true;
-          }, cache_node: 'database', cache_level: 'database'
+          }, cache_node: 'database', cache_level: 'database',
         },{
           id: 'comment', label: gettext('Comment'), type: 'multiline',
-          mode: ['properties', 'create', 'edit']
+          mode: ['properties', 'create', 'edit'],
         },{
           id: 'current_value', label: gettext('Current value'), type: 'int',
-          mode: ['properties', 'edit'], group: gettext('Definition')
+          mode: ['properties', 'edit'], group: gettext('Definition'),
         },{
           id: 'increment', label: gettext('Increment'), type: 'int',
           mode: ['properties', 'create', 'edit'], group: gettext('Definition'),
-          min: 1
+          min: 1,
         },{
           id: 'start', label: gettext('Start'), type: 'int',
           mode: ['properties', 'create'], group: gettext('Definition'),
           disabled: function(m) {
             return !m.isNew();
-          }
+          },
         },{
           id: 'minimum', label: gettext('Minimum'), type: 'int',
-          mode: ['properties', 'create', 'edit'], group: gettext('Definition')
+          mode: ['properties', 'create', 'edit'], group: gettext('Definition'),
         },{
           id: 'maximum', label: gettext('Maximum'), type: 'int',
-          mode: ['properties', 'create', 'edit'], group: gettext('Definition')
+          mode: ['properties', 'create', 'edit'], group: gettext('Definition'),
         },{
           id: 'cache', label: gettext('Cache'), type: 'int',
           mode: ['properties', 'create', 'edit'], group: gettext('Definition'),
-          min: 1
+          min: 1,
         },{
           id: 'cycled', label: gettext('Cycled'), type: 'switch',
           mode: ['properties', 'create', 'edit'], group: gettext('Definition'),
           options: {
             'onText': gettext('Yes'), 'offText': gettext('No'),
             'onColor': 'success', 'offColor': 'primary',
-            'size': 'small'
-          }
+            'size': 'small',
+          },
         }, pgBrowser.SecurityGroupSchema,{
           id: 'acl', label: gettext('Privileges'), type: 'text',
-          group: gettext('Security'), mode: ['properties'], disabled: true
+          group: gettext('Security'), mode: ['properties'], disabled: true,
         },{
           id: 'relacl', label: gettext('Privileges'), group: 'security',
           model: pgBrowser.Node.PrivilegeRoleModel.extend({
-            privileges: ['r', 'w', 'U']
+            privileges: ['r', 'w', 'U'],
           }), uniqueCol : ['grantee', 'grantor'], mode: ['edit', 'create'],
           editable: false, type: 'collection', canAdd: true, canDelete: true,
           control: 'unique-col-collection',
@@ -193,7 +193,7 @@ define('pgadmin.node.sequence', [
           type: 'collection', canEdit: false, group: 'security',
           mode: ['edit', 'create'], canDelete: true,
           control: 'unique-col-collection',
-          min_version: 90200, uniqueCol : ['provider']
+          min_version: 90200, uniqueCol : ['provider'],
         }],
         /* validate function is used to validate the input given by
          * the user. In case of error, message will be displayed on
@@ -201,9 +201,9 @@ define('pgadmin.node.sequence', [
          */
         validate: function() {
           var msg = undefined,
-              minimum = this.get('minimum'),
-              maximum = this.get('maximum'),
-              start = this.get('start');
+            minimum = this.get('minimum'),
+            maximum = this.get('maximum'),
+            start = this.get('start');
 
           if (_.isUndefined(this.get('name'))
               || String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
@@ -279,8 +279,8 @@ define('pgadmin.node.sequence', [
             }
           }
           var min_lt = gettext('Minimum value must be less than maximum value.'),
-              start_lt = gettext('Start value cannot be less than minimum value.'),
-              start_gt = gettext('Start value cannot be greater than maximum value.');
+            start_lt = gettext('Start value cannot be less than minimum value.'),
+            start_gt = gettext('Start value cannot be greater than maximum value.');
 
           if ((minimum == 0 && maximum == 0) ||
               (parseInt(minimum, 10) >= parseInt(maximum, 10))) {
@@ -304,8 +304,8 @@ define('pgadmin.node.sequence', [
             this.errorModel.unset('start');
           }
           return null;
-        }
-      })
+        },
+      }),
     });
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/static/js/catalog.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/static/js/catalog.js
index ec771e25..a5a91ac8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/static/js/catalog.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/static/js/catalog.js
@@ -1,18 +1,18 @@
 define('pgadmin.node.catalog', [
-  'sources/gettext', 'jquery', 'underscore', 'underscore.string', 'sources/pgadmin',
-  'pgadmin.browser', 'backform', 'alertify', 'pgadmin.browser.collection'
-], function(gettext, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
+  'sources/gettext', 'jquery', 'underscore', 'sources/pgadmin',
+  'pgadmin.browser', 'pgadmin.browser.collection',
+], function(gettext, $, _, pgAdmin, pgBrowser) {
 
   // Extend the browser's collection class for catalog collection
   if (!pgBrowser.Nodes['coll-catalog']) {
-    var databases = pgBrowser.Nodes['coll-catalog'] =
+    pgBrowser.Nodes['coll-catalog'] =
       pgBrowser.Collection.extend({
         node: 'catalog',
         label: gettext('Catalogs'),
         type: 'coll-catalog',
-        columns: ['name', 'namespaceowner', 'description']
+        columns: ['name', 'namespaceowner', 'description'],
       });
-  };
+  }
   // Extend the browser's node class for catalog node
   if (!pgBrowser.Nodes['catalog']) {
     pgBrowser.Nodes['catalog'] = pgBrowser.Node.extend({
@@ -24,7 +24,7 @@ define('pgadmin.node.catalog', [
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -35,7 +35,7 @@ define('pgadmin.node.catalog', [
           namespaceowner: undefined,
           nspacl: undefined,
           description: undefined,
-          securitylabel: []
+          securitylabel: [],
         },
         initialize: function(attrs, args) {
           var isNew = (_.size(attrs) === 0);
@@ -49,32 +49,32 @@ define('pgadmin.node.catalog', [
         },
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text', disabled: true
+          type: 'text', disabled: true,
         },{
           id: 'oid', label: gettext('OID'), cell: 'string', mode: ['properties'],
-          type: 'text', disabled: true
+          type: 'text', disabled: true,
         },{
           id: 'namespaceowner', label: gettext('Owner'), cell: 'string',
-          type: 'text', disabled: true
+          type: 'text', disabled: true,
         },{
           id: 'acl', label: gettext('Privileges'), type: 'text',
-          group: gettext('Security'), mode: ['properties'], disabled: true
+          group: gettext('Security'), mode: ['properties'], disabled: true,
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
-          type: 'multiline'
-       },{
+          type: 'multiline',
+        },{
           id: 'seclabels', label: gettext('Security Labels'),
           model: pgBrowser.SecLabelModel, editable: false, type: 'collection',
           group: gettext('Security'), mode: ['edit', 'create'],
           min_version: 90200, canAdd: true,
-          canEdit: false, canDelete: true, control: 'unique-col-collection'
-         }
+          canEdit: false, canDelete: true, control: 'unique-col-collection',
+        },
         ],
         validate: function() {
           return null;
-        }
-      })
-  });
+        },
+      }),
+    });
 
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/static/js/schema.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/static/js/schema.js
index 07887ae3..a7fd4c7c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/static/js/schema.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/static/js/schema.js
@@ -1,119 +1,112 @@
 define('pgadmin.node.schema', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'backform', 'alertify',
-  'pgadmin.browser.collection', 'pgadmin.browser.server.privilege'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform', 'pgadmin.backgrid',
+  'pgadmin.browser.collection', 'pgadmin.browser.server.privilege',
+], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, Backgrid) {
 
   // VacuumSettings Collection to display all settings parameters as Grid
-  var VacuumCollectionControl = Backform.VacuumCollectionControl =
+  Backform.VacuumCollectionControl =
     Backform.Control.extend({
 
-    grid_columns:undefined,
+      grid_columns:undefined,
 
-    initialize: function() {
-      Backform.Control.prototype.initialize.apply(this, arguments);
-      var self = this,
+      initialize: function() {
+        Backform.Control.prototype.initialize.apply(this, arguments);
+        var self = this,
           m = this.model,
           url = self.field.get('url');
 
-      if (url && m.isNew()) {
-        var node = self.field.get('node'),
+        if (url && m.isNew()) {
+          var node = self.field.get('node'),
             node_data = self.field.get('node_data'),
             node_info = self.field.get('node_info'),
             full_url = node.generate_url.apply(
               node, [
-                null, url, node_data, false, node_info
+                null, url, node_data, false, node_info,
               ]),
             data;
-        m.trigger('pgadmin-view:fetching', m, self.field);
+          m.trigger('pgadmin-view:fetching', m, self.field);
 
         // fetch default values for autovacuum fields
-        $.ajax({
-          async: false,
-          url: full_url,
-          success: function (res) {
-            data = res;
-          },
-          error: function() {
-            m.trigger('pgadmin-view:fetch:error', m, self.field);
-          }
-        });
-        m.trigger('pgadmin-view:fetched', m, self.field);
+          $.ajax({
+            async: false,
+            url: full_url,
+            success: function (res) {
+              data = res;
+            },
+            error: function() {
+              m.trigger('pgadmin-view:fetch:error', m, self.field);
+            },
+          });
+          m.trigger('pgadmin-view:fetched', m, self.field);
 
         // Add fetched models into collection
-        if (data && _.isArray(data)) {
-          m.get(self.field.get('name')).reset(data, {silent: true});
+          if (data && _.isArray(data)) {
+            m.get(self.field.get('name')).reset(data, {silent: true});
+          }
         }
-      }
-    },
+      },
 
-    render: function() {
-      var self = this,
-          m = this.model,
+      render: function() {
+        var self = this,
           attributes = self.field.attributes;
 
       // remove grid
-      if(self.grid) {
-        self.grid.remove();
-        delete self.grid;
-        self.grid = undefined;
-      }
+        if(self.grid) {
+          self.grid.remove();
+          delete self.grid;
+          self.grid = undefined;
+        }
 
-      self.$el.empty();
+        self.$el.empty();
 
-      var gridHeader = _.template([
-          '<div class="subnode-header">',
-          '  <label class="control-label col-sm-4"><%-label%></label>',
-          '</div>'].join("\n")),
+        var gridHeader = _.template([
+            '<div class="subnode-header">',
+            '  <label class="control-label col-sm-4"><%-label%></label>',
+            '</div>'].join('\n')),
           gridBody = $('<div class="pgadmin-control-group backgrid form-group col-xs-12 object subnode"></div>').append(
               gridHeader(attributes)
               );
 
       // Initialize a new Grid instance
-      var grid = self.grid = new Backgrid.Grid({
-        columns: self.grid_columns,
-        collection: self.model.get(self.field.get('name')),
-        className: "backgrid table-bordered"
-      });
+        var grid = self.grid = new Backgrid.Grid({
+          columns: self.grid_columns,
+          collection: self.model.get(self.field.get('name')),
+          className: 'backgrid table-bordered',
+        });
 
       // render grid
-      self.$el.append($(gridBody).append(grid.render().$el));
+        self.$el.append($(gridBody).append(grid.render().$el));
 
-      return self;
-    }
-  });
+        return self;
+      },
+    });
 
   // We will use this function in VacuumSettings Control
   // to convert data type on the fly
-  var cellFunction = Backform.cellFunction = function(model) {
-    var self = this,
-        m = model,
-        vartype = model.get('column_type');
+  Backform.cellFunction = function(model) {
+    var vartype = model.get('column_type');
 
     switch(vartype) {
-      case "integer":
-        return Backgrid.IntegerCell;
-      break;
-      case "number":
-        return Backgrid.NumberCell;
-      break;
-      case "string":
-        return Backgrid.StringCell;
-      break;
-      default:
-        return Backgrid.Cell;
-      break;
+    case 'integer':
+      return Backgrid.IntegerCell;
+    case 'number':
+      return Backgrid.NumberCell;
+    case 'string':
+      return Backgrid.StringCell;
+    default:
+      return Backgrid.Cell;
     }
   };
 
   // Define Security Model with fields and validation for VacuumSettings Control
-  var VacuumTableModel =  Backform.VacuumTableModel = pgBrowser.Node.Model.extend({
+  Backform.VacuumTableModel = pgBrowser.Node.Model.extend({
     defaults: {
       name: undefined,
       setting: undefined,
       label:undefined,
       value: undefined,
-      column_type: undefined
+      column_type: undefined,
     },
 
     toJSON: function(){
@@ -122,11 +115,11 @@ define('pgadmin.node.schema', [
       delete d.setting;
       delete d.column_type;
       return d;
-    }
+    },
   });
 
    // Extend the browser's collection class for VacuumSettingsModel
-  var VacuumSettingsSchema = Backform.VacuumSettingsSchema = [{
+  Backform.VacuumSettingsSchema = [{
     id: 'autovacuum_custom', label: gettext('Custom auto-vacuum?'),
     group: gettext('Table'), mode: ['edit', 'create'],
     type: 'switch',
@@ -145,7 +138,7 @@ define('pgadmin.node.schema', [
         return false;
       }
       return true;
-    }
+    },
   },{
     id: 'autovacuum_enabled', label: gettext('Enabled?'),
     group: gettext('Table'), mode: ['edit', 'create'],
@@ -162,7 +155,7 @@ define('pgadmin.node.schema', [
         m.set('autovacuum_enabled', false);
       }, 10);
       return true;
-    }
+    },
   },{
     id: 'vacuum_table', label: gettext('Vacuum Table'),
     model: Backform.VacuumTableModel, editable: false, type: 'collection',
@@ -173,24 +166,24 @@ define('pgadmin.node.schema', [
         {
           name: 'label', label: gettext('Label'),
           headerCell: Backgrid.Extension.CustomHeaderCell,
-          cell: 'string', editable: false, cellHeaderClasses:'width_percent_40'
+          cell: 'string', editable: false, cellHeaderClasses:'width_percent_40',
         },
         {
           name: 'value', label: gettext('Value'),
           cellHeaderClasses:'width_percent_30',
           cellFunction: Backform.cellFunction, editable: function(m) {
             return m.handler.get('autovacuum_enabled');
-          }, headerCell: Backgrid.Extension.CustomHeaderCell
+          }, headerCell: Backgrid.Extension.CustomHeaderCell,
         },
         {
           name: 'setting', label: gettext('Default value'),
           cellHeaderClasses:'width_percent_30',
           headerCell: Backgrid.Extension.CustomHeaderCell,
-          cellFunction: Backform.cellFunction, editable: false
-        }
-      ]
+          cellFunction: Backform.cellFunction, editable: false,
+        },
+      ],
     }),
-    deps: ['autovacuum_enabled']
+    deps: ['autovacuum_enabled'],
   },{
     id: 'toast_autovacuum', label: gettext('Custom auto-vacuum?'),
     group: gettext('Toast Table'), mode: ['edit', 'create'],
@@ -206,7 +199,7 @@ define('pgadmin.node.schema', [
         return false;
       }
       return true;
-    }
+    },
   },{
     id: 'toast_autovacuum_enabled', label: gettext('Enabled?'),
     group: gettext('Toast Table'), mode: ['edit', 'create'],
@@ -225,8 +218,8 @@ define('pgadmin.node.schema', [
           m.set('toast_autovacuum_enabled', false);
         }, 10);
       }
-    return true;
-    }
+      return true;
+    },
   },{
     id: 'vacuum_toast', label: gettext('Vacuum Toast Table'),
     model: Backform.VacuumTableModel, type: 'collection', editable: function(m) {
@@ -239,7 +232,7 @@ define('pgadmin.node.schema', [
         {
           name: 'label', label: gettext('Label'),
           headerCell: Backgrid.Extension.CustomHeaderCell,
-          cell: 'string', editable: false, cellHeaderClasses:'width_percent_40'
+          cell: 'string', editable: false, cellHeaderClasses:'width_percent_40',
         },
         {
           name: 'value', label: gettext('Value'),
@@ -247,29 +240,29 @@ define('pgadmin.node.schema', [
           headerCell: Backgrid.Extension.CustomHeaderCell,
           cellFunction: Backform.cellFunction, editable: function(m) {
             return m.handler.get('toast_autovacuum_enabled');
-          }
+          },
         },
         {
           name: 'setting', label: gettext('Default value'),
           cellHeaderClasses:'width_percent_30',
           headerCell: Backgrid.Extension.CustomHeaderCell,
-          cellFunction: Backform.cellFunction, editable: false
-        }
-      ]
+          cellFunction: Backform.cellFunction, editable: false,
+        },
+      ],
     }),
-    deps: ['toast_autovacuum_enabled']
+    deps: ['toast_autovacuum_enabled'],
   }];
 
   // Extend the browser's collection class for schema collection
   if (!pgBrowser.Nodes['coll-schema']) {
-    var databases = pgBrowser.Nodes['coll-schema'] =
+    pgBrowser.Nodes['coll-schema'] =
       pgBrowser.Collection.extend({
         node: 'schema',
         label: gettext('Schemas'),
         type: 'coll-schema',
-        columns: ['name', 'namespaceowner', 'description']
+        columns: ['name', 'namespaceowner', 'description'],
       });
-  };
+  }
   // Extend the browser's node class for schema node
   if (!pgBrowser.Nodes['schema']) {
     pgBrowser.Nodes['schema'] = pgBrowser.Node.extend({
@@ -286,7 +279,7 @@ define('pgadmin.node.schema', [
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -294,22 +287,22 @@ define('pgadmin.node.schema', [
           name: 'create_schema_on_coll', node: 'coll-schema', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Schema...'),
-          icon: 'wcTabIcon icon-schema', data: {action: 'create'}
+          icon: 'wcTabIcon icon-schema', data: {action: 'create'},
         },{
           name: 'create_schema', node: 'schema', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Schema...'),
-          icon: 'wcTabIcon icon-schema', data: {action: 'create'}
+          icon: 'wcTabIcon icon-schema', data: {action: 'create'},
         },{
           name: 'create_schema', node: 'database', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Schema...'),
           icon: 'wcTabIcon icon-schema', data: {action: 'create'},
-          enable: 'can_create_schema'
-        }
+          enable: 'can_create_schema',
+        },
         ]);
       },
-      can_create_schema: function(node, item) {
+      can_create_schema: function(node) {
         return pgBrowser.Nodes['database'].is_conn_allow.call(this, node);
       },
       model: pgBrowser.Node.Model.extend({
@@ -331,38 +324,38 @@ define('pgadmin.node.schema', [
         },
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text'
+          type: 'text',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text', disabled: true, mode: ['properties']
+          type: 'text', disabled: true, mode: ['properties'],
         },{
           id: 'namespaceowner', label: gettext('Owner'), cell: 'string',
           type: 'text', control: 'node-list-by-name', node: 'role',
-          select2: { allowClear: false }
+          select2: { allowClear: false },
         },{
           id: 'is_sys_object', label: gettext('System schema?'),
-          cell: 'switch', type: 'switch', mode: ['properties'], disabled: true
+          cell: 'switch', type: 'switch', mode: ['properties'], disabled: true,
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
-          type: 'multiline'
+          type: 'multiline',
         },{
           id: 'acl', label: gettext('Privileges'), type: 'text',
-          group: gettext('Security'), mode: ['properties'], disabled: true
+          group: gettext('Security'), mode: ['properties'], disabled: true,
         },{
           id: 'tblacl', label: gettext('Default TABLE privileges'), type: 'text',
-          group: gettext('Security'), mode: ['properties'], disabled: true
+          group: gettext('Security'), mode: ['properties'], disabled: true,
         },{
           id: 'seqacl', label: gettext('Default SEQUENCE privileges'), type: 'text',
-          group: gettext('Security'), mode: ['properties'], disabled: true
+          group: gettext('Security'), mode: ['properties'], disabled: true,
         },{
           id: 'funcacl', label: gettext('Default FUNCTION privileges'),
-          group: gettext('Security'), type: 'text', mode: ['properties'], disabled: true
+          group: gettext('Security'), type: 'text', mode: ['properties'], disabled: true,
         },{
           id: 'typeacl', label: gettext('Default TYPE privileges'), type: 'text',
           group: gettext('Security'), mode: ['properties'], disabled: true, min_version: 90200,
           visible: function() {
             return this.version_compatible;
-          }
+          },
         },{
           id: 'nspacl', label: gettext('Privileges'),
           model: pgBrowser.Node.PrivilegeRoleModel.extend(
@@ -375,62 +368,62 @@ define('pgadmin.node.schema', [
           model: pgBrowser.SecLabelModel, editable: false, type: 'collection',
           group: gettext('Security'), mode: ['edit', 'create'],
           min_version: 90200, canAdd: true,
-          canEdit: false, canDelete: true, control: 'unique-col-collection'
+          canEdit: false, canDelete: true, control: 'unique-col-collection',
         },{
           type: 'nested', control: 'tab', group: gettext('Default Privileges'),
           mode: ['create','edit'],
           schema:[{
-              id: 'deftblacl', model: pgBrowser.Node.PrivilegeRoleModel.extend(
+            id: 'deftblacl', model: pgBrowser.Node.PrivilegeRoleModel.extend(
               {privileges: ['a', 'r', 'w', 'd', 'D', 'x', 't']}),
-              label: gettext('Default Privileges: Tables'),
-              editable: false, type: 'collection', group: gettext('Tables'),
-              mode: ['edit', 'create'], control: 'unique-col-collection',
-              canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor']
-            },{
-              id: 'defseqacl', model: pgBrowser.Node.PrivilegeRoleModel.extend(
+            label: gettext('Default Privileges: Tables'),
+            editable: false, type: 'collection', group: gettext('Tables'),
+            mode: ['edit', 'create'], control: 'unique-col-collection',
+            canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor'],
+          },{
+            id: 'defseqacl', model: pgBrowser.Node.PrivilegeRoleModel.extend(
               {privileges: ['r', 'w', 'U']}),
-              label: gettext('Default Privileges: Sequences'),
-              editable: false, type: 'collection', group: gettext('Sequences'),
-              mode: ['edit', 'create'], control: 'unique-col-collection',
-              canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor']
-            },{
-              id: 'deffuncacl', model: pgBrowser.Node.PrivilegeRoleModel.extend(
+            label: gettext('Default Privileges: Sequences'),
+            editable: false, type: 'collection', group: gettext('Sequences'),
+            mode: ['edit', 'create'], control: 'unique-col-collection',
+            canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor'],
+          },{
+            id: 'deffuncacl', model: pgBrowser.Node.PrivilegeRoleModel.extend(
               {privileges: ['X']}),
-              label: gettext('Default Privileges: Functions'),
-              editable: false, type: 'collection', group: gettext('Functions'),
-              mode: ['edit', 'create'], control: 'unique-col-collection',
-              canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor']
-            },{
-              id: 'deftypeacl', model: pgBrowser.Node.PrivilegeRoleModel.extend(
+            label: gettext('Default Privileges: Functions'),
+            editable: false, type: 'collection', group: gettext('Functions'),
+            mode: ['edit', 'create'], control: 'unique-col-collection',
+            canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor'],
+          },{
+            id: 'deftypeacl', model: pgBrowser.Node.PrivilegeRoleModel.extend(
               {privileges: ['U']}),
-              label: gettext('Default Privileges: Types'),
-              editable: false, type: 'collection', group: gettext('Types'),
-              mode: ['edit', 'create'], control: 'unique-col-collection',
-              canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor'],
-              min_version: 90200
-            }]
-         }
+            label: gettext('Default Privileges: Types'),
+            editable: false, type: 'collection', group: gettext('Types'),
+            mode: ['edit', 'create'], control: 'unique-col-collection',
+            canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor'],
+            min_version: 90200,
+          }],
+        },
         ],
         validate: function() {
-          var err = {},
-              errmsg = null;
+          var errmsg = null;
+
           // Validation of mandatory fields
           this.errorModel.clear();
           if (_.isUndefined(this.get('name')) ||
             _.isNull(this.get('name')) ||
             String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
-                errmsg = gettext('Name cannot be empty.');
-                this.errorModel.set('name', errmsg);
-                return errmsg;
+            errmsg = gettext('Name cannot be empty.');
+            this.errorModel.set('name', errmsg);
+            return errmsg;
           } else if (_.isUndefined(this.get('namespaceowner')) ||
             _.isNull(this.get('namespaceowner')) ||
             String(this.get('namespaceowner')).replace(/^\s+|\s+$/g, '') == '') {
-                errmsg = gettext('Owner cannot be empty.');
-                this.errorModel.set('namespaceowner', errmsg);
-                return errmsg;
+            errmsg = gettext('Owner cannot be empty.');
+            this.errorModel.set('namespaceowner', errmsg);
+            return errmsg;
           }
           return null;
-        }
+        },
       }),
       // This function will checks whether we can allow user to
       // drop object or not based on location within schema & catalog
@@ -445,21 +438,21 @@ define('pgadmin.node.schema', [
             //Check if we are not child of catalog
           var prev_i = t.hasParent(i) ? t.parent(i) : null,
             prev_d = prev_i ? t.itemData(prev_i) : null;
-            if(prev_d && prev_d._type == 'catalog') {
-              return false;
-            }
+          if(prev_d && prev_d._type == 'catalog') {
+            return false;
+          }
           i = t.hasParent(i) ? t.parent(i) : null;
           d = i ? t.itemData(i) : null;
         }
         // by default we do not want to allow create menu
         return true;
-      }
+      },
     });
 
     pgBrowser.tableChildTreeNodeHierarchy = function(i) {
       var idx = 0,
-          res = {},
-          t = pgBrowser.tree;
+        res = {},
+        t = pgBrowser.tree;
 
       do {
         var d = t.itemData(i);
@@ -484,35 +477,34 @@ define('pgadmin.node.schema', [
   }
 
   // Switch Cell with Deps (specifically for table children)
-  var TableChildSwitchCell =
-    Backgrid.Extension.TableChildSwitchCell = Backgrid.Extension.SwitchCell.extend({
-      initialize: function() {
-        Backgrid.Extension.SwitchCell.prototype.initialize.apply(this, arguments);
-        Backgrid.Extension.DependentCell.prototype.initialize.apply(this, arguments);
-      },
-      dependentChanged: function () {
-        var model = this.model,
-          column = this.column,
-          editable = this.column.get("editable"),
-          input = this.$el.find('input[type=checkbox]').first(),
-          self_name = column.get('name'),
-          is_editable;
-
-        is_editable = _.isFunction(editable) ? !!editable.apply(column, [model]) : !!editable;
-        if (is_editable) {
-           this.$el.addClass("editable");
-           input.bootstrapSwitch('disabled',false);
-         } else {
-           this.$el.removeClass("editable");
-           input.bootstrapSwitch('disabled',true);
-           // Set self value into model to false
-           setTimeout(function() { model.set(self_name, false); }, 10);
-         }
-
-        this.delegateEvents();
-        return this;
-      },
-      remove: Backgrid.Extension.DependentCell.prototype.remove
+  Backgrid.Extension.TableChildSwitchCell = Backgrid.Extension.SwitchCell.extend({
+    initialize: function() {
+      Backgrid.Extension.SwitchCell.prototype.initialize.apply(this, arguments);
+      Backgrid.Extension.DependentCell.prototype.initialize.apply(this, arguments);
+    },
+    dependentChanged: function () {
+      var model = this.model,
+        column = this.column,
+        editable = this.column.get('editable'),
+        input = this.$el.find('input[type=checkbox]').first(),
+        self_name = column.get('name'),
+        is_editable;
+
+      is_editable = _.isFunction(editable) ? !!editable.apply(column, [model]) : !!editable;
+      if (is_editable) {
+        this.$el.addClass('editable');
+        input.bootstrapSwitch('disabled',false);
+      } else {
+        this.$el.removeClass('editable');
+        input.bootstrapSwitch('disabled',true);
+        // Set self value into model to false
+        setTimeout(function() { model.set(self_name, false); }, 10);
+      }
+
+      this.delegateEvents();
+      return this;
+    },
+    remove: Backgrid.Extension.DependentCell.prototype.remove,
   });
 
   return pgBrowser.Nodes['schema'];
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.js
index 6641a360..e97dd05f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.js
@@ -1,18 +1,18 @@
 define('pgadmin.node.synonym', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
   'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
-  'pgadmin.browser.collection'
+  'pgadmin.browser.collection',
 ], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
 
   if (!pgBrowser.Nodes['coll-synonym']) {
-    var databases = pgAdmin.Browser.Nodes['coll-synonym'] =
+    pgAdmin.Browser.Nodes['coll-synonym'] =
       pgAdmin.Browser.Collection.extend({
         node: 'synonym',
         label: gettext('Synonyms'),
         type: 'coll-synonym',
-        columns: ['name', 'owner','is_public_synonym']
+        columns: ['name', 'owner','is_public_synonym'],
       });
-  };
+  }
 
   if (!pgBrowser.Nodes['synonym']) {
     pgAdmin.Browser.Nodes['synonym'] = pgBrowser.Node.extend({
@@ -35,20 +35,20 @@ define('pgadmin.node.synonym', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Synonym...'),
           icon: 'wcTabIcon icon-synonym', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_synonym', node: 'synonym', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Synonym...'),
           icon: 'wcTabIcon icon-synonym', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_synonym', node: 'schema', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Synonym...'),
           icon: 'wcTabIcon icon-synonym', data: {action: 'create', check: true},
-          enable: 'canCreate'
-        }
+          enable: 'canCreate',
+        },
         ]);
 
       },
@@ -66,10 +66,10 @@ define('pgadmin.node.synonym', [
             var userInfo = pgBrowser.serverInfo[args.node_info.server._id].user;
             var schemaInfo = args.node_info.schema;
             this.set({
-                'owner': userInfo.name,
-                'synobjschema': schemaInfo._label,
-                'schema': schemaInfo._label,
-                'targettype': 'r'
+              'owner': userInfo.name,
+              'synobjschema': schemaInfo._label,
+              'schema': schemaInfo._label,
+              'targettype': 'r',
             }, {silent: true});
           } else {
             this.fetchFromServer = true;
@@ -80,34 +80,34 @@ define('pgadmin.node.synonym', [
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'],
-          disabled: 'inSchemaWithModelCheck'
+          disabled: 'inSchemaWithModelCheck',
         },{
           id: 'owner', label: gettext('Owner'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'],
           disabled: true , control: 'node-list-by-name',
-          node: 'role', visible: false
+          node: 'role', visible: false,
         },{
           id: 'schema', label: gettext('Schema'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'],
           disabled: function(m) { return !m.isNew(); }, node: 'schema',
           control: 'node-list-by-name', cache_node: 'database',
-          cache_level: 'database'
+          cache_level: 'database',
         },{
           id: 'targettype', label: gettext('Target type'), cell: 'string',
           disabled: 'inSchema', group: gettext('Definition'),
-          select2: { width: "50%", allowClear: false },
-          options: function(obj) {
-              return [
-                {label: gettext("Function"), value: "f"},
-                {label: gettext("Package"), value: "P"},
-                {label: gettext("Procedure"), value: "p"},
-                {label: gettext("Public Synonym"), value: "s"},
-                {label: gettext("Sequence"), value: "S"},
-                {label: gettext("Table"), value: "r"},
-                {label: gettext("View"), value: "v"}
-              ]
-           },
-          control: 'select2'
+          select2: { width: '50%', allowClear: false },
+          options: function() {
+            return [
+                {label: gettext('Function'), value: 'f'},
+                {label: gettext('Package'), value: 'P'},
+                {label: gettext('Procedure'), value: 'p'},
+                {label: gettext('Public Synonym'), value: 's'},
+                {label: gettext('Sequence'), value: 'S'},
+                {label: gettext('Table'), value: 'r'},
+                {label: gettext('View'), value: 'v'},
+            ];
+          },
+          control: 'select2',
         },{
           id: 'synobjschema', label: gettext('Target schema'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'],
@@ -116,8 +116,8 @@ define('pgadmin.node.synonym', [
           node: 'schema', filter: function(d) {
             // Exclude PPAS catalogs
             var exclude_catalogs = ['pg_catalog', 'sys', 'dbo',
-                            'pgagent', 'information_schema',
-                            'dbms_job_procedure'];
+              'pgagent', 'information_schema',
+              'dbms_job_procedure'];
             return d && _.indexOf(exclude_catalogs, d.label) == -1;
           },
           disabled: function(m) {
@@ -125,65 +125,66 @@ define('pgadmin.node.synonym', [
             if(!m.inSchema.apply(this, [m])) {
               var is_synonym = (m.get('targettype') == 's');
               if(is_synonym) {
-                  m.set('synobjschema', 'public', {silent: true});
+                m.set('synobjschema', 'public', {silent: true});
                 return true;
               } else {
                 return false;
               }
             }
             return true;
-          }
+          },
         },{
           id: 'synobjname', label: gettext('Target object'), cell: 'string',
           type: 'text', disabled: 'inSchema', group: gettext('Definition'),
           deps: ['targettype', 'synobjschema'],
-            control: 'node-ajax-options',
-            options: function(control) {
-              var trgTyp = control.model.get('targettype');
-              var trgSchema = control.model.get('synobjschema');
-              var res = [];
+          control: 'node-ajax-options',
+          options: function(control) {
+            var trgTyp = control.model.get('targettype');
+            var trgSchema = control.model.get('synobjschema');
+            var res = [];
 
-              var node = control.field.get('schema_node'),
+            var node = control.field.get('schema_node'),
               _url = node.generate_url.apply(
                 node, [
-                null, 'get_target_objects', control.field.get('node_data'), false,
-                control.field.get('node_info') ]);
-              $.ajax({
-                  type: 'GET',
-                  timeout: 30000,
-                  url: _url,
-                  cache: false,
-                  async: false,
-                  data: {"trgTyp" : trgTyp, "trgSchema" : trgSchema},
+                  null, 'get_target_objects', control.field.get('node_data'), false,
+                  control.field.get('node_info') ]);
+            $.ajax({
+              type: 'GET',
+              timeout: 30000,
+              url: _url,
+              cache: false,
+              async: false,
+              data: {'trgTyp' : trgTyp, 'trgSchema' : trgSchema},
 
                   // On success return function list from server
-                  success: function(result) {
-                    res = result.data;
-                    return res;
-                  },
+              success: function(result) {
+                res = result.data;
+                return res;
+              },
 
                   // On failure show error appropriate error message to user
-                  error: function(xhr, status, error) {
-                    try {
-                      var err = $.parseJSON(xhr.responseText);
-                      if (err.success == 0) {
-                        alertify.error(err.errormsg);
-                      }
-                    } catch (e) {}
+              error: function(xhr) {
+                try {
+                  var err = $.parseJSON(xhr.responseText);
+                  if (err.success == 0) {
+                    alertify.error(err.errormsg);
                   }
-              });
+                } catch (e) {
+                  // Ignore
+                }
+              },
+            });
             return res;
-          }
+          },
         },{
           id: 'is_public_synonym', label: gettext('Public synonym?'),
           disabled: true, type: 'switch', mode: ['properties'], cell: 'switch',
           options: { onText: gettext('Yes'), offText: gettext('No'), onColor: 'success',
-                    offColor: 'primary', size: 'mini'}
-        }
+            offColor: 'primary', size: 'mini'},
+        },
         ],
         validate: function() {
-          var err = {},
-          msg = undefined;
+          var msg = undefined;
           this.errorModel.clear();
 
           if (_.isUndefined(this.get('name'))
@@ -221,27 +222,27 @@ define('pgadmin.node.synonym', [
             }
           }
           return true;
-        }
+        },
       }),
       canCreate: function(itemData, item, data) {
           //If check is false then , we will allow create menu
-          if (data && data.check == false)
-            return true;
+        if (data && data.check == false)
+          return true;
 
-          var treeData = this.getTreeNodeHierarchy(item),
-                server = treeData['server'];
+        var treeData = this.getTreeNodeHierarchy(item),
+          server = treeData['server'];
 
-          if (server && server.server_type === 'pg')
-            return false;
+        if (server && server.server_type === 'pg')
+          return false;
 
           // If it is catalog then don't allow user to create synonyms
-          if (treeData['catalog'] != undefined)
-            return false;
+        if (treeData['catalog'] != undefined)
+          return false;
 
           // by default we do not want to allow create menu
-          return true;
-      }
-  });
+        return true;
+      },
+    });
 
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/static/js/column.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/static/js/column.js
index 8f14eaf4..72b6eb0c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/static/js/column.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/static/js/column.js
@@ -1,53 +1,54 @@
 define('pgadmin.node.column', [
-  'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'backform', 'alertify',
-  'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
+  'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform', 'pgadmin.backgrid',
+  'pgadmin.browser.collection',
+], function(
+  gettext, url_for, $, _, Backbone, pgAdmin, pgBrowser, Backform, Backgrid
+) {
 
   if (!pgBrowser.Nodes['coll-column']) {
-    var databases = pgBrowser.Nodes['coll-column'] =
+    pgBrowser.Nodes['coll-column'] =
       pgBrowser.Collection.extend({
         node: 'column',
         label: gettext('Columns'),
         type: 'coll-column',
-        columns: ['name', 'atttypid', 'description']
+        columns: ['name', 'atttypid', 'description'],
       });
-  };
+  }
 
    // This Node model will be used for variable control for column
-   var VariablesModel = Backform.VariablesModel = pgBrowser.Node.Model.extend({
+  var VariablesModel = Backform.VariablesModel = pgBrowser.Node.Model.extend({
     idAttribute: 'name',
     defaults: {
       name: null,
-      value: null
+      value: null,
     },
     schema: [{
       id: 'name', label: gettext('Name'), cell: 'select2',
       type: 'text', disabled: false, node: 'column',
       options: [['n_distinct', 'n_distinct'],
       ['n_distinct_inherited','n_distinct_inherited']],
-      select2: {placeholder: "Select variable"},
-      cellHeaderClasses:'width_percent_50'
+      select2: {placeholder: 'Select variable'},
+      cellHeaderClasses:'width_percent_50',
     },{
       id: 'value', label: gettext('Value'),
       type: 'text', disabled: false,
-      cellHeaderClasses:'width_percent_50'
+      cellHeaderClasses:'width_percent_50',
     }],
     validate: function() {
-      var err = {},
-          errmsg = null;
-
-      if (_.isUndefined(this.get('value')) ||
+      if (
+        _.isUndefined(this.get('value')) ||
         _.isNull(this.get('value')) ||
-        String(this.get('value')).replace(/^\s+|\s+$/g, '') == '') {
-            errmsg = gettext('Please provide input for variable.');
-            this.errorModel.set('value', errmsg);
-            return errmsg;
-          } else {
-            this.errorModel.unset('value');
-          }
+        String(this.get('value')).replace(/^\s+|\s+$/g, '') == ''
+      ) {
+        var errmsg = gettext('Please provide input for variable.');
+        this.errorModel.set('value', errmsg);
+        return errmsg;
+      } else {
+        this.errorModel.unset('value');
+      }
       return null;
-    }
+    },
   });
 
   // Integer Cell for Columns Length and Precision
@@ -60,12 +61,12 @@ define('pgadmin.node.column', [
       dependentChanged: function () {
         this.$el.empty();
         var model = this.model,
-            column = this.column,
-            editable = this.column.get("editable"),
-            is_editable = _.isFunction(editable) ? !!editable.apply(column, [model]) : !!editable;
+          column = this.column,
+          editable = this.column.get('editable'),
+          is_editable = _.isFunction(editable) ? !!editable.apply(column, [model]) : !!editable;
 
-        if (is_editable){ this.$el.addClass("editable"); }
-        else { this.$el.removeClass("editable"); }
+        if (is_editable){ this.$el.addClass('editable'); }
+        else { this.$el.removeClass('editable'); }
 
         this.delegateEvents();
         return this;
@@ -74,15 +75,15 @@ define('pgadmin.node.column', [
         Backgrid.NumberCell.prototype.render.apply(this, arguments);
 
         var model = this.model,
-            column = this.column,
-            editable = this.column.get("editable"),
-            is_editable = _.isFunction(editable) ? !!editable.apply(column, [model]) : !!editable;
+          column = this.column,
+          editable = this.column.get('editable'),
+          is_editable = _.isFunction(editable) ? !!editable.apply(column, [model]) : !!editable;
 
-        if (is_editable){ this.$el.addClass("editable"); }
-        else { this.$el.removeClass("editable"); }
+        if (is_editable){ this.$el.addClass('editable'); }
+        else { this.$el.removeClass('editable'); }
         return this;
       },
-      remove: Backgrid.Extension.DependentCell.prototype.remove
+      remove: Backgrid.Extension.DependentCell.prototype.remove,
     });
 
   if (!pgBrowser.Nodes['column']) {
@@ -123,7 +124,7 @@ define('pgadmin.node.column', [
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -132,26 +133,26 @@ define('pgadmin.node.column', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Column...'),
           icon: 'wcTabIcon icon-column', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_column', node: 'column', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Column...'),
           icon: 'wcTabIcon icon-column', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_column_onTable', node: 'table', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Column...'),
           icon: 'wcTabIcon icon-column', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_column_onView', node: 'view', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Column...'),
           icon: 'wcTabIcon icon-column', data: {action: 'create', check: true},
-          enable: 'canCreate'
-        }
+          enable: 'canCreate',
+        },
         ]);
       },
       model: pgBrowser.Node.Model.extend({
@@ -175,13 +176,13 @@ define('pgadmin.node.column', [
           attstattarget:undefined,
           attnotnull: false,
           attlen: null,
-          attprecision: null
+          attprecision: null,
         },
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
           type: 'text', disabled: 'inSchemaWithColumnCheck',
           cellHeaderClasses:'width_percent_30',
-          editable: 'editable_check_for_table'
+          editable: 'editable_check_for_table',
         },{
           // Need to show this field only when creating new table
           // [in SubNode control]
@@ -190,7 +191,7 @@ define('pgadmin.node.column', [
           deps:['name'], cellHeaderClasses:'width_percent_5',
           options: {
             onText: gettext('Yes'), offText: gettext('No'),
-            onColor: 'success', offColor: 'primary'
+            onColor: 'success', offColor: 'primary',
           },
           visible: function(m) {
             return _.isUndefined(
@@ -222,7 +223,7 @@ define('pgadmin.node.column', [
             }
             return false;
           },
-          editable: function(m){
+          editable: function(m) {
             var name = m.get('name');
             // If HeaderCell then allow True
             if(m instanceof Backbone.Collection) {
@@ -252,46 +253,44 @@ define('pgadmin.node.column', [
               return true;
             }
             return false;
-            // Set to false if no condition is met
-            m.set('is_primary_key', false);
-          }
+          },
         },{
           id: 'attnum', label: gettext('Position'), cell: 'string',
-          type: 'text', disabled: 'notInSchema', mode: ['properties']
+          type: 'text', disabled: 'notInSchema', mode: ['properties'],
         },{
           id: 'cltype', label: gettext('Data type'),
           cell: Backgrid.Extension.NodeAjaxOptionsCell.extend({
             exitEditMode: function(e) {
-                var self = this;
-                this.$select.off('blur', this.exitEditMode);
-                this.$select.select2('close');
-                this.$el.removeClass('editor');
+              var self = this;
+              this.$select.off('blur', this.exitEditMode);
+              this.$select.select2('close');
+              this.$el.removeClass('editor');
                 // Once user have selected a value
                 // we can shift to next cell if it is editable
-                var next_cell, length_cell = this.$el.next(),
-                  not_null_cell = this.$el.next().next().next();
+              var next_cell, length_cell = this.$el.next(),
+                not_null_cell = this.$el.next().next().next();
 
                 // Add delay so that Select2 cell tab event is captured
                 // first before triggerring backgrid:edited event.
-                setTimeout(function() {
+              setTimeout(function() {
                   // First check Length column if it is disable then goto
                   // Not Null column
-                  if(length_cell && length_cell.hasClass('editable') && e) {
-                    next_cell = length_cell;
-                  } else if(not_null_cell && not_null_cell.hasClass('editable') && e) {
-                    next_cell = not_null_cell;
-                  }
-
-                  if(next_cell) {
-                    e.preventDefault();
-                    e.stopPropagation();
-                    var command = new Backgrid.Command({key: "Tab", keyCode: 9, which: 9});
-                    self.model.trigger("backgrid:edited", self.model, self.column,
+                if(length_cell && length_cell.hasClass('editable') && e) {
+                  next_cell = length_cell;
+                } else if(not_null_cell && not_null_cell.hasClass('editable') && e) {
+                  next_cell = not_null_cell;
+                }
+
+                if(next_cell) {
+                  e.preventDefault();
+                  e.stopPropagation();
+                  var command = new Backgrid.Command({key: 'Tab', keyCode: 9, which: 9});
+                  self.model.trigger('backgrid:edited', self.model, self.column,
                                       command);
-                    next_cell.focus();
-                  }
-                }, 20);
-            }
+                  next_cell.focus();
+                }
+              }, 20);
+            },
           }),
           type: 'text', disabled: 'inSchemaWithColumnCheck',
           control: 'node-ajax-options', url: 'get_types', node: 'table',
@@ -306,7 +305,7 @@ define('pgadmin.node.column', [
              * uses (this) as a object.
              */
             var control = cell || this,
-                m = control.model;
+              m = control.model;
 
             /* We need different data in create mode & in edit mode
              * if we are in create mode then return data as it is
@@ -314,7 +313,7 @@ define('pgadmin.node.column', [
              */
             control.model.datatypes = data;
             var edit_types = m.get('edit_types'),
-                result = [];
+              result = [];
 
             // If called from Table, We will check if in edit mode
             // then send edit_types only
@@ -323,7 +322,7 @@ define('pgadmin.node.column', [
                 if (_.indexOf(edit_types, t.value) != -1) {
                   result.push(t);
                 }
-            });
+              });
               // There may be case that user adds new column in  existing collection
               // we will not have edit types then
               return result.length > 0 ? result : data;
@@ -343,7 +342,7 @@ define('pgadmin.node.column', [
               return result;
             }
           },
-          editable: 'editable_check_for_table'
+          editable: 'editable_check_for_table',
         },{
           // Need to show this field only when creating new table [in SubNode control]
           id: 'inheritedfrom', label: gettext('Inherited from table'),
@@ -351,228 +350,226 @@ define('pgadmin.node.column', [
           cellHeaderClasses:'width_percent_10',
           visible: function(m) {
             return _.isUndefined(m.top.node_info['table'] || m.top.node_info['view'] || m.top.node_info['mview']);
-          }
+          },
         },{
           id: 'attlen', label: gettext('Length'), cell: IntegerDepCell,
-           deps: ['cltype'], type: 'int', group: gettext('Definition'), cellHeaderClasses:'width_percent_20',
-           disabled: function(m) {
-             var of_type = m.get('cltype'),
-               flag = true;
-              _.each(m.datatypes, function(o) {
-                if ( of_type == o.value ) {
-                    if(o.length)
+          deps: ['cltype'], type: 'int', group: gettext('Definition'), cellHeaderClasses:'width_percent_20',
+          disabled: function(m) {
+            var of_type = m.get('cltype'),
+              flag = true;
+            _.each(m.datatypes, function(o) {
+              if ( of_type == o.value ) {
+                if(o.length)
                     {
-                      m.set('min_val', o.min_val, {silent: true});
-                      m.set('max_val', o.max_val, {silent: true});
-                      flag = false;
-                    }
+                  m.set('min_val', o.min_val, {silent: true});
+                  m.set('max_val', o.max_val, {silent: true});
+                  flag = false;
                 }
-              });
+              }
+            });
 
-              flag && setTimeout(function() {
-                  if(m.get('attlen')) {
-                    m.set('attlen', null);
-                  }
-                },10);
+            flag && setTimeout(function() {
+              if(m.get('attlen')) {
+                m.set('attlen', null);
+              }
+            },10);
 
-              return flag;
-           },
-           editable: function(m) {
+            return flag;
+          },
+          editable: function(m) {
              // inheritedfrom has value then we should disable it
-             if(!_.isUndefined(m.get('inheritedfrom'))) {
-                return false;
-             }
+            if(!_.isUndefined(m.get('inheritedfrom'))) {
+              return false;
+            }
 
-             if (!m.datatypes) {
+            if (!m.datatypes) {
               // datatypes not loaded, may be this call is from CallByNeed from backgrid cell initialize.
               return true;
-             }
-             var of_type = m.get('cltype'),
-               flag = false;
-
-               _.each(m.datatypes, function(o) {
-               if ( of_type == o.value ) {
-                 if(o.length) {
-                   m.set('min_val', o.min_val, {silent: true});
-                   m.set('max_val', o.max_val, {silent: true});
-                   flag = true;
-                 }
+            }
+            var of_type = m.get('cltype'),
+              flag = false;
+
+            _.each(m.datatypes, function(o) {
+              if ( of_type == o.value ) {
+                if(o.length) {
+                  m.set('min_val', o.min_val, {silent: true});
+                  m.set('max_val', o.max_val, {silent: true});
+                  flag = true;
                 }
-              });
+              }
+            });
 
-              !flag && setTimeout(function() {
-                  if(m.get('attlen')) {
-                    m.set('attlen', null, {silent: true});
-                  }
-                },10);
+            !flag && setTimeout(function() {
+              if(m.get('attlen')) {
+                m.set('attlen', null, {silent: true});
+              }
+            },10);
 
-              return flag;
-           }
+            return flag;
+          },
         },{
           id: 'attprecision', label: gettext('Precision'), cell: IntegerDepCell,
-           deps: ['cltype'], type: 'int', group: gettext('Definition'), cellHeaderClasses:'width_percent_20',
-           disabled: function(m) {
-             var of_type = m.get('cltype'),
-               flag = true;
-              _.each(m.datatypes, function(o) {
-                if ( of_type == o.value ) {
-                  if(o.precision) {
-                    m.set('min_val', 0, {silent: true});
-                    m.set('max_val', o.max_val, {silent: true});
-                    flag = false;
-                  }
+          deps: ['cltype'], type: 'int', group: gettext('Definition'), cellHeaderClasses:'width_percent_20',
+          disabled: function(m) {
+            var of_type = m.get('cltype'),
+              flag = true;
+            _.each(m.datatypes, function(o) {
+              if ( of_type == o.value ) {
+                if(o.precision) {
+                  m.set('min_val', 0, {silent: true});
+                  m.set('max_val', o.max_val, {silent: true});
+                  flag = false;
                 }
-              });
+              }
+            });
 
-              flag && setTimeout(function() {
-                if(m.get('attprecision')) {
-                  m.set('attprecision', null);
-                }
-              },10);
-              return flag;
-           },
-           editable: function(m) {
+            flag && setTimeout(function() {
+              if(m.get('attprecision')) {
+                m.set('attprecision', null);
+              }
+            },10);
+            return flag;
+          },
+          editable: function(m) {
              // inheritedfrom has value then we should disable it
-             if(!_.isUndefined(m.get('inheritedfrom'))) {
-                return false;
-             }
+            if(!_.isUndefined(m.get('inheritedfrom'))) {
+              return false;
+            }
 
-             if (!m.datatypes) {
+            if (!m.datatypes) {
               // datatypes not loaded yet, may be this call is from CallByNeed from backgrid cell initialize.
               return true;
-             }
-
-             var of_type = m.get('cltype'),
-               flag = false;
-              _.each(m.datatypes, function(o) {
-                if ( of_type == o.value ) {
-                  if(o.precision) {
-                    m.set('min_val', 0, {silent: true});
-                    m.set('max_val', o.max_val, {silent: true});
-                    flag = true;
-                  }
-                }
-              });
+            }
 
-              !flag && setTimeout(function() {
-                if(m.get('attprecision')) {
-                  m.set('attprecision', null);
+            var of_type = m.get('cltype'),
+              flag = false;
+            _.each(m.datatypes, function(o) {
+              if ( of_type == o.value ) {
+                if(o.precision) {
+                  m.set('min_val', 0, {silent: true});
+                  m.set('max_val', o.max_val, {silent: true});
+                  flag = true;
                 }
-              },10);
+              }
+            });
+
+            !flag && setTimeout(function() {
+              if(m.get('attprecision')) {
+                m.set('attprecision', null);
+              }
+            },10);
 
-              return flag;
-           }
-         },{
+            return flag;
+          },
+        },{
           id: 'collspcname', label: gettext('Collation'), cell: 'string',
           type: 'text', control: 'node-ajax-options', url: 'get_collations',
           group: gettext('Definition'), node: 'collation',
           deps: ['cltype'], disabled: function(m) {
-             var of_type = m.get('cltype'),
-               flag = true;
-             _.each(m.datatypes, function(o) {
-                if ( of_type == o.value ) {
-                    if(o.is_collatable)
+            var of_type = m.get('cltype'),
+              flag = true;
+            _.each(m.datatypes, function(o) {
+              if ( of_type == o.value ) {
+                if(o.is_collatable)
                     {
-                      flag = false;
-                    }
+                  flag = false;
                 }
-             });
-             if (flag) {
-                setTimeout(function(){
-                  if(m.get('collspcname') && m.get('collspcname') !== '') {
-                    m.set('collspcname', "");
-                  }
-                }, 10);
-             }
-             return flag;
-          }
+              }
+            });
+            if (flag) {
+              setTimeout(function(){
+                if(m.get('collspcname') && m.get('collspcname') !== '') {
+                  m.set('collspcname', '');
+                }
+              }, 10);
+            }
+            return flag;
+          },
         },{
           id: 'defval', label: gettext('Default Value'), cell: 'string',
           type: 'text', group: gettext('Definition'), deps: ['cltype'],
           disabled: function(m) {
             if(!m.inSchemaWithModelCheck.apply(this, [m])) {
               var type = m.get('cltype');
-                return type == 'serial' || type == 'bigserial'
+              return type == 'serial' || type == 'bigserial'
                                         || type == 'smallserial';
             }
-          }
+          },
         },{
           id: 'attnotnull', label: gettext('Not NULL?'), cell: 'switch',
           type: 'switch', disabled: 'inSchemaWithColumnCheck', cellHeaderClasses:'width_percent_20',
           group: gettext('Definition'), editable: 'editable_check_for_table',
-          options: { onText: gettext('Yes'), offText: gettext('No'), onColor: 'success', offColor: 'primary' }
+          options: { onText: gettext('Yes'), offText: gettext('No'), onColor: 'success', offColor: 'primary' },
         },{
           id: 'attstattarget', label: gettext('Statistics'), cell: 'string',
           type: 'text', disabled: 'inSchemaWithColumnCheck', mode: ['properties', 'edit'],
-          group: gettext('Definition')
+          group: gettext('Definition'),
         },{
           id: 'attstorage', label: gettext('Storage'), group: gettext('Definition'),
           type: 'text', mode: ['properties', 'edit'],
           cell: 'string', disabled: 'inSchemaWithColumnCheck', first_empty: true,
-          control: 'select2', select2: { placeholder: "Select storage",
+          control: 'select2', select2: { placeholder: 'Select storage',
             allowClear: false,
-            width: "100%"
+            width: '100%',
           },
           options: [
-            {label: "PLAIN", value: "p"},
-            {label: "MAIN", value: "m"},
-            {label: "EXTERNAL", value: "e"},
-            {label: "EXTENDED", value: "x"},
-           ]
+            {label: 'PLAIN', value: 'p'},
+            {label: 'MAIN', value: 'm'},
+            {label: 'EXTERNAL', value: 'e'},
+            {label: 'EXTENDED', value: 'x'},
+          ],
         },{
           id: 'is_pk', label: gettext('Primary key?'),
           type: 'switch', disabled: true, mode: ['properties'],
-          group: gettext('Definition')
+          group: gettext('Definition'),
         },{
           id: 'is_fk', label: gettext('Foreign key?'),
           type: 'switch', disabled: true, mode: ['properties'],
-          group: gettext('Definition')
+          group: gettext('Definition'),
         },{
           id: 'is_inherited', label: gettext('Inherited?'),
           type: 'switch', disabled: true, mode: ['properties'],
-          group: gettext('Definition')
+          group: gettext('Definition'),
         },{
           id: 'tbls_inherited', label: gettext('Inherited from table(s)'),
           type: 'text', disabled: true, mode: ['properties'], deps: ['is_inherited'],
           group: gettext('Definition'),
           visible: function(m) {
-              if (!_.isUndefined(m.get('is_inherited')) && m.get('is_inherited')) {
-                return true;
-              } else {
-                return false;
-              }
-          }
+            if (!_.isUndefined(m.get('is_inherited')) && m.get('is_inherited')) {
+              return true;
+            } else {
+              return false;
+            }
+          },
         },{
           id: 'is_sys_column', label: gettext('System column?'), cell: 'string',
-          type: 'switch', disabled: true, mode: ['properties']
+          type: 'switch', disabled: true, mode: ['properties'],
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
           type: 'multiline', mode: ['properties', 'create', 'edit'],
-          disabled: 'notInSchema'
+          disabled: 'notInSchema',
         },{
           id: 'attoptions', label: gettext('Variables'), type: 'collection',
           group: gettext('Variables'), control: 'unique-col-collection',
           model: VariablesModel, uniqueCol : ['name'],
           mode: ['edit', 'create'], canAdd: true, canEdit: false,
-          canDelete: true
+          canDelete: true,
         }, pgBrowser.SecurityGroupSchema, {
           id: 'attacl', label: gettext('Privileges'), type: 'collection',
           group: 'security', control: 'unique-col-collection',
           model: pgBrowser.Node.PrivilegeRoleModel.extend({
-          privileges: ['a','r','w','x']}),
+            privileges: ['a','r','w','x']}),
           mode: ['edit'], canAdd: true, canDelete: true,
-          uniqueCol : ['grantee']
+          uniqueCol : ['grantee'],
         },{
           id: 'seclabels', label: gettext('Security Labels'), canAdd: true,
           model: pgBrowser.SecLabelModel, group: 'security',
           mode: ['edit', 'create'], editable: false, type: 'collection',
           min_version: 90100, canEdit: false, canDelete: true,
-          control: 'unique-col-collection'
+          control: 'unique-col-collection',
         }],
         validate: function(keys) {
-          var err = {},
-              changedAttrs = this.changed,
-              msg = undefined;
+          var msg = undefined;
 
           // Nothing to validate
           if (keys && keys.length == 0) {
@@ -607,7 +604,7 @@ define('pgadmin.node.column', [
               msg = gettext('Length should not be greater than: ') + this.get('max_val');
             // If we have any error set then throw it to user
             if(msg) {
-              this.errorModel.set('attlen', msg)
+              this.errorModel.set('attlen', msg);
               return msg;
             }
           }
@@ -623,7 +620,7 @@ define('pgadmin.node.column', [
               msg = gettext('Precision should not be greater than: ') + this.get('max_val');
             // If we have any error set then throw it to user
             if(msg) {
-              this.errorModel.set('attprecision', msg)
+              this.errorModel.set('attprecision', msg);
               return msg;
             }
           }
@@ -668,7 +665,7 @@ define('pgadmin.node.column', [
             // inheritedfrom check is useful when we use this schema in table node
             // inheritedfrom has value then we should disable it
             if(!_.isUndefined(m.get('inheritedfrom'))) {
-                return true;
+              return true;
             }
             // ie: it's position is less then 1
             if (m.isNew()) {
@@ -680,55 +677,55 @@ define('pgadmin.node.column', [
             } else {
               return true;
             }
-           }
+          }
           return true;
         },
         editable_check_for_table: function(arg) {
-            if (arg instanceof Backbone.Collection) {
-                return !arg.model.prototype.inSchemaWithColumnCheck.apply(
+          if (arg instanceof Backbone.Collection) {
+            return !arg.model.prototype.inSchemaWithColumnCheck.apply(
                          this, [arg.top]
                        );
-            } else {
-                return !arg.inSchemaWithColumnCheck.apply(
+          } else {
+            return !arg.inSchemaWithColumnCheck.apply(
                          this, [arg]
                        );
-            }
-        }
+          }
+        },
       }),
       // Below function will enable right click menu for creating column
       canCreate: function(itemData, item, data) {
           // If check is false then , we will allow create menu
-          if (data && data.check == false)
-            return true;
+        if (data && data.check == false)
+          return true;
 
-          var t = pgBrowser.tree, i = item, d = itemData, parents = [];
+        var t = pgBrowser.tree, i = item, d = itemData, parents = [];
           // To iterate over tree to check parent node
-          while (i) {
+        while (i) {
             // If it is schema then allow user to create table
-            if (_.indexOf(['schema'], d._type) > -1) {
-              return true;
-            }
-            else if (_.indexOf(['view', 'coll-view',
-                                'mview',
-                                'coll-mview'], d._type) > -1) {
-              parents.push(d._type);
-              break;
-            }
+          if (_.indexOf(['schema'], d._type) > -1) {
+            return true;
+          }
+          else if (_.indexOf(['view', 'coll-view',
+            'mview',
+            'coll-mview'], d._type) > -1) {
             parents.push(d._type);
-            i = t.hasParent(i) ? t.parent(i) : null;
-            d = i ? t.itemData(i) : null;
+            break;
           }
+          parents.push(d._type);
+          i = t.hasParent(i) ? t.parent(i) : null;
+          d = i ? t.itemData(i) : null;
+        }
           // If node is under catalog then do not allow 'create' menu
-          if (_.indexOf(parents, 'catalog') > -1 ||
+        if (_.indexOf(parents, 'catalog') > -1 ||
               _.indexOf(parents, 'coll-view') > -1 ||
               _.indexOf(parents, 'coll-mview') > -1 ||
               _.indexOf(parents, 'mview') > -1 ||
               _.indexOf(parents, 'view') > -1) {
-            return false;
-          } else {
-            return true;
-          }
-      }
+          return false;
+        } else {
+          return true;
+        }
+      },
     });
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/js/check_constraint.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/js/check_constraint.js
index 3bc1ef11..bf7ef556 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/js/check_constraint.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/js/check_constraint.js
@@ -2,7 +2,7 @@
 define('pgadmin.node.check_constraint', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
   'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
-  'pgadmin.browser.collection'
+  'pgadmin.browser.collection',
 ], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
 
   // Check Constraint Node
@@ -21,7 +21,7 @@ define('pgadmin.node.check_constraint', [
       Init: function() {
         // Avoid mulitple registration of menus
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -30,13 +30,13 @@ define('pgadmin.node.check_constraint', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 5, label: gettext('Check...'),
           icon: 'wcTabIcon icon-check_constraint', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'validate_check_constraint', node: 'check_constraint', module: this,
           applies: ['object', 'context'], callback: 'validate_check_constraint',
           category: 'validate', priority: 4, label: gettext('Validate check constraint'),
-          icon: 'fa fa-link', enable : 'is_not_valid', data: {action: 'edit', check: true}
-        }
+          icon: 'fa fa-link', enable : 'is_not_valid', data: {action: 'edit', check: true},
+        },
         ]);
 
       },
@@ -50,10 +50,10 @@ define('pgadmin.node.check_constraint', [
       callbacks: {
         validate_check_constraint: function(args) {
           var input = args || {},
-          obj = this,
-          t = pgBrowser.tree,
-          i = input.item || t.selected(),
-          d = i && i.length == 1 ? t.itemData(i) : undefined;
+            obj = this,
+            t = pgBrowser.tree,
+            i = input.item || t.selected(),
+            d = i && i.length == 1 ? t.itemData(i) : undefined;
 
           if (!d) {
             return false;
@@ -73,19 +73,21 @@ define('pgadmin.node.check_constraint', [
                 setTimeout(function() {t.select(i);}, 100);
               }
             },
-            error: function(xhr, status, error) {
+            error: function(xhr) {
               try {
                 var err = $.parseJSON(xhr.responseText);
                 if (err.success == 0) {
                   alertify.error(err.errormsg);
                 }
-              } catch (e) {}
+              } catch (e) {
+                console.warn(e.stack || e);
+              }
               t.unload(i);
-            }
-            });
+            },
+          });
 
           return false;
-        }
+        },
       },
       canDrop: pgBrowser.Nodes['schema'].canChildDrop,
       model: pgAdmin.Browser.Node.Model.extend({
@@ -97,15 +99,15 @@ define('pgadmin.node.check_constraint', [
           description: undefined,
           consrc: undefined,
           connoinherit: undefined,
-          convalidated: true
+          convalidated: true,
         },
         // Check Constraint Schema
         schema: [{
           id: 'name', label: gettext('Name'), type:'text', cell:'string',
-          disabled: 'isDisabled'
+          disabled: 'isDisabled',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text' , mode: ['properties']
+          type: 'text' , mode: ['properties'],
         },{
           id: 'comment', label: gettext('Comment'), type: 'multiline', cell:
           'string', mode: ['properties', 'create', 'edit'],
@@ -120,15 +122,15 @@ define('pgadmin.node.check_constraint', [
             } else {
               return false;
             }
-          }
+          },
         },{
           id: 'consrc', label: gettext('Check'), type: 'multiline', cell:
           'string', group: gettext('Definition'), mode: ['properties',
-          'create', 'edit'], disabled: function(m) {
-            return ((_.has(m, 'handler') &&
+            'create', 'edit'], disabled: function(m) {
+              return ((_.has(m, 'handler') &&
               !_.isUndefined(m.handler) &&
               !_.isUndefined(m.get('oid'))) || (_.isFunction(m.isNew) && !m.isNew()));
-          }, editable: false
+            }, editable: false,
         },{
           id: 'connoinherit', label: gettext('No Inherit?'), type:
           'switch', cell: 'boolean', group: gettext('Definition'), mode:
@@ -140,7 +142,7 @@ define('pgadmin.node.check_constraint', [
                 _.has(m.node_info.table, 'is_partitioned') && m.node_info.table.is_partitioned)
             ){
               setTimeout(function(){
-                  m.set('connoinherit', false);
+                m.set('connoinherit', false);
               },10);
 
               return true;
@@ -149,9 +151,9 @@ define('pgadmin.node.check_constraint', [
             return ((_.has(m, 'handler') &&
               !_.isUndefined(m.handler) &&
               !_.isUndefined(m.get('oid'))) || (_.isFunction(m.isNew) && !m.isNew()));
-          }
+          },
         },{
-          id: 'convalidated', label: gettext("Don't validate?"), type: 'switch', cell:
+          id: 'convalidated', label: gettext('Don\'t validate?'), type: 'switch', cell:
           'boolean', group: gettext('Definition'), min_version: 90200,
           disabled: function(m) {
             if ((_.isFunction(m.isNew) && !m.isNew()) ||
@@ -159,17 +161,17 @@ define('pgadmin.node.check_constraint', [
                   !_.isUndefined(m.handler) &&
                   !_.isUndefined(m.get('oid')))) {
 
-              return !m.get("convalidated");
+              return !m.get('convalidated');
             } else {
               return false;
             }
           },
-          mode: ['properties', 'create', 'edit']
+          mode: ['properties', 'create', 'edit'],
         }],
         // Client Side Validation
         validate: function() {
           var err = {},
-              errmsg;
+            errmsg;
 
           if (_.isUndefined(this.get('consrc')) || String(this.get('consrc')).replace(/^\s+|\s+$/g, '') == '') {
             err['consrc'] = gettext('Check cannot be empty.');
@@ -198,32 +200,32 @@ define('pgadmin.node.check_constraint', [
             }
           }
           return false;
-        }
+        },
       }),
       // Below function will enable right click menu for creating check constraint.
       canCreate: function(itemData, item, data) {
           // If check is false then , we will allow create menu
-          if (data && data.check == false)
-            return true;
+        if (data && data.check == false)
+          return true;
 
-          var t = pgBrowser.tree, i = item, d = itemData, parents = [];
+        var t = pgBrowser.tree, i = item, d = itemData, parents = [];
           // To iterate over tree to check parent node
-          while (i) {
+        while (i) {
             // If it is schema then allow user to c reate table
-            if (_.indexOf(['schema'], d._type) > -1)
-              return true;
-            parents.push(d._type);
-            i = t.hasParent(i) ? t.parent(i) : null;
-            d = i ? t.itemData(i) : null;
-          }
-          // If node is under catalog then do not allow 'create' menu
-          if (_.indexOf(parents, 'catalog') > -1) {
-            return false;
-          } else {
+          if (_.indexOf(['schema'], d._type) > -1)
             return true;
-          }
-      }
-  });
+          parents.push(d._type);
+          i = t.hasParent(i) ? t.parent(i) : null;
+          d = i ? t.itemData(i) : null;
+        }
+          // If node is under catalog then do not allow 'create' menu
+        if (_.indexOf(parents, 'catalog') > -1) {
+          return false;
+        } else {
+          return true;
+        }
+      },
+    });
 
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/static/js/exclusion_constraint.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/static/js/exclusion_constraint.js
index 16294466..0bbf66a1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/static/js/exclusion_constraint.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/static/js/exclusion_constraint.js
@@ -1,8 +1,11 @@
 define('pgadmin.node.exclusion_constraint', [
-  'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify) {
+  'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
+  'sources/pgadmin', 'pgadmin.browser', 'alertify', 'pgadmin.backform',
+  'pgadmin.backgrid', 'pgadmin.browser.collection',
+], function(
+  gettext, url_for, $, _, Backbone, pgAdmin, pgBrowser, Alertify, Backform,
+  Backgrid
+) {
 
   var ExclusionConstraintColumnModel = pgBrowser.Node.Model.extend({
     defaults: {
@@ -12,7 +15,7 @@ define('pgadmin.node.exclusion_constraint', [
       nulls_order: false,
       operator:undefined,
       col_type:undefined,
-      is_sort_nulls_applicable: true
+      is_sort_nulls_applicable: true,
     },
     toJSON: function () {
       var d = pgBrowser.Node.Model.prototype.toJSON.apply(this, arguments);
@@ -20,139 +23,139 @@ define('pgadmin.node.exclusion_constraint', [
       return d;
     },
     schema: [{
-        id: 'column', label: gettext('Column'), type:'text', editable: false,
-        cell:'string'
-      },{
-        id: 'oper_class', label: gettext('Operator class'), type:'text',
-        node: 'table', url: 'get_oper_class', first_empty: true,
-        editable: function(m) {
-          if (m instanceof Backbone.Collection) {
-            return true;
-          } else if ((_.has(m.collection, 'handler') &&
-                !_.isUndefined(m.collection.handler) &&
-                !_.isUndefined(m.collection.handler.get('oid')))) {
-            return false;
-          } else if (_.has(m.collection, 'handler') &&
-                !_.isUndefined(m.collection.handler) &&
+      id: 'column', label: gettext('Column'), type:'text', editable: false,
+      cell:'string',
+    },{
+      id: 'oper_class', label: gettext('Operator class'), type:'text',
+      node: 'table', url: 'get_oper_class', first_empty: true,
+      editable: function(m) {
+        if (m instanceof Backbone.Collection) {
+          return true;
+        } else if ((_.has(m.collection, 'handler') &&
+          !_.isUndefined(m.collection.handler) &&
+            !_.isUndefined(m.collection.handler.get('oid')))) {
+          return false;
+        } else if (_.has(m.collection, 'handler') &&
+              !_.isUndefined(m.collection.handler) &&
                 !_.isUndefined(m.collection.handler.get('amname')) &&
                 m.collection.handler.get('amname') != 'btree') {
-            // Disable if access method is not btree
-            return false;
-          }
-          return true;
-        },
-        select2: {
-          allowClear: true, width: 'style', tags: true,
-          placeholder: gettext('Select the operator class')
-        }, cell: Backgrid.Extension.Select2Cell.extend({
-          initialize: function () {
-            Backgrid.Extension.Select2Cell.prototype.initialize.apply(this, arguments);
+                  // Disable if access method is not btree
+          return false;
+        }
+        return true;
+      },
+      select2: {
+        allowClear: true, width: 'style', tags: true,
+        placeholder: gettext('Select the operator class'),
+      }, cell: Backgrid.Extension.Select2Cell.extend({
+        initialize: function () {
+          Backgrid.Extension.Select2Cell.prototype.initialize.apply(this, arguments);
 
           var self = this,
             url = self.column.get('url') || self.defaults.url,
             m = self.model,
             indextype = self.model.collection.handler.get('amname');
 
-            if (url && (indextype == 'btree' || _.isUndefined(indextype) ||
-                _.isNull(indextype) || indextype == '')) {
+          if (url && (indextype == 'btree' || _.isUndefined(indextype) ||
+            _.isNull(indextype) || indextype == '')) {
               // Set sort_order and nulls to true if access method is btree
-              setTimeout(function() {
-                m.set('order', true);
-                m.set('nulls_order', true);
-              }, 10);
-
-              var node = this.column.get('schema_node'),
-                  eventHandler = m.top || m,
-                  node_info = this.column.get('node_info'),
-                  full_url = node.generate_url.apply(
-                    node, [
-                      null, url, this.column.get('node_data'),
-                      this.column.get('url_with_id') || false, node_info
-                    ]),
-                  data = [];
-
-              indextype = 'btree';
-
-              if (this.column.get('version_compatible')) {
-                eventHandler.trigger('pgadmin:view:fetching', m, self.column);
-                $.ajax({
-                  async: false,
-                  data : {indextype:indextype},
-                  url: full_url,
-                  success: function(res) {
-                    data = res.data;
-                    self.column.set('options', data);
-                  },
-                  error: function() {
-                    eventHandler.trigger('pgadmin:view:fetch:error', m, self.column);
-                  }
-                });
-                eventHandler.trigger('pgadmin:view:fetched', m, self.column);
-              }
-            } else {
-              self.column.set('options', []);
+            setTimeout(function() {
+              m.set('order', true);
+              m.set('nulls_order', true);
+            }, 10);
+
+            var node = this.column.get('schema_node'),
+              eventHandler = m.top || m,
+              node_info = this.column.get('node_info'),
+              full_url = node.generate_url.apply(
+                  node, [
+                    null, url, this.column.get('node_data'),
+                    this.column.get('url_with_id') || false, node_info,
+                  ]),
+              data = [];
+
+            indextype = 'btree';
+
+            if (this.column.get('version_compatible')) {
+              eventHandler.trigger('pgadmin:view:fetching', m, self.column);
+              $.ajax({
+                async: false,
+                data : {indextype:indextype},
+                url: full_url,
+                success: function(res) {
+                  data = res.data;
+                  self.column.set('options', data);
+                },
+                error: function() {
+                  eventHandler.trigger('pgadmin:view:fetch:error', m, self.column);
+                },
+              });
+              eventHandler.trigger('pgadmin:view:fetched', m, self.column);
             }
-          }
-        })
-      },{
-        id: 'order', label: gettext('DESC'), type: 'switch',
-        options: {
-          onText: 'ASC',
-          offText: 'DESC',
-        },
-        editable: function(m) {
-          if (m instanceof Backbone.Collection) {
-            return true;
-          } else if ((_.has(m.collection, 'handler') &&
-                !_.isUndefined(m.collection.handler) &&
-                !_.isUndefined(m.collection.handler.get('oid')))) {
-            return false;
-          } else if (m.top.get('amname') === 'btree') {
-            m.set('is_sort_nulls_applicable', true);
-            return true;
           } else {
-            m.set('is_sort_nulls_applicable', false);
-            return false;
+            self.column.set('options', []);
           }
-        }
-      },{
-        id: 'nulls_order', label: gettext('NULLs order'), type:"switch",
-        options: {
-          onText: 'FIRST',
-          offText: 'LAST',
         },
-        editable: function(m) {
-          if (m instanceof Backbone.Collection) {
-            return true;
-          } else if ((_.has(m.collection, 'handler') &&
-                !_.isUndefined(m.collection.handler) &&
-                !_.isUndefined(m.collection.handler.get('oid')))) {
-            return false;
-          } else if (m.top.get('amname') === 'btree') {
-              m.set('is_sort_nulls_applicable', true);
-              return true;
-          } else {
-            m.set('is_sort_nulls_applicable', false);
-            return false;
-          }
+      }),
+    },{
+      id: 'order', label: gettext('DESC'), type: 'switch',
+      options: {
+        onText: 'ASC',
+        offText: 'DESC',
+      },
+      editable: function(m) {
+        if (m instanceof Backbone.Collection) {
+          return true;
+        } else if ((_.has(m.collection, 'handler') &&
+          !_.isUndefined(m.collection.handler) &&
+            !_.isUndefined(m.collection.handler.get('oid')))) {
+          return false;
+        } else if (m.top.get('amname') === 'btree') {
+          m.set('is_sort_nulls_applicable', true);
+          return true;
+        } else {
+          m.set('is_sort_nulls_applicable', false);
+          return false;
         }
-      },{
-        id: 'operator', label: gettext('Operator'), type: 'text',
-        node: 'table', url: 'get_operator',
-        editable: function(m) {
-          if (m instanceof Backbone.Collection) {
-            return true;
-          }
-          if ((_.has(m.collection, 'handler') &&
-                !_.isUndefined(m.collection.handler) &&
-                !_.isUndefined(m.collection.handler.get('oid')))) {
-            return false;
-          }
+      },
+    },{
+      id: 'nulls_order', label: gettext('NULLs order'), type:'switch',
+      options: {
+        onText: 'FIRST',
+        offText: 'LAST',
+      },
+      editable: function(m) {
+        if (m instanceof Backbone.Collection) {
           return true;
-        },
-        select2: {
-          allowClear: false, width: 'style',
-        }, cell: Backgrid.Extension.Select2Cell.extend({
+        } else if ((_.has(m.collection, 'handler') &&
+          !_.isUndefined(m.collection.handler) &&
+            !_.isUndefined(m.collection.handler.get('oid')))) {
+          return false;
+        } else if (m.top.get('amname') === 'btree') {
+          m.set('is_sort_nulls_applicable', true);
+          return true;
+        } else {
+          m.set('is_sort_nulls_applicable', false);
+          return false;
+        }
+      },
+    },{
+      id: 'operator', label: gettext('Operator'), type: 'text',
+      node: 'table', url: 'get_operator',
+      editable: function(m) {
+        if (m instanceof Backbone.Collection) {
+          return true;
+        }
+        if ((_.has(m.collection, 'handler') &&
+          !_.isUndefined(m.collection.handler) &&
+            !_.isUndefined(m.collection.handler.get('oid')))) {
+          return false;
+        }
+        return true;
+      },
+      select2: {
+        allowClear: false, width: 'style',
+      }, cell: Backgrid.Extension.Select2Cell.extend({
         initialize: function () {
           Backgrid.Extension.Select2Cell.prototype.initialize.apply(this, arguments);
 
@@ -161,39 +164,39 @@ define('pgadmin.node.exclusion_constraint', [
             m = self.model,
             col_type = self.model.get('col_type');
 
-            self.column.set('options', []);
-
-            if (url && !_.isUndefined(col_type) && !_.isNull(col_type) && col_type != '') {
-              var node = this.column.get('schema_node'),
-                  eventHandler = m.top || m,
-                  node_info = this.column.get('node_info'),
-                  full_url = node.generate_url.apply(
-                    node, [
-                      null, url, this.column.get('node_data'),
-                      this.column.get('url_with_id') || false, node_info
-                    ]),
-                  data = [];
-
-              if (this.column.get('version_compatible')) {
-                eventHandler.trigger('pgadmin:view:fetching', m, self.column);
-                $.ajax({
-                  async: false,
-                  data : {col_type:col_type},
-                  url: full_url,
-                  success: function(res) {
-                    data = res.data;
-                    self.column.set('options', data);
-                  },
-                  error: function() {
-                    eventHandler.trigger('pgadmin:view:fetch:error', m, self.column);
-                  }
-                });
-                eventHandler.trigger('pgadmin:view:fetched', m, self.column);
-              }
+          self.column.set('options', []);
+
+          if (url && !_.isUndefined(col_type) && !_.isNull(col_type) && col_type != '') {
+            var node = this.column.get('schema_node'),
+              eventHandler = m.top || m,
+              node_info = this.column.get('node_info'),
+              full_url = node.generate_url.apply(
+                node, [
+                  null, url, this.column.get('node_data'),
+                  this.column.get('url_with_id') || false, node_info,
+                ]),
+              data = [];
+
+            if (this.column.get('version_compatible')) {
+              eventHandler.trigger('pgadmin:view:fetching', m, self.column);
+              $.ajax({
+                async: false,
+                data : {col_type:col_type},
+                url: full_url,
+                success: function(res) {
+                  data = res.data;
+                  self.column.set('options', data);
+                },
+                error: function() {
+                  eventHandler.trigger('pgadmin:view:fetch:error', m, self.column);
+                },
+              });
+              eventHandler.trigger('pgadmin:view:fetched', m, self.column);
             }
           }
-        })
-      }
+        },
+      }),
+    },
     ],
     validate: function() {
       this.errorModel.clear();
@@ -205,25 +208,25 @@ define('pgadmin.node.exclusion_constraint', [
         return msg;
       }
       return null;
-    }
+    },
   });
 
   var ExclusionConstraintColumnControl =  Backform.ExclusionConstraintColumnControl =
     Backform.UniqueColCollectionControl.extend({
 
-    initialize: function(opts) {
-      Backform.UniqueColCollectionControl.prototype.initialize.apply(
-        this, arguments
-          );
+      initialize: function() {
+        Backform.UniqueColCollectionControl.prototype.initialize.apply(
+          this, arguments
+        );
 
-      var self = this,
-        node = 'exclusion_constraint',
-        headerSchema = [{
-          id: 'column', label:'', type:'text',
-          node: 'column', control: Backform.NodeListByNameControl.extend({
-            initialize: function() {
-              // Here we will decide if we need to call URL
-              // Or fetch the data from parent columns collection
+        var self = this,
+          node = 'exclusion_constraint',
+          headerSchema = [{
+            id: 'column', label:'', type:'text',
+            node: 'column', control: Backform.NodeListByNameControl.extend({
+              initialize: function() {
+                // Here we will decide if we need to call URL
+                // Or fetch the data from parent columns collection
                 if(self.model.handler) {
                   Backform.Select2Control.prototype.initialize.apply(this, arguments);
                   // Do not listen for any event(s) for existing constraint.
@@ -237,367 +240,367 @@ define('pgadmin.node.exclusion_constraint', [
                 } else {
                   Backform.NodeListByNameControl.prototype.initialize.apply(this, arguments);
                 }
-            },
-            removeColumn: function (m) {
-              var that = this;
-              setTimeout(function   () {
-                that.custom_options();
-                that.render.apply(that);
-              }, 50);
-            },
-            resetColOptions: function(m) {
-              var that = this;
+              },
+              removeColumn: function () {
+                var that = this;
+                setTimeout(function   () {
+                  that.custom_options();
+                  that.render.apply(that);
+                }, 50);
+              },
+              resetColOptions: function(m) {
+                var that = this;
 
-              if (m.previous('name') ==  self.headerData.get('column')) {
-                /*
-                 * Table column name has changed so update
-                 * column name in exclusion constraint as well.
-                 */
-                self.headerData.set(
-                  {"column": m.get('name')});
+                if (m.previous('name') ==  self.headerData.get('column')) {
+                  /*
+                   * Table column name has changed so update
+                   * column name in exclusion constraint as well.
+                   */
+                  self.headerData.set(
+                    {'column': m.get('name')});
                   self.headerDataChanged();
-              }
+                }
 
-              setTimeout(function () {
-                that.custom_options();
-                that.render.apply(that);
-              }, 50);
-            },
-            custom_options: function() {
-              // We will add all the columns entered by user in table model
-              var columns = self.model.top.get('columns'),
+                setTimeout(function () {
+                  that.custom_options();
+                  that.render.apply(that);
+                }, 50);
+              },
+              custom_options: function() {
+                // We will add all the columns entered by user in table model
+                var columns = self.model.top.get('columns'),
                   added_columns_from_tables = [],
                   col_types = [];
 
-              if (columns.length > 0) {
-                _.each(columns.models, function(m) {
-                  var col = m.get('name');
-                  if(!_.isUndefined(col) && !_.isNull(col)) {
-                    added_columns_from_tables.push({
-                      label: col, value: col, image:'icon-column'
+                if (columns.length > 0) {
+                  _.each(columns.models, function(m) {
+                    var col = m.get('name');
+                    if(!_.isUndefined(col) && !_.isNull(col)) {
+                      added_columns_from_tables.push({
+                        label: col, value: col, image:'icon-column',
                       });
-                    col_types.push({name:col, type:m.get('cltype')});
-                  }
-                });
-              }
-              // Set the values in to options so that user can select
-              this.field.set('options', added_columns_from_tables);
-              self.field.set('col_types', col_types);
-            },
-            remove: function () {
-              if(self.model.handler) {
+                      col_types.push({name:col, type:m.get('cltype')});
+                    }
+                  });
+                }
+                // Set the values in to options so that user can select
+                this.field.set('options', added_columns_from_tables);
+                self.field.set('col_types', col_types);
+              },
+              remove: function () {
+                if(self.model.handler) {
                   var tableCols = self.model.top.get('columns');
                   this.stopListening(tableCols, 'remove' , this.removeColumn);
                   this.stopListening(tableCols, 'change:name' , this.resetColOptions);
                   this.stopListening(tableCols, 'change:cltype' , this.resetColOptions);
 
-                Backform.Select2Control.prototype.remove.apply(this, arguments);
+                  Backform.Select2Control.prototype.remove.apply(this, arguments);
 
-              } else {
-                Backform.NodeListByNameControl.prototype.remove.apply(this, arguments);
-              }
-            },
-            template: _.template([
-              '<div class="<%=Backform.controlsClassName%> <%=extraClasses.join(\' \')%>">',
-              '  <select class="pgadmin-node-select form-control" name="<%=name%>" style="width:100%;" value="<%-value%>" <%=disabled ? "disabled" : ""%> <%=required ? "required" : ""%> >',
-              '    <% for (var i=0; i < options.length; i++) { %>',
-              '    <% var option = options[i]; %>',
-              '    <option <% if (option.image) { %> data-image=<%= option.image %> <% } %> value=<%= formatter.fromRaw(option.value) %> <%=option.value === rawValue ? "selected=\'selected\'" : "" %>><%-option.label%></option>',
-              '    <% } %>',
-              '  </select>',
-              '</div>'].join("\n"))
-          }),
-          transform: function(rows) {
-            // This will only get called in case of NodeListByNameControl.
-
-            var that = this,
+                } else {
+                  Backform.NodeListByNameControl.prototype.remove.apply(this, arguments);
+                }
+              },
+              template: _.template([
+                '<div class="<%=Backform.controlsClassName%> <%=extraClasses.join(\' \')%>">',
+                '  <select class="pgadmin-node-select form-control" name="<%=name%>" style="width:100%;" value="<%-value%>" <%=disabled ? "disabled" : ""%> <%=required ? "required" : ""%> >',
+                '    <% for (var i=0; i < options.length; i++) { %>',
+                '    <% var option = options[i]; %>',
+                '    <option <% if (option.image) { %> data-image=<%= option.image %> <% } %> value=<%= formatter.fromRaw(option.value) %> <%=option.value === rawValue ? "selected=\'selected\'" : "" %>><%-option.label%></option>',
+                '    <% } %>',
+                '  </select>',
+                '</div>'].join('\n')),
+            }),
+            transform: function(rows) {
+              // This will only get called in case of NodeListByNameControl.
+
+              var that = this,
                 node = that.field.get('schema_node'),
                 res = [],
                 col_types = [],
                 filter = that.field.get('filter') || function() { return true; };
 
-            filter = filter.bind(that);
+              filter = filter.bind(that);
 
-            _.each(rows, function(r) {
-              if (filter(r)) {
-                var l = (_.isFunction(node['node_label']) ?
-                      (node['node_label']).apply(node, [r, that.model, that]) :
+              _.each(rows, function(r) {
+                if (filter(r)) {
+                  var l = (_.isFunction(node['node_label']) ?
+                    (node['node_label']).apply(node, [r, that.model, that]) :
                       r.label),
                     image = (_.isFunction(node['node_image']) ?
                       (node['node_image']).apply(
                         node, [r, that.model, that]
-                        ) :
-                      (node['node_image'] || ('icon-' + node.type)));
-                res.push({
-                  'value': r.label,
-                  'image': image,
-                  'label': l
-                });
-                col_types.push({name:r.label, type:r.datatype});
-              }
-            });
-            self.field.set('col_types', col_types);
-            return res;
-          },
-          canAdd: function(m) {
-            return !((_.has(m, 'handler') &&
-              !_.isUndefined(m.handler) &&
-              !_.isUndefined(m.get('oid'))) || (_.isFunction(m.isNew) && !m.isNew()));
-          },
-          select2: {
-            allowClear: false, width: 'style',
-            placeholder: 'Select column'
-          }, first_empty: !self.model.isNew(),
-          disabled: function(m) {
-            return !_.isUndefined(self.model.get('oid'));
-          }
-        }],
-        headerDefaults = {column: null},
+                      ) :
+                        (node['node_image'] || ('icon-' + node.type)));
+                  res.push({
+                    'value': r.label,
+                    'image': image,
+                    'label': l,
+                  });
+                  col_types.push({name:r.label, type:r.datatype});
+                }
+              });
+              self.field.set('col_types', col_types);
+              return res;
+            },
+            canAdd: function(m) {
+              return !((_.has(m, 'handler') &&
+                !_.isUndefined(m.handler) &&
+                  !_.isUndefined(m.get('oid'))) || (_.isFunction(m.isNew) && !m.isNew()));
+            },
+            select2: {
+              allowClear: false, width: 'style',
+              placeholder: 'Select column',
+            }, first_empty: !self.model.isNew(),
+            disabled: function() {
+              return !_.isUndefined(self.model.get('oid'));
+            },
+          }],
+          headerDefaults = {column: null},
 
-        gridCols = ['column', 'oper_class', 'order', 'nulls_order', 'operator'];
+          gridCols = ['column', 'oper_class', 'order', 'nulls_order', 'operator'];
 
-      self.headerData = new (Backbone.Model.extend({
-        defaults: headerDefaults,
-        schema: headerSchema
-      }))({});
+        self.headerData = new (Backbone.Model.extend({
+          defaults: headerDefaults,
+          schema: headerSchema,
+        }))({});
 
-      var headerGroups = Backform.generateViewSchema(
+        var headerGroups = Backform.generateViewSchema(
           self.field.get('node_info'), self.headerData, 'create',
           node, self.field.get('node_data')
-          ),
+        ),
           fields = [];
 
-      _.each(headerGroups, function(o) {
-        fields = fields.concat(o.fields);
-      });
+        _.each(headerGroups, function(o) {
+          fields = fields.concat(o.fields);
+        });
 
-      self.headerFields = new Backform.Fields(fields);
-      self.gridSchema = Backform.generateGridColumnsFromModel(
+        self.headerFields = new Backform.Fields(fields);
+        self.gridSchema = Backform.generateGridColumnsFromModel(
           self.field.get('node_info'), self.field.get('model'), 'edit', gridCols, self.field.get('schema_node')
-          );
+        );
 
-      self.controls = [];
-      self.listenTo(self.headerData, "change", self.headerDataChanged);
-      self.listenTo(self.headerData, "select2", self.headerDataChanged);
-      self.listenTo(self.collection, "add", self.onAddorRemoveColumns);
-      self.listenTo(self.collection, "remove", self.onAddorRemoveColumns);
-    },
+        self.controls = [];
+        self.listenTo(self.headerData, 'change', self.headerDataChanged);
+        self.listenTo(self.headerData, 'select2', self.headerDataChanged);
+        self.listenTo(self.collection, 'add', self.onAddorRemoveColumns);
+        self.listenTo(self.collection, 'remove', self.onAddorRemoveColumns);
+      },
 
-    generateHeader: function(data) {
-      var header = [
-        '<div class="subnode-header-form">',
-        ' <div class="container-fluid">',
-        '  <div class="row">',
-        '   <div class="col-xs-4">',
-        '    <label class="control-label"><%-column_label%></label>',
-        '   </div>',
-        '   <div class="col-xs-4" header="column"></div>',
-        '   <div class="col-xs-4">',
-        '     <button class="btn-sm btn-default add fa fa-plus" <%=canAdd ? "" : "disabled=\'disabled\'"%> ></button>',
-        '   </div>',
-        '  </div>',
-        ' </div>',
-        '</div>',].join("\n")
-
-      _.extend(data, {
-        column_label: gettext('Column')
-      });
-
-      var self = this,
+      generateHeader: function(data) {
+        var header = [
+          '<div class="subnode-header-form">',
+          ' <div class="container-fluid">',
+          '  <div class="row">',
+          '   <div class="col-xs-4">',
+          '    <label class="control-label"><%-column_label%></label>',
+          '   </div>',
+          '   <div class="col-xs-4" header="column"></div>',
+          '   <div class="col-xs-4">',
+          '     <button class="btn-sm btn-default add fa fa-plus" <%=canAdd ? "" : "disabled=\'disabled\'"%> ></button>',
+          '   </div>',
+          '  </div>',
+          ' </div>',
+          '</div>'].join('\n');
+
+        _.extend(data, {
+          column_label: gettext('Column'),
+        });
+
+        var self = this,
           headerTmpl = _.template(header),
           $header = $(headerTmpl(data)),
           controls = this.controls;
 
-      this.headerFields.each(function(field) {
-        var control = new (field.get("control"))({
-          field: field,
-          model: self.headerData
-        });
+        this.headerFields.each(function(field) {
+          var control = new (field.get('control'))({
+            field: field,
+            model: self.headerData,
+          });
 
-        $header.find('div[header="' + field.get('name') + '"]').append(
-          control.render().$el
-        );
+          $header.find('div[header="' + field.get('name') + '"]').append(
+            control.render().$el
+          );
 
-        controls.push(control);
-      });
+          controls.push(control);
+        });
 
-      // We should not show in properties mode
-      if (data.mode == 'properties') {
-        $header.html('');
-      }
+        // We should not show in properties mode
+        if (data.mode == 'properties') {
+          $header.html('');
+        }
 
-      self.$header = $header;
+        self.$header = $header;
 
-      return $header;
-    },
+        return $header;
+      },
 
-    events: _.extend(
-                  {}, Backform.UniqueColCollectionControl.prototype.events,
-                {'click button.add': 'addColumns'}
-                ),
+      events: _.extend(
+        {}, Backform.UniqueColCollectionControl.prototype.events,
+        {'click button.add': 'addColumns'}
+      ),
 
-    showGridControl: function(data) {
-      var self = this,
-          titleTmpl = _.template("<div class='subnode-header'></div>"),
+      showGridControl: function(data) {
+        var self = this,
+          titleTmpl = _.template('<div class=\'subnode-header\'></div>'),
           $gridBody =
-            $("<div class='pgadmin-control-group backgrid form-group col-xs-12 object subnode'></div>").append(
-              // Append titleTmpl only if create/edit mode
-              data.mode !== 'properties' ? titleTmpl({label: data.label}) : ''
-            );
+          $('<div class=\'pgadmin-control-group backgrid form-group col-xs-12 object subnode\'></div>').append(
+            // Append titleTmpl only if create/edit mode
+            data.mode !== 'properties' ? titleTmpl({label: data.label}) : ''
+          );
 
-      $gridBody.append(self.generateHeader(data));
+        $gridBody.append(self.generateHeader(data));
 
-      var gridColumns = _.clone(this.gridSchema.columns);
+        var gridColumns = _.clone(this.gridSchema.columns);
 
-      // Insert Delete Cell into Grid
-      if (data.disabled == false && data.canDelete) {
+        // Insert Delete Cell into Grid
+        if (data.disabled == false && data.canDelete) {
           gridColumns.unshift({
-            name: "pg-backform-delete", label: "",
+            name: 'pg-backform-delete', label: '',
             cell: Backgrid.Extension.DeleteCell,
-            editable: false, cell_priority: -1
+            editable: false, cell_priority: -1,
           });
-      }
+        }
 
-      if (self.grid) {
-        self.grid.remove();
-        self.grid.null;
-      }
-      // Initialize a new Grid instance
-      var grid = self.grid = new Backgrid.Grid({
-        columns: gridColumns,
-        collection: self.collection,
-        className: "backgrid table-bordered"
-      });
-      self.$grid = grid.render().$el;
-
-      $gridBody.append(self.$grid);
-
-      setTimeout(function() {
-        self.headerData.set({
-          'column': self.$header.find(
-            'div[header="column"] select'
-            ).val()
-            }, {silent:true}
+        if (self.grid) {
+          self.grid.remove();
+          self.grid.null;
+        }
+        // Initialize a new Grid instance
+        var grid = self.grid = new Backgrid.Grid({
+          columns: gridColumns,
+          collection: self.collection,
+          className: 'backgrid table-bordered',
+        });
+        self.$grid = grid.render().$el;
+
+        $gridBody.append(self.$grid);
+
+        setTimeout(function() {
+          self.headerData.set({
+            'column': self.$header.find(
+              'div[header="column"] select'
+            ).val(),
+          }, {silent:true}
           );
-      }, 10);
+        }, 10);
 
-      // Remove unwanted class from grid to display it properly
-      if(data.mode === 'properties')
-        $gridBody.find('.subnode-header-form').removeClass('subnode-header-form');
+        // Remove unwanted class from grid to display it properly
+        if(data.mode === 'properties')
+          $gridBody.find('.subnode-header-form').removeClass('subnode-header-form');
 
-      // Render node grid
-      return $gridBody;
-    },
+        // Render node grid
+        return $gridBody;
+      },
 
-    headerDataChanged: function() {
-      var self = this, val,
+      headerDataChanged: function() {
+        var self = this, val,
           data = this.headerData.toJSON(),
           inSelected = false,
           checkVars = ['column'];
 
-      if (!self.$header) {
-        return;
-      }
+        if (!self.$header) {
+          return;
+        }
 
-      if (self.control_data.canAdd) {
-        self.collection.each(function(m) {
-          if (!inSelected) {
-            _.each(checkVars, function(v) {
-              if (!inSelected) {
-                val = m.get(v);
-                inSelected = ((
-                  (_.isUndefined(val) || _.isNull(val)) &&
-                  (_.isUndefined(data[v]) || _.isNull(data[v]))
+        if (self.control_data.canAdd) {
+          self.collection.each(function(m) {
+            if (!inSelected) {
+              _.each(checkVars, function(v) {
+                if (!inSelected) {
+                  val = m.get(v);
+                  inSelected = ((
+                    (_.isUndefined(val) || _.isNull(val)) &&
+                      (_.isUndefined(data[v]) || _.isNull(data[v]))
                   ) ||
-                  (val == data[v]));
-              }
-            });
-          }
-        });
-      }
-      else {
-        inSelected = true;
-      }
+                      (val == data[v]));
+                }
+              });
+            }
+          });
+        }
+        else {
+          inSelected = true;
+        }
 
-      self.$header.find('button.add').prop('disabled', inSelected);
-    },
+        self.$header.find('button.add').prop('disabled', inSelected);
+      },
 
-    addColumns: function(ev) {
-      ev.preventDefault();
-      var self = this,
+      addColumns: function(ev) {
+        ev.preventDefault();
+        var self = this,
           column = self.headerData.get('column');
 
-      if (!column || column == '') {
-        return false;
-      }
+        if (!column || column == '') {
+          return false;
+        }
 
-      var coll = self.model.get(self.field.get('name')),
+        var coll = self.model.get(self.field.get('name')),
           m = new (self.field.get('model'))(
-                self.headerData.toJSON(), {
-                  silent: true, top: self.model.top,
-                  collection: coll, handler: coll
-                }),
+            self.headerData.toJSON(), {
+              silent: true, top: self.model.top,
+              collection: coll, handler: coll,
+            }),
           col_types =self.field.get('col_types') || [];
 
-      for(var i=0; i < col_types.length; i++) {
-        var col_type = col_types[i];
-        if (col_type['name'] ==  m.get('column')) {
+        for(var i=0; i < col_types.length; i++) {
+          var col_type = col_types[i];
+          if (col_type['name'] ==  m.get('column')) {
             m.set({'col_type':col_type['type']});
-          break;
+            break;
+          }
         }
-      }
 
-      coll.add(m);
+        coll.add(m);
 
-      var idx = coll.indexOf(m);
+        var idx = coll.indexOf(m);
 
-      // idx may not be always > -1 because our UniqueColCollection may
-      // remove 'm' if duplicate value found.
-      if (idx > -1) {
-        self.$grid.find('.new').removeClass('new');
+        // idx may not be always > -1 because our UniqueColCollection may
+        // remove 'm' if duplicate value found.
+        if (idx > -1) {
+          self.$grid.find('.new').removeClass('new');
 
-        var newRow = self.grid.body.rows[idx].$el;
+          var newRow = self.grid.body.rows[idx].$el;
 
-        newRow.addClass("new");
-        $(newRow).pgMakeVisible('backform-tab');
-      } else {
-        //delete m;
-      }
+          newRow.addClass('new');
+          $(newRow).pgMakeVisible('backform-tab');
+        } else {
+          //delete m;
+        }
 
-      return false;
-    },
+        return false;
+      },
 
-    onAddorRemoveColumns: function() {
-      var self = this;
+      onAddorRemoveColumns: function() {
+        var self = this;
 
-      // Wait for collection to be updated before checking for the button to be
-      // enabled, or not.
-      setTimeout(function() {
+        // Wait for collection to be updated before checking for the button to be
+        // enabled, or not.
+        setTimeout(function() {
           self.collection.trigger('pgadmin:columns:updated', self.collection);
-        self.headerDataChanged();
-      }, 10);
-    },
-
-    remove: function() {
-      /*
-       * Stop listening the events registered by this control.
-       */
-      this.stopListening(this.headerData, "change", this.headerDataChanged);
-      this.listenTo(this.headerData, "select2", this.headerDataChanged);
-      this.listenTo(this.collection, "remove", this.onAddorRemoveColumns);
+          self.headerDataChanged();
+        }, 10);
+      },
 
-      // Remove header controls.
-      _.each(this.controls, function(controls) {
-        controls.remove();
-      });
+      remove: function() {
+        /*
+         * Stop listening the events registered by this control.
+         */
+        this.stopListening(this.headerData, 'change', this.headerDataChanged);
+        this.listenTo(this.headerData, 'select2', this.headerDataChanged);
+        this.listenTo(this.collection, 'remove', this.onAddorRemoveColumns);
+
+        // Remove header controls.
+        _.each(this.controls, function(controls) {
+          controls.remove();
+        });
 
-      ExclusionConstraintColumnControl.__super__.remove.apply(this, arguments);
+        ExclusionConstraintColumnControl.__super__.remove.apply(this, arguments);
 
-      // Remove the header model
-      delete (this.headerData);
+        // Remove the header model
+        delete (this.headerData);
 
-    }
-  });
+      },
+    });
 
   // Extend the browser's node class for exclusion constraint node
   if (!pgBrowser.Nodes['exclusion_constraint']) {
@@ -619,7 +622,7 @@ define('pgadmin.node.exclusion_constraint', [
       Init: function() {
         /* Avoid multiple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -628,7 +631,7 @@ define('pgadmin.node.exclusion_constraint', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Exclusion constraint...'),
           icon: 'wcTabIcon icon-exclusion_constraint', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         }]);
       },
       is_not_valid: function(node) {
@@ -643,11 +646,11 @@ define('pgadmin.node.exclusion_constraint', [
           oid: undefined,
           comment: undefined,
           spcname: undefined,
-          amname: "gist",
+          amname: 'gist',
           fillfactor: undefined,
           condeferrable: undefined,
           condeferred: undefined,
-          columns: []
+          columns: [],
         },
 
         // Define the schema for the exclusion constraint node
@@ -656,7 +659,7 @@ define('pgadmin.node.exclusion_constraint', [
           mode: ['properties', 'create', 'edit'], editable: true,
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text' , mode: ['properties']
+          type: 'text' , mode: ['properties'],
         },{
           id: 'comment', label: gettext('Comment'), cell: 'string',
           type: 'multiline', mode: ['properties', 'create', 'edit'],
@@ -664,14 +667,14 @@ define('pgadmin.node.exclusion_constraint', [
             var name = m.get('name');
             if (!(name && name != '')) {
               setTimeout(function(){
-              if(m.get('comment') && m.get('comment') !== '')
-                 m.set('comment', null);
+                if(m.get('comment') && m.get('comment') !== '')
+                  m.set('comment', null);
               },10);
               return true;
             } else {
               return false;
             }
-          }
+          },
         },{
           id: 'spcname', label: gettext('Tablespace'),
           type: 'text', group: gettext('Definition'),
@@ -679,65 +682,65 @@ define('pgadmin.node.exclusion_constraint', [
           select2:{allowClear:false},
           filter: function(m) {
             // Don't show pg_global tablespace in selection.
-            if (m.label == "pg_global") return false;
+            if (m.label == 'pg_global') return false;
             else return true;
-          }
+          },
         },{
           id: 'amname', label: gettext('Access method'),
           type: 'text', group: gettext('Definition'),
-          url:"get_access_methods", node: 'table',
+          url:'get_access_methods', node: 'table',
           control: Backform.NodeAjaxOptionsControl.extend({
             // When access method changes we need to clear columns collection
             onChange: function() {
               Backform.NodeAjaxOptionsControl.prototype.onChange.apply(this, arguments);
               var self = this,
-              // current access method
-              current_am = self.model.get('amname'),
-              // previous access method
-              previous_am = self.model.previous('amname'),
-              column_collection = self.model.get('columns');
+                // current access method
+                current_am = self.model.get('amname'),
+                // previous access method
+                previous_am = self.model.previous('amname'),
+                column_collection = self.model.get('columns');
 
               if (column_collection.length > 0 && current_am != previous_am) {
                 var msg = gettext('Changing access method will clear columns collection');
-                Alertify.confirm(msg, function (e) {
-                    // User clicks Ok, lets clear collection.
-                    column_collection.each(function(m) {
-                      /*
-                       * Our datamodel do not support collection reset method.
-                       * So remove model one by one.
-                       */
-                      column_collection.remove(m);
-                    });
-                    setTimeout(function() {
-                      column_collection.trigger('pgadmin:columns:updated', column_collection);
-                    }, 10);
-
-                  }, function() {
-                    // User clicks Cancel set previous value again in combo box
-                    setTimeout(function(){
-                      self.model.set('amname', previous_am);
-                    }, 10);
+                Alertify.confirm(msg, function () {
+                  // User clicks Ok, lets clear collection.
+                  column_collection.each(function(m) {
+                    /*
+                     * Our datamodel do not support collection reset method.
+                     * So remove model one by one.
+                     */
+                    column_collection.remove(m);
+                  });
+                  setTimeout(function() {
+                    column_collection.trigger('pgadmin:columns:updated', column_collection);
+                  }, 10);
+
+                }, function() {
+                  // User clicks Cancel set previous value again in combo box
+                  setTimeout(function(){
+                    self.model.set('amname', previous_am);
+                  }, 10);
                 });
               }
-            }
+            },
           }),
           select2:{allowClear:true},
           disabled: function(m) {
             return ((_.has(m, 'handler') &&
               !_.isUndefined(m.handler) &&
-              !_.isUndefined(m.get('oid'))) || (_.isFunction(m.isNew) && !m.isNew()));
-          }
+                !_.isUndefined(m.get('oid'))) || (_.isFunction(m.isNew) && !m.isNew()));
+          },
         },{
           id: 'fillfactor', label: gettext('Fill factor'),
-          type: 'int', group: gettext('Definition'), allowNull: true
+          type: 'int', group: gettext('Definition'), allowNull: true,
         },{
           id: 'condeferrable', label: gettext('Deferrable?'),
           type: 'switch', group: gettext('Definition'), deps: ['index'],
           disabled: function(m) {
             return ((_.has(m, 'handler') &&
               !_.isUndefined(m.handler) &&
-              !_.isUndefined(m.get('oid'))) || (_.isFunction(m.isNew) && !m.isNew()));
-          }
+                !_.isUndefined(m.get('oid'))) || (_.isFunction(m.isNew) && !m.isNew()));
+          },
         },{
           id: 'condeferred', label: gettext('Deferred?'),
           type: 'switch', group: gettext('Definition'),
@@ -745,7 +748,7 @@ define('pgadmin.node.exclusion_constraint', [
           disabled: function(m) {
             if((_.has(m, 'handler') &&
               !_.isUndefined(m.handler) &&
-              !_.isUndefined(m.get('oid'))) || (_.isFunction(m.isNew) && !m.isNew())) {
+                !_.isUndefined(m.get('oid'))) || (_.isFunction(m.isNew) && !m.isNew())) {
               return true;
             }
 
@@ -759,15 +762,15 @@ define('pgadmin.node.exclusion_constraint', [
               },10);
               return true;
             }
-          }
+          },
         },{
           id: 'constraint', label: gettext('Constraint'), cell: 'string',
           type: 'multiline', mode: ['create', 'edit'], editable: false,
           group: gettext('Definition'), disabled: function(m) {
             return ((_.has(m, 'handler') &&
               !_.isUndefined(m.handler) &&
-              !_.isUndefined(m.get('oid'))) || (_.isFunction(m.isNew) && !m.isNew()));
-          }
+                !_.isUndefined(m.get('oid'))) || (_.isFunction(m.isNew) && !m.isNew()));
+          },
         },{
           id: 'columns', label: gettext('Columns'),
           type: 'collection', group: gettext('Columns'),
@@ -776,14 +779,14 @@ define('pgadmin.node.exclusion_constraint', [
             // We can't update columns of existing exclusion constraint.
             return !((_.has(m, 'handler') &&
               !_.isUndefined(m.handler) &&
-              !_.isUndefined(m.get('oid'))) || (_.isFunction(m.isNew) && !m.isNew()));
+                !_.isUndefined(m.get('oid'))) || (_.isFunction(m.isNew) && !m.isNew()));
           },
           control: ExclusionConstraintColumnControl,
           model: ExclusionConstraintColumnModel,
           disabled: function(m) {
             return ((_.has(m, 'handler') &&
               !_.isUndefined(m.handler) &&
-              !_.isUndefined(m.get('oid'))) || (_.isFunction(m.isNew) && !m.isNew()));
+                !_.isUndefined(m.get('oid'))) || (_.isFunction(m.isNew) && !m.isNew()));
           },
           cell: Backgrid.StringCell.extend({
             initialize: function() {
@@ -804,10 +807,10 @@ define('pgadmin.node.exclusion_constraint', [
             },
             removeColumnWithType: function(m){
               var self = this,
-                  cols = self.model.get('columns'),
-                  removedCols = cols.where(
-                    {col_type: m.previous('cltype')}
-                    );
+                cols = self.model.get('columns'),
+                removedCols = cols.where(
+                  {col_type: m.previous('cltype')}
+                );
 
               cols.remove(removedCols);
               setTimeout(function () {
@@ -815,11 +818,11 @@ define('pgadmin.node.exclusion_constraint', [
               }, 10);
 
               setTimeout(function () {
-                var constraints = self.model.top.get("exclude_constraint");
+                var constraints = self.model.top.get('exclude_constraint');
                 var removed = [];
                 constraints.each(function(constraint) {
-                  if (constraint.get("columns").length == 0) {
-                     removed.push(constraint);
+                  if (constraint.get('columns').length == 0) {
+                    removed.push(constraint);
                   }
                 });
                 constraints.remove(removed);
@@ -827,9 +830,9 @@ define('pgadmin.node.exclusion_constraint', [
             },
             removeColumn: function(m){
               var self = this,
-                  removedCols = self.model.get('columns').where(
-                    {column: m.get('name')}
-                    );
+                removedCols = self.model.get('columns').where(
+                  {column: m.get('name')}
+                );
 
               self.model.get('columns').remove(removedCols);
               setTimeout(function () {
@@ -837,49 +840,47 @@ define('pgadmin.node.exclusion_constraint', [
               }, 10);
 
               setTimeout(function () {
-                var constraints = self.model.top.get("exclude_constraint");
+                var constraints = self.model.top.get('exclude_constraint');
                 var removed = [];
                 constraints.each(function(constraint) {
-                  if (constraint.get("columns").length == 0) {
-                     removed.push(constraint);
+                  if (constraint.get('columns').length == 0) {
+                    removed.push(constraint);
                   }
                 });
                 constraints.remove(removed);
               },100);
             },
             resetColOptions : function(m) {
-                var self = this,
-                  updatedCols = self.model.get('columns').where(
-                  {"column": m.previous('name')}
-                  );
+              var self = this,
+                updatedCols = self.model.get('columns').where(
+                  {'column': m.previous('name')}
+                );
 
-                if (updatedCols.length > 0) {
-                  /*
-                   * Table column name has changed so update
-                   * column name in foreign key as well.
-                   */
-                  updatedCols[0].set(
-                  {"column": m.get('name')});
-                }
+              if (updatedCols.length > 0) {
+                /*
+                 * Table column name has changed so update
+                 * column name in foreign key as well.
+                 */
+                updatedCols[0].set(
+                  {'column': m.get('name')});
+              }
 
-                setTimeout(function () {
-                  self.render();
-                }, 10);
+              setTimeout(function () { self.render(); }, 10);
             },
             formatter: {
-              fromRaw: function (rawValue, model) {
-                return rawValue.pluck("column").toString();
+              fromRaw: function (rawValue) {
+                return rawValue.pluck('column').toString();
               },
-              toRaw: function (val, model) {
+              toRaw: function (val) {
                 return val;
-              }
+              },
             },
             render: function() {
               return Backgrid.StringCell.prototype.render.apply(this, arguments);
             },
             remove: function() {
               var tableCols = this.model.top.get('columns'),
-                  cols = this.model.get('columns');
+                cols = this.model.get('columns');
               if (cols) {
                 cols.off('pgadmin:columns:updated');
               }
@@ -889,61 +890,63 @@ define('pgadmin.node.exclusion_constraint', [
               this.stopListening(tableCols, 'change:cltype' , self.removeColumnWithType);
 
               Backgrid.StringCell.prototype.remove.apply(this, arguments);
-            }
+            },
           }),
         }],
         validate: function() {
           this.errorModel.clear();
           var columns = this.get('columns'),
-              name = this.get('name');
+            name = this.get('name'),
+            msg;
 
           if ((_.isUndefined(name) || _.isNull(name) || name.length < 1)) {
-            var msg = gettext('Please specify name for exclusion constraint.');
+            msg = gettext('Please specify name for exclusion constraint.');
             this.errorModel.set('name', msg);
             return msg;
-          }
-          else  if ((_.isUndefined(columns) || _.isNull(columns) || columns.length < 1)) {
-            var msg = gettext('Please specify columns for exclusion constraint.');
+          } else  if (
+            (_.isUndefined(columns) || _.isNull(columns) || columns.length < 1)
+          ) {
+            msg = gettext('Please specify columns for exclusion constraint.');
             this.errorModel.set('columns', msg);
             return msg;
           }
 
           return null;
-        }
+        },
       }),
 
       canCreate: function(itemData, item, data) {
-          // If check is false then , we will allow create menu
-          if (data && data.check == false)
-            return true;
-
-          var t = pgBrowser.tree, i = item, d = itemData, parents = [],
-            immediate_parent_table_found = false,
-            is_immediate_parent_table_partitioned = false;
-          // To iterate over tree to check parent node
-          while (i) {
-            // If table is partitioned table then return false
-            if (!immediate_parent_table_found && (d._type == 'table' || d._type == 'partition')) {
-              immediate_parent_table_found = true;
-              if ('is_partitioned' in d && d.is_partitioned) {
-                is_immediate_parent_table_partitioned = true;
-              }
-            }
+              // If check is false then , we will allow create menu
+        if (data && data.check == false)
+          return true;
 
-            // If it is schema then allow user to create table
-            if (_.indexOf(['schema'], d._type) > -1)
-              return !is_immediate_parent_table_partitioned;
-            parents.push(d._type);
-            i = t.hasParent(i) ? t.parent(i) : null;
-            d = i ? t.itemData(i) : null;
+        var t = pgBrowser.tree, i = item, d = itemData, parents = [],
+          immediate_parent_table_found = false,
+          is_immediate_parent_table_partitioned = false;
+              // To iterate over tree to check parent node
+        while (i) {
+              // If table is partitioned table then return false
+          if (!immediate_parent_table_found && (d._type == 'table' || d._type == 'partition')) {
+            immediate_parent_table_found = true;
+            if ('is_partitioned' in d && d.is_partitioned) {
+              is_immediate_parent_table_partitioned = true;
+            }
           }
-          // If node is under catalog then do not allow 'create' menu
-          if (_.indexOf(parents, 'catalog') > -1) {
-            return false;
-          } else {
+
+              // If it is schema then allow user to create table
+          if (_.indexOf(['schema'], d._type) > -1)
             return !is_immediate_parent_table_partitioned;
-          }
-      }
+          parents.push(d._type);
+          i = t.hasParent(i) ? t.parent(i) : null;
+          d = i ? t.itemData(i) : null;
+        }
+              // If node is under catalog then do not allow 'create' menu
+        if (_.indexOf(parents, 'catalog') > -1) {
+          return false;
+        } else {
+          return !is_immediate_parent_table_partitioned;
+        }
+      },
     });
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js
index eabd8689..4997d175 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js
@@ -1,69 +1,72 @@
 define('pgadmin.node.foreign_key', [
-  'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
-  'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
+  'pgadmin.backform', 'pgadmin.backgrid', 'pgadmin.browser.collection',
+], function(
+  gettext, url_for, $, _, Backbone, pgAdmin, pgBrowser, Alertify, Backform,
+  Backgrid
+) {
 
   var formatNode = function(opt) {
-        if (!opt.id) {
-          return opt.text;
-        }
+      if (!opt.id) {
+        return opt.text;
+      }
 
-        var optimage = $(opt.element).data('image');
+      var optimage = $(opt.element).data('image');
 
-        if(!optimage) {
-          return opt.text;
-        } else {
-          return $(
-            '<span><span class="wcTabIcon ' + optimage + '"/>' + opt.text + '</span>'
-          );
-        }
-      },
-      headerSelectControlTemplate = _.template([
-        '<div class="<%=Backform.controlsClassName%> <%=extraClasses.join(\' \')%>">',
-        '  <select class="pgadmin-node-select form-control" name="<%=name%>" style="width:100%;" value="<%-value%>" <%=disabled ? "disabled" : ""%> <%=required ? "required" : ""%> >',
-        '    <%=select2.first_empty ? " <option></option>" : ""%>',
-        '    <% for (var i=0; i < options.length; i++) { %>',
-        '    <% var option = options[i]; %>',
-        '    <option <% if (option.image) { %> data-image=<%= option.image %> <% } %> value=<%= formatter.fromRaw(option.value) %> <%=option.value === rawValue ? "selected=\'selected\'" : "" %>><%-option.label%></option>',
-        '    <% } %>',
-        '  </select>',
-        '</div>'].join("\n")
+      if(!optimage) {
+        return opt.text;
+      } else {
+        return $(
+        '<span><span class="wcTabIcon ' + optimage + '"/>' + opt.text + '</span>'
       );
+      }
+    },
+    headerSelectControlTemplate = _.template([
+      '<div class="<%=Backform.controlsClassName%> <%=extraClasses.join(\' \')%>">',
+      '  <select class="pgadmin-node-select form-control" name="<%=name%>" style="width:100%;" value="<%-value%>" <%=disabled ? "disabled" : ""%> <%=required ? "required" : ""%> >',
+      '    <%=select2.first_empty ? " <option></option>" : ""%>',
+      '    <% for (var i=0; i < options.length; i++) { %>',
+      '    <% var option = options[i]; %>',
+      '    <option <% if (option.image) { %> data-image=<%= option.image %> <% } %> value=<%= formatter.fromRaw(option.value) %> <%=option.value === rawValue ? "selected=\'selected\'" : "" %>><%-option.label%></option>',
+      '    <% } %>',
+      '  </select>',
+      '</div>'].join('\n')
+    );
 
   var ForeignKeyColumnModel = pgBrowser.Node.Model.extend({
     defaults: {
       local_column: undefined,
       references: undefined,
-      referenced: undefined
+      referenced: undefined,
     },
     schema: [{
-        id: 'local_column', label: gettext('Local'), type:'text', editable: false,
-        cellHeaderClasses: 'width_percent_50', cell:'string',
-        headerCell: Backgrid.Extension.CustomHeaderCell
-      },{
-        id: 'referenced', label: gettext('Referenced'), type: 'text', editable: false,
-        cell:'string', cellHeaderClasses: 'width_percent_50',
-        headerCell: Backgrid.Extension.CustomHeaderCell
-      }]
+      id: 'local_column', label: gettext('Local'), type:'text', editable: false,
+      cellHeaderClasses: 'width_percent_50', cell:'string',
+      headerCell: Backgrid.Extension.CustomHeaderCell,
+    },{
+      id: 'referenced', label: gettext('Referenced'), type: 'text', editable: false,
+      cell:'string', cellHeaderClasses: 'width_percent_50',
+      headerCell: Backgrid.Extension.CustomHeaderCell,
+    }],
   });
 
   var ForeignKeyColumnControl =  Backform.ForeignKeyColumnControl =
     Backform.UniqueColCollectionControl.extend({
 
-    initialize: function(opts) {
-      Backform.UniqueColCollectionControl.prototype.initialize.apply(
-        this, arguments
-          );
+      initialize: function() {
+        Backform.UniqueColCollectionControl.prototype.initialize.apply(
+          this, arguments
+        );
 
-      var self = this,
-        node = 'foreign_key',
-        headerSchema = [{
-          id: 'local_column', label:'', type:'text',
-          node: 'column', control: Backform.NodeListByNameControl.extend({
-            initialize: function() {
-              // Here we will decide if we need to call URL
-              // Or fetch the data from parent columns collection
+        var self = this,
+          node = 'foreign_key',
+          headerSchema = [{
+            id: 'local_column', label:'', type:'text',
+            node: 'column', control: Backform.NodeListByNameControl.extend({
+              initialize: function() {
+                // Here we will decide if we need to call URL
+                // Or fetch the data from parent columns collection
                 if(self.model.handler) {
                   Backform.Select2Control.prototype.initialize.apply(this, arguments);
                   // Do not listen for any event(s) for existing constraint.
@@ -77,525 +80,525 @@ define('pgadmin.node.foreign_key', [
                 } else {
                   Backform.NodeListByNameControl.prototype.initialize.apply(this, arguments);
                 }
-            },
-            removeColumn: function (m) {
-              var that = this;
-              setTimeout(function   () {
-                that.custom_options();
-                that.render.apply(that);
-              }, 50);
-            },
-            resetColOptions: function(m) {
-              var that = this;
+              },
+              removeColumn: function () {
+                var that = this;
+                setTimeout(function   () {
+                  that.custom_options();
+                  that.render.apply(that);
+                }, 50);
+              },
+              resetColOptions: function(m) {
+                var that = this;
 
-              if (m.previous('name') ==  self.headerData.get('local_column')) {
-                /*
-                 * Table column name has changed so update
-                 * column name in foreign key as well.
-                 */
-                self.headerData.set(
-                  {"local_column": m.get('name')});
+                if (m.previous('name') ==  self.headerData.get('local_column')) {
+                  /*
+                   * Table column name has changed so update
+                   * column name in foreign key as well.
+                   */
+                  self.headerData.set(
+                    {'local_column': m.get('name')});
                   self.headerDataChanged();
-              }
+                }
 
-              setTimeout(function () {
-                that.custom_options();
-                that.render.apply(that);
-              }, 50);
-            },
-            custom_options: function() {
-              // We will add all the columns entered by user in table model
-              var columns = self.model.top.get('columns'),
+                setTimeout(function () {
+                  that.custom_options();
+                  that.render.apply(that);
+                }, 50);
+              },
+              custom_options: function() {
+                // We will add all the columns entered by user in table model
+                var columns = self.model.top.get('columns'),
                   added_columns_from_tables = [];
 
-              if (columns.length > 0) {
-                _.each(columns.models, function(m) {
+                if (columns.length > 0) {
+                  _.each(columns.models, function(m) {
                     var col = m.get('name');
                     if(!_.isUndefined(col) && !_.isNull(col)) {
                       added_columns_from_tables.push(
                         {label: col, value: col, image:'icon-column'}
                       );
                     }
-                });
-              }
-              // Set the values in to options so that user can select
-              this.field.set('options', added_columns_from_tables);
-            },
-            template: headerSelectControlTemplate,
-            remove: function () {
-              if(self.model.handler) {
-                var tableCols = self.model.top.get('columns');
-                this.stopListening(tableCols, 'remove' , this.removeColumn);
-                this.stopListening(tableCols, 'change:name' , this.resetColOptions);
+                  });
+                }
+                // Set the values in to options so that user can select
+                this.field.set('options', added_columns_from_tables);
+              },
+              template: headerSelectControlTemplate,
+              remove: function () {
+                if(self.model.handler) {
+                  var tableCols = self.model.top.get('columns');
+                  this.stopListening(tableCols, 'remove' , this.removeColumn);
+                  this.stopListening(tableCols, 'change:name' , this.resetColOptions);
 
-                Backform.Select2Control.prototype.remove.apply(this, arguments);
+                  Backform.Select2Control.prototype.remove.apply(this, arguments);
 
-              } else {
-                Backform.NodeListByNameControl.prototype.remove.apply(this, arguments);
-              }
-            }
-          }),
-          select2: {
-            allowClear: false, width: 'style',
-            placeholder: gettext('Select column'),
-            first_empty: !_.isUndefined(self.model.get('oid'))
-          },
-          version_compatible: self.field.get('version_compatible'),
-          disabled: function(m) {
-            return !_.isUndefined(self.model.get('oid'));
-          }
-        },{
-          id: 'references', label:'', type: 'text', cache_level: 'server',
-          select2: {
-            allowClear: false, width: 'style',
-            placeholder: 'Select foreign table',
-          }, first_empty: true,
-          control: Backform.NodeListByNameControl.extend({
-            formatter: Backform.ControlFormatter,
-            template: headerSelectControlTemplate
+                } else {
+                  Backform.NodeListByNameControl.prototype.remove.apply(this, arguments);
+                }
+              },
             }),
-          url: 'all_tables', node: 'table',
-          version_compatible: self.field.get('version_compatible'),
-          disabled: function(m) {
-            return !_.isUndefined(self.model.get('oid'));
-          },
-          transform: function(rows) {
-            var res = [];
-            _.each(rows, function(r) {
-              res.push({
-                'value': r.value,
-                'image': "icon-table",
-                'label': r.label
+            select2: {
+              allowClear: false, width: 'style',
+              placeholder: gettext('Select column'),
+              first_empty: !_.isUndefined(self.model.get('oid')),
+            },
+            version_compatible: self.field.get('version_compatible'),
+            disabled: function() {
+              return !_.isUndefined(self.model.get('oid'));
+            },
+          },{
+            id: 'references', label:'', type: 'text', cache_level: 'server',
+            select2: {
+              allowClear: false, width: 'style',
+              placeholder: 'Select foreign table',
+            }, first_empty: true,
+            control: Backform.NodeListByNameControl.extend({
+              formatter: Backform.ControlFormatter,
+              template: headerSelectControlTemplate,
+            }),
+            url: 'all_tables', node: 'table',
+            version_compatible: self.field.get('version_compatible'),
+            disabled: function() {
+              return !_.isUndefined(self.model.get('oid'));
+            },
+            transform: function(rows) {
+              var res = [];
+              _.each(rows, function(r) {
+                res.push({
+                  'value': r.value,
+                  'image': 'icon-table',
+                  'label': r.label,
+                });
               });
-            });
-            return res;
-          }
-        },{
-          id: 'referenced', label:'', type: 'text', cache_level: 'server',
-          transform: function(rows) {
-            var res = [];
-            _.each(rows, function(r) {
-              res.push({
-                'value': r.name,
-                'image': 'icon-column',
-                'label': r.name
+              return res;
+            },
+          },{
+            id: 'referenced', label:'', type: 'text', cache_level: 'server',
+            transform: function(rows) {
+              var res = [];
+              _.each(rows, function(r) {
+                res.push({
+                  'value': r.name,
+                  'image': 'icon-column',
+                  'label': r.name,
+                });
               });
-            });
-            return res;
-          },
-          control: Backform.Select2Control.extend({
-            formatter: Backform.ControlFormatter,
-            template: headerSelectControlTemplate,
-            render: function() {
-              var self = this,
-              url = self.field.get('url') || self.defaults.url,
-              m = self.model,
-              tid = m.get('references');
+              return res;
+            },
+            control: Backform.Select2Control.extend({
+              formatter: Backform.ControlFormatter,
+              template: headerSelectControlTemplate,
+              render: function() {
+                var self = this,
+                  url = self.field.get('url') || self.defaults.url,
+                  m = self.model,
+                  tid = m.get('references');
 
-              // Clear any existing value before setting new options.
-              m.set(self.field.get('name'), null, {silent: true});
+                // Clear any existing value before setting new options.
+                m.set(self.field.get('name'), null, {silent: true});
 
-              if (url && !_.isUndefined(tid) && !_.isNull(tid) && tid != '') {
-                var node = this.field.get('schema_node'),
+                if (url && !_.isUndefined(tid) && !_.isNull(tid) && tid != '') {
+                  var node = this.field.get('schema_node'),
                     node_info = this.field.get('node_info'),
                     full_url = node.generate_url.apply(
                       node, [
                         null, url, this.field.get('node_data'),
-                        this.field.get('url_with_id') || false, node_info
+                        this.field.get('url_with_id') || false, node_info,
                       ]),
                     data = [];
 
-                if (this.field.get('version_compatible')) {
-                  m.trigger('pgadmin:view:fetching', m, self.field);
-                  $.ajax({
-                    async: false,
-                    data : {tid:tid},
-                    url: full_url,
-                    success: function(res) {
-                      data = res.data;
-                    },
-                    error: function() {
-                      m.trigger('pgadmin:view:fetch:error', m, self.field);
-                    }
-                  });
-                  m.trigger('pgadmin:view:fetched', m, self.field);
-                }
-                /*
-                 * Transform the data
-                 */
-                var transform = this.field.get('transform') || self.defaults.transform;
-                if (transform && _.isFunction(transform)) {
-                  // We will transform the data later, when rendering.
-                  // It will allow us to generate different data based on the
-                  // dependencies.
-                  self.field.set('options', transform.bind(self, data));
+                  if (this.field.get('version_compatible')) {
+                    m.trigger('pgadmin:view:fetching', m, self.field);
+                    $.ajax({
+                      async: false,
+                      data : {tid:tid},
+                      url: full_url,
+                      success: function(res) {
+                        data = res.data;
+                      },
+                      error: function() {
+                        m.trigger('pgadmin:view:fetch:error', m, self.field);
+                      },
+                    });
+                    m.trigger('pgadmin:view:fetched', m, self.field);
+                  }
+                    /*
+                     * Transform the data
+                     */
+                  var transform = this.field.get('transform') || self.defaults.transform;
+                  if (transform && _.isFunction(transform)) {
+                    // We will transform the data later, when rendering.
+                    // It will allow us to generate different data based on the
+                    // dependencies.
+                    self.field.set('options', transform.bind(self, data));
+                  } else {
+                    self.field.set('options', data);
+                  }
                 } else {
-                  self.field.set('options', data);
+                  self.field.set('options', []);
                 }
-              } else {
-                self.field.set('options', []);
-              }
-              Backform.Select2Control.prototype.render.apply(this, arguments);
-              return this;
-            }
-          }), url: 'get_columns',
-          select2: {
-            allowClear: false,
-            width: "style",
-            placeholder: gettext('Select column'),
-            templateResult: formatNode,
-            templateSelection: formatNode
-          },
-          deps:['references'],  node: 'table',
-          version_compatible: self.field.get('version_compatible'),
-          disabled: function(m) {
-            return !_.isUndefined(self.model.get('oid'));
-          }
-        }],
-        headerDefaults = {local_column: null,
-                          references: null,
-                          referenced:null},
-        gridCols = ['local_column', 'references', 'referenced'];
+                Backform.Select2Control.prototype.render.apply(this, arguments);
+                return this;
+              },
+            }), url: 'get_columns',
+            select2: {
+              allowClear: false,
+              width: 'style',
+              placeholder: gettext('Select column'),
+              templateResult: formatNode,
+              templateSelection: formatNode,
+            },
+            deps:['references'],  node: 'table',
+            version_compatible: self.field.get('version_compatible'),
+            disabled: function() {
+              return !_.isUndefined(self.model.get('oid'));
+            },
+          }],
+          headerDefaults = {local_column: null,
+            references: null,
+            referenced:null},
+          gridCols = ['local_column', 'references', 'referenced'];
 
-      if ((!self.model.isNew() && _.isUndefined(self.model.handler)) ||
+        if ((!self.model.isNew() && _.isUndefined(self.model.handler)) ||
           (_.has(self.model, 'handler') &&
-          !_.isUndefined(self.model.handler) &&
-          !_.isUndefined(self.model.get('oid')))) {
-        var column = self.collection.first();
-        if (column) {
-          headerDefaults["references"] = column.get("references");
+            !_.isUndefined(self.model.handler) &&
+              !_.isUndefined(self.model.get('oid')))) {
+          var column = self.collection.first();
+          if (column) {
+            headerDefaults['references'] = column.get('references');
+          }
         }
-      }
 
-      self.headerData = new (Backbone.Model.extend({
-        defaults: headerDefaults,
-        schema: headerSchema
-      }))({});
+        self.headerData = new (Backbone.Model.extend({
+          defaults: headerDefaults,
+          schema: headerSchema,
+        }))({});
 
-      var headerGroups = Backform.generateViewSchema(
+        var headerGroups = Backform.generateViewSchema(
           self.field.get('node_info'), self.headerData, 'create',
           node, self.field.get('node_data')
-          ),
+        ),
           fields = [];
 
-      _.each(headerGroups, function(o) {
-        fields = fields.concat(o.fields);
-      });
+        _.each(headerGroups, function(o) {
+          fields = fields.concat(o.fields);
+        });
 
-      self.headerFields = new Backform.Fields(fields);
-      self.gridSchema = Backform.generateGridColumnsFromModel(
+        self.headerFields = new Backform.Fields(fields);
+        self.gridSchema = Backform.generateGridColumnsFromModel(
           //null, ForeignKeyColumnModel, 'edit', gridCols
           self.field.get('node_info'), self.field.get('model'), 'edit',
           gridCols, self.field.get('schema_node')
-          );
+        );
 
-      self.controls = [];
-      self.listenTo(self.headerData, "change", self.headerDataChanged);
-      self.listenTo(self.headerData, "select2", self.headerDataChanged);
-      self.listenTo(self.collection, "add", self.onAddorRemoveColumns);
-      self.listenTo(self.collection, "remove", self.onAddorRemoveColumns);
-    },
+        self.controls = [];
+        self.listenTo(self.headerData, 'change', self.headerDataChanged);
+        self.listenTo(self.headerData, 'select2', self.headerDataChanged);
+        self.listenTo(self.collection, 'add', self.onAddorRemoveColumns);
+        self.listenTo(self.collection, 'remove', self.onAddorRemoveColumns);
+      },
+
+      generateHeader: function(data) {
+        var header = [
+          '<div class="subnode-header-form">',
+          ' <div class="container-fluid">',
+          '  <div class="row">',
+          '   <div class="col-md-4">',
+          '    <label class="control-label"><%-column_label%></label>',
+          '   </div>',
+          '   <div class="col-md-6" header="local_column"></div>',
+          '   <div class="col-md-2">',
+          '     <button class="btn-sm btn-default add fa fa-plus" <%=canAdd ? "" : "disabled=\'disabled\'"%> ></button>',
+          '   </div>',
+          '  </div>',
+          '  <div class="row">',
+          '   <div class="col-md-4">',
+          '    <label class="control-label"><%-references_label%></label>',
+          '   </div>',
+          '   <div class="col-md-6" header="references"></div>',
+          '  </div>',
+          '  <div class="row">',
+          '   <div class="col-md-4">',
+          '    <label class="control-label"><%-referenced_label%></label>',
+          '   </div>',
+          '   <div class="col-md-6" header="referenced"></div>',
+          '  </div>',
+          ' </div>',
+          '</div>'].join('\n');
+
+        _.extend(data, {
+          column_label: gettext('Local column'),
+          references_label: gettext('References'),
+          referenced_label: gettext('Referencing'),
+        });
 
-    generateHeader: function(data) {
-      var header = [
-        '<div class="subnode-header-form">',
-        ' <div class="container-fluid">',
-        '  <div class="row">',
-        '   <div class="col-md-4">',
-        '    <label class="control-label"><%-column_label%></label>',
-        '   </div>',
-        '   <div class="col-md-6" header="local_column"></div>',
-        '   <div class="col-md-2">',
-        '     <button class="btn-sm btn-default add fa fa-plus" <%=canAdd ? "" : "disabled=\'disabled\'"%> ></button>',
-        '   </div>',
-        '  </div>',
-        '  <div class="row">',
-        '   <div class="col-md-4">',
-        '    <label class="control-label"><%-references_label%></label>',
-        '   </div>',
-        '   <div class="col-md-6" header="references"></div>',
-        '  </div>',
-        '  <div class="row">',
-        '   <div class="col-md-4">',
-        '    <label class="control-label"><%-referenced_label%></label>',
-        '   </div>',
-        '   <div class="col-md-6" header="referenced"></div>',
-        '  </div>',
-        ' </div>',
-        '</div>',].join("\n")
-
-      _.extend(data, {
-        column_label: gettext('Local column'),
-        references_label: gettext('References'),
-        referenced_label: gettext('Referencing')
-      });
-
-      var self = this,
+        var self = this,
           headerTmpl = _.template(header),
           $header = $(headerTmpl(data)),
           controls = this.controls;
 
-      this.headerFields.each(function(field) {
-        var control = new (field.get("control"))({
-          field: field,
-          model: self.headerData
-        });
+        this.headerFields.each(function(field) {
+          var control = new (field.get('control'))({
+            field: field,
+            model: self.headerData,
+          });
 
-        $header.find('div[header="' + field.get('name') + '"]').append(
-          control.render().$el
-        );
+          $header.find('div[header="' + field.get('name') + '"]').append(
+            control.render().$el
+          );
 
-        controls.push(control);
-      });
+          controls.push(control);
+        });
 
-      // We should not show add but in properties mode
-      if (data.mode == 'properties') {
-        $header.html('');
-      }
+        // We should not show add but in properties mode
+        if (data.mode == 'properties') {
+          $header.html('');
+        }
 
-      self.$header = $header;
+        self.$header = $header;
 
-      return $header;
-    },
+        return $header;
+      },
 
-    events: _.extend(
-                {}, Backform.UniqueColCollectionControl.prototype.events,
-                {'click button.add': 'addColumns'}
-                ),
+      events: _.extend(
+        {}, Backform.UniqueColCollectionControl.prototype.events,
+        {'click button.add': 'addColumns'}
+      ),
 
-    showGridControl: function(data) {
+      showGridControl: function(data) {
 
-      var self = this,
+        var self = this,
           titleTmpl = _.template([
-            "<div class='subnode-header'>",
-            "<label class='control-label'><%-label%></label>",
-            "</div>"].join("\n")),
+            '<div class=\'subnode-header\'>',
+            '<label class=\'control-label\'><%-label%></label>',
+            '</div>'].join('\n')),
           $gridBody =
-            $("<div class='pgadmin-control-group backgrid form-group col-xs-12 object subnode'></div>").append(
-              // Append titleTmpl only if create/edit mode
-              data.mode !== 'properties' ? titleTmpl({label: data.label}) : ''
-            );
-
-      // Clean up existing grid if any (in case of re-render)
-      if (self.grid) {
-        self.grid.remove();
-      }
+          $('<div class=\'pgadmin-control-group backgrid form-group col-xs-12 object subnode\'></div>').append(
+            // Append titleTmpl only if create/edit mode
+            data.mode !== 'properties' ? titleTmpl({label: data.label}) : ''
+          );
 
-      $gridBody.append(self.generateHeader(data));
+        // Clean up existing grid if any (in case of re-render)
+        if (self.grid) {
+          self.grid.remove();
+        }
 
-      var gridSchema = _.clone(this.gridSchema);
+        $gridBody.append(self.generateHeader(data));
 
-      // Insert Delete Cell into Grid
-      if (data.disabled == false && data.canDelete) {
+        var gridSchema = _.clone(this.gridSchema);
+
+        // Insert Delete Cell into Grid
+        if (data.disabled == false && data.canDelete) {
           gridSchema.columns.unshift({
-            name: "pg-backform-delete", label: "",
+            name: 'pg-backform-delete', label: '',
             cell: Backgrid.Extension.DeleteCell,
-            editable: false, cell_priority: -1
+            editable: false, cell_priority: -1,
           });
-      }
+        }
+
+        // Initialize a new Grid instance
+        var grid = self.grid = new Backgrid.Grid({
+          columns: gridSchema.columns,
+          collection: self.collection,
+          className: 'backgrid table-bordered',
+        });
+        self.$grid = grid.render().$el;
+
+        $gridBody.append(self.$grid);
 
-      // Initialize a new Grid instance
-      var grid = self.grid = new Backgrid.Grid({
-        columns: gridSchema.columns,
-        collection: self.collection,
-        className: "backgrid table-bordered"
-      });
-      self.$grid = grid.render().$el;
-
-      $gridBody.append(self.$grid);
-
-      setTimeout(function() {
-        self.headerData.set({
-          'local_column':
-          self.$header.find(
-            'div[header="local_column"] select option:first'
-            ).val(),
+        setTimeout(function() {
+          self.headerData.set({
+            'local_column':
+              self.$header.find(
+                'div[header="local_column"] select option:first'
+              ).val(),
             'referenced':
-          self.$header.find(
-            'div[header="referenced"] select option:first'
-            ).val(),
+              self.$header.find(
+                'div[header="referenced"] select option:first'
+              ).val(),
             'references':
-          self.$header.find(
-            'div[header="references"] select option:first'
-            ).val()
-            }, {silent:true}
+              self.$header.find(
+                'div[header="references"] select option:first'
+              ).val(),
+          }, {silent:true}
           );
-      }, 10);
+        }, 10);
 
-      // Remove unwanted class from grid to display it properly
-      if(data.mode === 'properties')
-        $gridBody.find('.subnode-header-form').removeClass('subnode-header-form');
+        // Remove unwanted class from grid to display it properly
+        if(data.mode === 'properties')
+          $gridBody.find('.subnode-header-form').removeClass('subnode-header-form');
 
-      // Render node grid
-      return $gridBody;
-    },
+        // Render node grid
+        return $gridBody;
+      },
 
-    headerDataChanged: function() {
-      var self = this, val,
+      headerDataChanged: function() {
+        var self = this, val,
           data = this.headerData.toJSON(),
           inSelected = false,
           checkVars = ['local_column', 'referenced'];
 
-      if (!self.$header) {
-        return;
-      }
+        if (!self.$header) {
+          return;
+        }
 
-      if (self.control_data.canAdd) {
-        self.collection.each(function(m) {
-          if (!inSelected) {
-            _.each(checkVars, function(v) {
-              if (!inSelected) {
-                val = m.get(v);
-                inSelected = ((
-                  (_.isUndefined(val) || _.isNull(val)) &&
-                  (_.isUndefined(data[v]) || _.isNull(data[v]))
+        if (self.control_data.canAdd) {
+          self.collection.each(function(m) {
+            if (!inSelected) {
+              _.each(checkVars, function(v) {
+                if (!inSelected) {
+                  val = m.get(v);
+                  inSelected = ((
+                    (_.isUndefined(val) || _.isNull(val)) &&
+                      (_.isUndefined(data[v]) || _.isNull(data[v]))
                   ) ||
-                  (val == data[v]));
-              }
-            });
-          }
-        });
-      }
-      else {
-        inSelected = true;
-      }
+                      (val == data[v]));
+                }
+              });
+            }
+          });
+        }
+        else {
+          inSelected = true;
+        }
 
-      self.$header.find('button.add').prop('disabled', inSelected);
-    },
+        self.$header.find('button.add').prop('disabled', inSelected);
+      },
 
-    addColumns: function(ev) {
-      ev.preventDefault();
-      var self = this,
+      addColumns: function(ev) {
+        ev.preventDefault();
+        var self = this,
           local_column = self.headerData.get('local_column'),
           referenced = self.headerData.get('referenced');
 
-      if (!local_column || local_column == '' ||
+        if (!local_column || local_column == '' ||
           !referenced || referenced  =='') {
-        return false;
-      }
+          return false;
+        }
 
-      var m = new (self.field.get('model'))(
-                self.headerData.toJSON()),
+        var m = new (self.field.get('model'))(
+          self.headerData.toJSON()),
           coll = self.model.get(self.field.get('name'));
 
-      coll.add(m);
+        coll.add(m);
 
-      var idx = coll.indexOf(m);
+        var idx = coll.indexOf(m);
 
-      // idx may not be always > -1 because our UniqueColCollection may
-      // remove 'm' if duplicate value found.
-      if (idx > -1) {
-        self.$grid.find('.new').removeClass('new');
+        // idx may not be always > -1 because our UniqueColCollection may
+        // remove 'm' if duplicate value found.
+        if (idx > -1) {
+          self.$grid.find('.new').removeClass('new');
 
-        var newRow = self.grid.body.rows[idx].$el;
+          var newRow = self.grid.body.rows[idx].$el;
 
-        newRow.addClass("new");
-        $(newRow).pgMakeVisible('backform-tab');
-      } else {
-        //delete m;
-      }
+          newRow.addClass('new');
+          $(newRow).pgMakeVisible('backform-tab');
+        } else {
+          //delete m;
+        }
 
-      return false;
-    },
+        return false;
+      },
 
-    onAddorRemoveColumns: function() {
-      var self = this;
+      onAddorRemoveColumns: function() {
+        var self = this;
 
-      // Wait for collection to be updated before checking for the button to be
-      // enabled, or not.
-      setTimeout(function() {
-        if (self.collection.length > 0) {
-          self.$header.find(
-            'div[header="references"] select'
+        // Wait for collection to be updated before checking for the button to be
+        // enabled, or not.
+        setTimeout(function() {
+          if (self.collection.length > 0) {
+            self.$header.find(
+              'div[header="references"] select'
             ).prop('disabled', true);
-        } else {
-          self.$header.find(
-            'div[header="references"] select'
+          } else {
+            self.$header.find(
+              'div[header="references"] select'
             ).prop('disabled', false);
-        }
+          }
 
-        self.collection.trigger('pgadmin:columns:updated', self.collection);
+          self.collection.trigger('pgadmin:columns:updated', self.collection);
 
-        self.headerDataChanged();
+          self.headerDataChanged();
 
-        if ((!_.has(self.model, 'handler') || (_.has(self.model, 'handler') &&
-              _.isUndefined(self.model.handler))) ||
-            (_.has(self.model, 'handler') && !_.isUndefined(self.model.handler) &&
-            !_.isUndefined(self.model.handler.get('oid')))) {
-          self.getCoveringIndex();
-        }
+          if ((!_.has(self.model, 'handler') || (_.has(self.model, 'handler') &&
+            _.isUndefined(self.model.handler))) ||
+              (_.has(self.model, 'handler') && !_.isUndefined(self.model.handler) &&
+                !_.isUndefined(self.model.handler.get('oid')))) {
+            self.getCoveringIndex();
+          }
 
-      }, 10);
-    },
+        }, 10);
+      },
 
-    getCoveringIndex: function() {
+      getCoveringIndex: function() {
 
-      var self = this,
+        var self = this,
           url = 'get_coveringindex',
           m = self.model,
           cols = [],
           coveringindex = null;
 
-          self.collection.each(function(m){
-            cols.push(m.get('local_column'));
-          })
-
-          if (cols.length > 0) {
-            var node = this.field.get('schema_node'),
-              node_info = this.field.get('node_info'),
-              full_url = node.generate_url.apply(
-                node, [
-                  null, url, this.field.get('node_data'),
-                  this.field.get('url_with_id') || false, node_info
-                ]);
-
-            if (this.field.get('version_compatible')) {
-              m.trigger('pgadmin:view:fetching', m, self.field);
-              $.ajax({
-                async: false,
-                data : {cols:JSON.stringify(cols)},
-                url: full_url,
-                success: function(res) {
-                  coveringindex = res.data;
-                },
-                error: function() {
-                  m.trigger('pgadmin:view:fetch:error', m, self.field);
-                }
-              });
-              m.trigger('pgadmin:view:fetched', m, self.field);
-            }
-          }
+        self.collection.each(function(m){
+          cols.push(m.get('local_column'));
+        });
 
-          if (coveringindex) {
-            m.set('hasindex', true);
-            m.set('autoindex', false);
-            m.set('coveringindex', coveringindex);
-          } else {
-            m.set('coveringindex', null);
-            m.set('autoindex', true);
-            m.set('hasindex', false);
+        if (cols.length > 0) {
+          var node = this.field.get('schema_node'),
+            node_info = this.field.get('node_info'),
+            full_url = node.generate_url.apply(
+              node, [
+                null, url, this.field.get('node_data'),
+                this.field.get('url_with_id') || false, node_info,
+              ]);
+
+          if (this.field.get('version_compatible')) {
+            m.trigger('pgadmin:view:fetching', m, self.field);
+            $.ajax({
+              async: false,
+              data : {cols:JSON.stringify(cols)},
+              url: full_url,
+              success: function(res) {
+                coveringindex = res.data;
+              },
+              error: function() {
+                m.trigger('pgadmin:view:fetch:error', m, self.field);
+              },
+            });
+            m.trigger('pgadmin:view:fetched', m, self.field);
           }
-    },
+        }
 
-    remove: function() {
-      /*
-       * Stop listening the events registered by this control.
-       */
-      this.stopListening(this.headerData, "change", this.headerDataChanged);
-      this.listenTo(this.headerData, "select2", this.headerDataChanged);
-      this.listenTo(this.collection, "remove", this.onRemoveVariable);
-      // Remove header controls.
-      _.each(this.controls, function(controls) {
-        controls.remove();
-      });
+        if (coveringindex) {
+          m.set('hasindex', true);
+          m.set('autoindex', false);
+          m.set('coveringindex', coveringindex);
+        } else {
+          m.set('coveringindex', null);
+          m.set('autoindex', true);
+          m.set('hasindex', false);
+        }
+      },
 
-      ForeignKeyColumnControl.__super__.remove.apply(this, arguments);
+      remove: function() {
+        /*
+         * Stop listening the events registered by this control.
+         */
+        this.stopListening(this.headerData, 'change', this.headerDataChanged);
+        this.listenTo(this.headerData, 'select2', this.headerDataChanged);
+        this.listenTo(this.collection, 'remove', this.onRemoveVariable);
+        // Remove header controls.
+        _.each(this.controls, function(controls) {
+          controls.remove();
+        });
 
-      // Remove the header model
-      delete (this.headerData);
+        ForeignKeyColumnControl.__super__.remove.apply(this, arguments);
 
-    }
-  });
+        // Remove the header model
+        delete (this.headerData);
+
+      },
+    });
 
   // Extend the browser's node class for foreign key node
   if (!pgBrowser.Nodes['foreign_key']) {
@@ -615,7 +618,7 @@ define('pgadmin.node.foreign_key', [
       Init: function() {
         /* Avoid multiple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -624,13 +627,13 @@ define('pgadmin.node.foreign_key', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Foreign key...'),
           icon: 'wcTabIcon icon-foreign_key', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'validate_foreign_key', node: 'foreign_key', module: this,
           applies: ['object', 'context'], callback: 'validate_foreign_key',
           category: 'validate', priority: 4, label: gettext('Validate foreign key'),
-          icon: 'fa fa-link', enable : 'is_not_valid'
-        }
+          icon: 'fa fa-link', enable : 'is_not_valid',
+        },
         ]);
       },
       is_not_valid: function(node) {
@@ -639,10 +642,10 @@ define('pgadmin.node.foreign_key', [
       callbacks: {
         validate_foreign_key: function(args) {
           var input = args || {},
-          obj = this,
-          t = pgBrowser.tree,
-          i = input.item || t.selected(),
-          d = i && i.length == 1 ? t.itemData(i) : undefined;
+            obj = this,
+            t = pgBrowser.tree,
+            i = input.item || t.selected(),
+            d = i && i.length == 1 ? t.itemData(i) : undefined;
 
           if (!d) {
             return false;
@@ -653,7 +656,7 @@ define('pgadmin.node.foreign_key', [
             type:'GET',
             success: function(res) {
               if (res.success == 1) {
-                alertify.success(res.info);
+                Alertify.success(res.info);
                 t.removeIcon(i);
                 data.valid = true;
                 data.icon = 'icon-foreign_key';
@@ -662,19 +665,21 @@ define('pgadmin.node.foreign_key', [
                 setTimeout(function() {t.select(i);}, 100);
               }
             },
-            error: function(xhr, status, error) {
+            error: function(xhr) {
               try {
                 var err = $.parseJSON(xhr.responseText);
                 if (err.success == 0) {
-                  alertify.error(err.errormsg);
+                  Alertify.error(err.errormsg);
                 }
-              } catch (e) {}
+              } catch (e) {
+                console.warn(e.stack || e);
+              }
               t.unload(i);
-            }
-            });
+            },
+          });
 
           return false;
-        }
+        },
       },
       // Define the model for foreign key node
       model: pgAdmin.Browser.Node.Model.extend({
@@ -689,11 +694,11 @@ define('pgadmin.node.foreign_key', [
           confmatchtype: undefined,
           convalidated: undefined,
           columns: undefined,
-          confupdtype: "a",
-          confdeltype: "a",
+          confupdtype: 'a',
+          confdeltype: 'a',
           autoindex: true,
           coveringindex: undefined,
-          hasindex:undefined
+          hasindex:undefined,
         },
         toJSON: function () {
           var d = pgAdmin.Browser.Node.Model.prototype.toJSON.apply(this, arguments);
@@ -704,10 +709,10 @@ define('pgadmin.node.foreign_key', [
         schema: [{
           id: 'name', label: gettext('Name'), type: 'text',
           mode: ['properties', 'create', 'edit'], editable:true,
-          headerCell: Backgrid.Extension.CustomHeaderCell, cellHeaderClasses: 'width_percent_50'
+          headerCell: Backgrid.Extension.CustomHeaderCell, cellHeaderClasses: 'width_percent_50',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text' , mode: ['properties']
+          type: 'text' , mode: ['properties'],
         },{
           id: 'comment', label: gettext('Comment'), cell: 'string',
           type: 'multiline', mode: ['properties', 'create', 'edit'],
@@ -715,27 +720,27 @@ define('pgadmin.node.foreign_key', [
             var name = m.get('name');
             if (!(name && name != '')) {
               setTimeout(function(){
-              if(m.get('comment') && m.get('comment') !== '')
-                 m.set('comment', null);
+                if(m.get('comment') && m.get('comment') !== '')
+                  m.set('comment', null);
               },10);
               return true;
             } else {
               return false;
             }
-          }
+          },
         },{
           id: 'condeferrable', label: gettext('Deferrable?'),
           type: 'switch', group: gettext('Definition'),
           disabled: function(m) {
             // If we are in table edit mode then
             if (_.has(m, 'handler') && !_.isUndefined(m.handler)) {
-                // If OID is undefined then user is trying to add
-                // new constraint which should allowed for Unique
-                return !_.isUndefined(m.get('oid'));
+              // If OID is undefined then user is trying to add
+              // new constraint which should allowed for Unique
+              return !_.isUndefined(m.get('oid'));
             }
             // We can't update condeferrable of existing foreign key.
             return !m.isNew();
-          }
+          },
         },{
           id: 'condeferred', label: gettext('Deferred?'),
           type: 'switch', group: gettext('Definition'),
@@ -743,9 +748,9 @@ define('pgadmin.node.foreign_key', [
           disabled: function(m) {
             // If we are in table edit mode then
             if (_.has(m, 'handler') && !_.isUndefined(m.handler)) {
-                // If OID is undefined then user is trying to add
-                // new constraint which should allowed for Unique
-                return !_.isUndefined(m.get('oid'));
+              // If OID is undefined then user is trying to add
+              // new constraint which should allowed for Unique
+              return !_.isUndefined(m.get('oid'));
             } else if(!m.isNew()) {
               return true;
             }
@@ -759,7 +764,7 @@ define('pgadmin.node.foreign_key', [
               },10);
               return true;
             }
-          }
+          },
         },{
           id: 'confmatchtype', label: gettext('Match type'),
           type: 'switch', group: gettext('Definition'),
@@ -769,77 +774,77 @@ define('pgadmin.node.foreign_key', [
           },disabled: function(m) {
             // If we are in table edit mode then
             if (_.has(m, 'handler') && !_.isUndefined(m.handler)) {
-                // If OID is undefined then user is trying to add
-                // new constraint which should allowed for Unique
-                return !_.isUndefined(m.get('oid'));
+              // If OID is undefined then user is trying to add
+              // new constraint which should allowed for Unique
+              return !_.isUndefined(m.get('oid'));
             }
             // We can't update condeferred of existing foreign key.
             return !m.isNew();
-          }
+          },
         },{
-          id: 'convalidated', label: gettext("Validated?"),
+          id: 'convalidated', label: gettext('Validated?'),
           type: 'switch', group: gettext('Definition'),
           options: {
             onText: gettext('Yes'),
-            offText: gettext('No')
+            offText: gettext('No'),
           },disabled: function(m) {
             // If we are in table edit mode then
             if (_.has(m, 'handler') && !_.isUndefined(m.handler)) {
-                // If OID is undefined then user is trying to add
-                // new constraint which should allowed
-                return !(_.isUndefined(m.get('oid')) || m.get("convalidated"));
+              // If OID is undefined then user is trying to add
+              // new constraint which should allowed
+              return !(_.isUndefined(m.get('oid')) || m.get('convalidated'));
             }
             // We can't update condeferred of existing foreign key.
-            return !(m.isNew() || m.get("convalidated"));
-          }
+            return !(m.isNew() || m.get('convalidated'));
+          },
         },{
           id: 'autoindex', label: gettext('Auto FK index?'),
           type: 'switch', group: gettext('Definition'),
           deps: ['name', 'hasindex'],
           options: {
             onText: gettext('Yes'),
-            offText: gettext('No')
+            offText: gettext('No'),
           },disabled: function(m) {
             var index = m.get('coveringindex'),
-                autoindex = m.get('autoindex'),
-                setIndexName = function() {
-                  var name = m.get('name'),
+              autoindex = m.get('autoindex'),
+              setIndexName = function() {
+                var name = m.get('name'),
                   oldindex = 'fki_'+m.previous ('name');
 
-                  if (m.get('hasindex')) {
-                    return true;
-                  } else if (m.get('autoindex') && !_.isUndefined(name) && !_.isNull(name) &&
-                              name != '' && (_.isUndefined(index) || _.isNull(index) ||
-                              index == '' || index == oldindex)) {
-                    var newIndex = 'fki_' + name;
-                    m.set('coveringindex', newIndex);
-                    return false;
-                  } else {
-                    return false;
-                  }
-                };
-            // If we are in table edit mode then
-            if (_.has(m, 'handler') && !_.isUndefined(m.handler)) {
-                // If OID is undefined then user is trying to add
-                // new constraint which should allowed for Unique
-                if(_.isUndefined(m.get('oid')) && _.isUndefined(m.handler.get('oid'))) {
-                  setTimeout(function () {
-                    if(m.get('autoindex'))
-                      m.set('autoindex', false);
-                  }, 10);
+                if (m.get('hasindex')) {
                   return true;
+                } else if (m.get('autoindex') && !_.isUndefined(name) && !_.isNull(name) &&
+                name != '' && (_.isUndefined(index) || _.isNull(index) ||
+                  index == '' || index == oldindex)) {
+                  var newIndex = 'fki_' + name;
+                  m.set('coveringindex', newIndex);
+                  return false;
                 } else {
-                  return setIndexName();
+                  return false;
                 }
+              };
+            // If we are in table edit mode then
+            if (_.has(m, 'handler') && !_.isUndefined(m.handler)) {
+              // If OID is undefined then user is trying to add
+              // new constraint which should allowed for Unique
+              if(_.isUndefined(m.get('oid')) && _.isUndefined(m.handler.get('oid'))) {
+                setTimeout(function () {
+                  if(m.get('autoindex'))
+                    m.set('autoindex', false);
+                }, 10);
+                return true;
+              } else {
+                return setIndexName();
+              }
             } else {
               if(!m.isNew() && autoindex && !_.isUndefined(index) &&
-                    !_.isNull(index) && index != '' && m.get('hasindex')) {
+                !_.isNull(index) && index != '' && m.get('hasindex')) {
                 return true;
               } else {
                 return setIndexName();
               }
             }
-          }
+          },
         },{
           id: 'coveringindex', label: gettext('Covering index'), type: 'text',
           mode: ['properties', 'create', 'edit'], group: gettext('Definition'),
@@ -859,10 +864,10 @@ define('pgadmin.node.foreign_key', [
                     var name = m.get('name'),
                       newIndex = 'fki_' + name;
 
-                      if (m.get('autoindex') && !_.isUndefined(name) && !_.isNull(name) &&
-                            name != '') {
-                        m.set('coveringindex', newIndex);
-                      }
+                    if (m.get('autoindex') && !_.isUndefined(name) && !_.isNull(name) &&
+                      name != '') {
+                      m.set('coveringindex', newIndex);
+                    }
                   });
 
                   return false;
@@ -871,24 +876,24 @@ define('pgadmin.node.foreign_key', [
 
             // If we are in table edit mode then
             if (_.has(m, 'handler') && !_.isUndefined(m.handler)) {
-                // If OID is undefined then user is trying to add
-                // new constraint which should allowed for Unique
-                if (_.isUndefined(m.get('oid')) && _.isUndefined(m.handler.get('oid'))) {
-                  return true;
-                } else {
-                  return setIndexName();
-                }
+              // If OID is undefined then user is trying to add
+              // new constraint which should allowed for Unique
+              if (_.isUndefined(m.get('oid')) && _.isUndefined(m.handler.get('oid'))) {
+                return true;
+              } else {
+                return setIndexName();
+              }
 
             } else if (!m.isNew() && m.get('autoindex') && !_.isUndefined(index)
-                        && _.isNull(index) && index == '') {
+              && _.isNull(index) && index == '') {
               return true;
             }
 
             return setIndexName();
-          }
+          },
         },{
           id: 'columns', label: gettext('Columns'),
-          type: 'collection', group: gettext('Columns'), disabled: false,
+          type: 'collection', group: gettext('Columns'),
           node: 'foreign_key', editable: false, headerCell: Backgrid.Extension.CustomHeaderCell,
           cellHeaderClasses: 'width_percent_50',
           cell: Backgrid.StringCell.extend({
@@ -906,14 +911,14 @@ define('pgadmin.node.foreign_key', [
               self.model.get('columns').on('pgadmin:columns:updated', function() {
                 self.render.apply(self);
               });
-              self.listenTo(collection, "add", self.render);
-              self.listenTo(collection, "remove", self.render);
+              self.listenTo(collection, 'add', self.render);
+              self.listenTo(collection, 'remove', self.render);
             },
             removeColumn: function(m){
               var self = this,
-                  removedCols = self.model.get('columns').where(
-                    {local_column: m.get('name')}
-                    );
+                removedCols = self.model.get('columns').where(
+                  {local_column: m.get('name')}
+                );
 
               self.model.get('columns').remove(removedCols);
               setTimeout(function () {
@@ -921,50 +926,46 @@ define('pgadmin.node.foreign_key', [
               }, 10);
 
               setTimeout(function () {
-                var constraints = self.model.top.get("foreign_key");
+                var constraints = self.model.top.get('foreign_key');
                 var removed = [];
                 constraints.each(function(constraint) {
-                  if (constraint.get("columns").length == 0) {
-                     removed.push(constraint);
+                  if (constraint.get('columns').length == 0) {
+                    removed.push(constraint);
                   }
                 });
                 constraints.remove(removed);
               },100);
             },
             resetColOptions : function(m) {
-                var self = this,
-                  updatedCols = self.model.get('columns').where(
-                  {"local_column": m.previous('name')}
-                  );
-                if (updatedCols.length > 0) {
-                  /*
-                   * Table column name has changed so update
-                   * column name in foreign key as well.
-                   */
-                  updatedCols[0].set(
-                  {"local_column": m.get('name')});
-                }
+              var self = this,
+                updatedCols = self.model.get('columns').where(
+                  {'local_column': m.previous('name')}
+                );
+              if (updatedCols.length > 0) {
+                /*
+                 * Table column name has changed so update
+                 * column name in foreign key as well.
+                 */
+                updatedCols[0].set(
+                  {'local_column': m.get('name')});
+              }
 
-                setTimeout(function () {
-                  self.render();
-                }, 10);
+              setTimeout(function () { self.render(); }, 10);
             },
             formatter: {
-              fromRaw: function (rawValue, model) {
+              fromRaw: function (rawValue) {
                 var cols = [],
-                    remote_cols = [];
+                  remote_cols = [];
                 if (rawValue.length > 0) {
                   rawValue.each(function(col){
                     cols.push(col.get('local_column'));
-                    remote_cols.push(col.get('referenced'))
+                    remote_cols.push(col.get('referenced'));
                   });
                   return '('+cols.join(', ')+') -> ('+ remote_cols.join(', ')+')';
                 }
-                return "";
+                return '';
               },
-              toRaw: function (val, model) {
-                return val;
-              }
+              toRaw: function (val) { return val; },
             },
             render: function() {
               return Backgrid.StringCell.prototype.render.apply(this, arguments);
@@ -976,121 +977,123 @@ define('pgadmin.node.foreign_key', [
               this.stopListening(tableCols, 'change:name' , self.resetColOptions);
 
               Backgrid.StringCell.prototype.remove.apply(this, arguments);
-            }
+            },
           }),
           canAdd: function(m) {
-            // We can't update columns of existing foreign key.
+              // We can't update columns of existing foreign key.
             return m.isNew();
           }, canDelete: true,
           control: ForeignKeyColumnControl,
           model: ForeignKeyColumnModel,
           disabled: function(m) {
-            // If we are in table edit mode then
+              // If we are in table edit mode then
             if (_.has(m, 'handler') && !_.isUndefined(m.handler)) {
                 // If OID is undefined then user is trying to add
                 // new constraint which should allowed for Unique
-                return !_.isUndefined(m.get('oid'));
+              return !_.isUndefined(m.get('oid'));
             }
-            // We can't update columns of existing foreign key.
+              // We can't update columns of existing foreign key.
             return !m.isNew();
-            }
+          },
         },{
           id: 'confupdtype', label: gettext('On update'),
-          type:"select2", group: gettext('Action'), mode: ['edit','create'],
-          select2:{width:"50%", allowClear: false},
+          type:'select2', group: gettext('Action'), mode: ['edit','create'],
+          select2:{width:'50%', allowClear: false},
           options: [
-            {label: "NO ACTION", value: "a"},
-            {label: "RESTRICT", value: "r"},
-            {label: "CASCADE", value: "c"},
-            {label: "SET NULL", value: "n"},
-            {label: "SET DEFAULT", value: "d"}
+              {label: 'NO ACTION', value: 'a'},
+              {label: 'RESTRICT', value: 'r'},
+              {label: 'CASCADE', value: 'c'},
+              {label: 'SET NULL', value: 'n'},
+              {label: 'SET DEFAULT', value: 'd'},
           ],disabled: function(m) {
-            // If we are in table edit mode then
+              // If we are in table edit mode then
             if (_.has(m, 'handler') && !_.isUndefined(m.handler)) {
                 // If OID is undefined then user is trying to add
                 // new constraint which should allowed for Unique
-                return !_.isUndefined(m.get('oid'));
+              return !_.isUndefined(m.get('oid'));
             }
-            // We can't update confupdtype of existing foreign key.
+              // We can't update confupdtype of existing foreign key.
             return !m.isNew();
-          }
+          },
         },{
           id: 'confdeltype', label: gettext('On delete'),
-          type:"select2", group: gettext('Action'), mode: ['edit','create'],
-          select2:{width:"50%", allowClear: false},
+          type:'select2', group: gettext('Action'), mode: ['edit','create'],
+          select2:{width:'50%', allowClear: false},
           options: [
-            {label: "NO ACTION", value: "a"},
-            {label: "RESTRICT", value: "r"},
-            {label: "CASCADE", value: "c"},
-            {label: "SET NULL", value: "n"},
-            {label: "SET DEFAULT", value: "d"}
+              {label: 'NO ACTION', value: 'a'},
+              {label: 'RESTRICT', value: 'r'},
+              {label: 'CASCADE', value: 'c'},
+              {label: 'SET NULL', value: 'n'},
+              {label: 'SET DEFAULT', value: 'd'},
           ],disabled: function(m) {
-            // If we are in table edit mode then
+              // If we are in table edit mode then
             if (_.has(m, 'handler') && !_.isUndefined(m.handler)) {
                 // If OID is undefined then user is trying to add
                 // new constraint which should allowed for Unique
-                return !_.isUndefined(m.get('oid'));
+              return !_.isUndefined(m.get('oid'));
             }
-            // We can't update confdeltype of existing foreign key.
+              // We can't update confdeltype of existing foreign key.
             return !m.isNew();
-          }
-        }
+          },
+        },
         ],
         validate: function() {
+          var columns = this.get('columns'),
+            msg;
+
           this.errorModel.clear();
 
-          var columns = this.get('columns');
           if ((_.isUndefined(columns) || _.isNull(columns) || columns.length < 1)) {
-            var msg = gettext('Please specify columns for Foreign key.');
+            msg = gettext('Please specify columns for Foreign key.');
             this.errorModel.set('columns', msg);
             return msg;
           }
 
           var coveringindex = this.get('coveringindex'),
-              autoindex = this.get('autoindex');
+            autoindex = this.get('autoindex');
           if (autoindex && (_.isUndefined(coveringindex) || _.isNull(coveringindex) ||
-            String(coveringindex).replace(/^\s+|\s+$/g, '') == '')) {
-            var msg = gettext('Please specify covering index name.');
+              String(coveringindex).replace(/^\s+|\s+$/g, '') == '')) {
+            msg = gettext('Please specify covering index name.');
             this.errorModel.set('coveringindex', msg);
             return msg;
           }
 
           return null;
-        }
+        },
       }),
 
       canCreate: function(itemData, item, data) {
           // If check is false then , we will allow create menu
-          if (data && data.check == false)
-            return true;
+        if (data && data.check == false)
+          return true;
 
-          var t = pgBrowser.tree, i = item, d = itemData, parents = [],
-            immediate_parent_table_found = false,
-            is_immediate_parent_table_partitioned = false;
+        var t = pgBrowser.tree, i = item, d = itemData, parents = [],
+          immediate_parent_table_found = false,
+          is_immediate_parent_table_partitioned = false;
           // To iterate over tree to check parent node
-          while (i) {
+        while (i) {
             // If table is partitioned table then return false
-            if (!immediate_parent_table_found && (d._type == 'table' || d._type == 'partition')) {
-              immediate_parent_table_found = true;
-              if ('is_partitioned' in d && d.is_partitioned) {
-                is_immediate_parent_table_partitioned = true;
-              }
+          if (!immediate_parent_table_found && (d._type == 'table' || d._type == 'partition')) {
+            immediate_parent_table_found = true;
+            if ('is_partitioned' in d && d.is_partitioned) {
+              is_immediate_parent_table_partitioned = true;
             }
+          }
 
             // If it is schema then allow user to c reate table
-            if (_.indexOf(['schema'], d._type) > -1)
-              return !is_immediate_parent_table_partitioned;
-            parents.push(d._type);
-            i = t.hasParent(i) ? t.parent(i) : null;
-            d = i ? t.itemData(i) : null;
-          }
-          // If node is under catalog then do not allow 'create' menu
-          if (_.indexOf(parents, 'catalog') > -1) {
-            return false;
-          } else {
+          if (_.indexOf(['schema'], d._type) > -1)
             return !is_immediate_parent_table_partitioned;
-          }
-      }
+          parents.push(d._type);
+          i = t.hasParent(i) ? t.parent(i) : null;
+          d = i ? t.itemData(i) : null;
+        }
+          // If node is under catalog then do not allow 'create' menu
+        if (_.indexOf(parents, 'catalog') > -1) {
+          return false;
+        } else {
+          return !is_immediate_parent_table_partitioned;
+        }
+      },
     });
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.js
index a212d8ec..d3a6cff4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.js
@@ -1,8 +1,8 @@
 define('pgadmin.node.primary_key', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform', 'pgadmin.backgrid',
+  'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, Backgrid) {
 
   // Extend the browser's node class for index constraint node
   if (!pgBrowser.Nodes['primary_key']) {
@@ -24,7 +24,7 @@ define('pgadmin.node.primary_key', [
       Init: function() {
         /* Avoid multiple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -33,9 +33,9 @@ define('pgadmin.node.primary_key', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Primary key'),
           icon: 'wcTabIcon icon-primary_key', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
 
-        }
+        },
         ]);
       },
       canCreate: function(itemData, item, data) {
@@ -44,8 +44,8 @@ define('pgadmin.node.primary_key', [
           return true;
 
         var t = pgBrowser.tree, i = item, d = itemData, parents = [],
-            immediate_parent_table_found = false,
-            is_immediate_parent_table_partitioned = false;
+          immediate_parent_table_found = false,
+          is_immediate_parent_table_partitioned = false;
 
         // To iterate over tree to check parent node
         while (i) {
@@ -69,7 +69,7 @@ define('pgadmin.node.primary_key', [
 
             _.each(children, function(child){
               data = pgBrowser.tree.itemData($(child));
-              if (!primary_key_found && data._type == "primary_key") {
+              if (!primary_key_found && data._type == 'primary_key') {
                 primary_key_found = true;
               }
             });
@@ -100,7 +100,7 @@ define('pgadmin.node.primary_key', [
           fillfactor: undefined,
           condeferrable: undefined,
           condeferred: undefined,
-          columns: []
+          columns: [],
         },
 
         // Define the schema for the index constraint node
@@ -119,15 +119,15 @@ define('pgadmin.node.primary_key', [
             var name = m.get('name');
             if (!(name && name != '')) {
               setTimeout(function(){
-               if(m.get('comment') && m.get('comment') !== '') {
-                 m.set('comment', null);
-               }
+                if(m.get('comment') && m.get('comment') !== '') {
+                  m.set('comment', null);
+                }
               },10);
               return true;
             } else {
               return false;
             }
-          }
+          },
         },{
           id: 'columns', label: gettext('Columns'),
           type: 'collection', group: gettext('Definition'),
@@ -139,37 +139,37 @@ define('pgadmin.node.primary_key', [
               var self = this,
                 collection = this.model.get('columns');
 
-               // Do not listen for any event(s) for existing constraint.
+              // Do not listen for any event(s) for existing constraint.
               if (_.isUndefined(self.model.get('oid'))) {
                 var tableCols = self.model.top.get('columns');
-                  self.listenTo(tableCols, 'remove' , self.removeColumn);
-                  self.listenTo(tableCols, 'change:name', self.resetColOptions);
+                self.listenTo(tableCols, 'remove' , self.removeColumn);
+                self.listenTo(tableCols, 'change:name', self.resetColOptions);
               }
 
               collection.on('pgadmin:multicolumn:updated', function() {
                 self.render.apply(self);
               });
-              self.listenTo(collection, "add", self.render);
-              self.listenTo(collection, "remove", self.render);
+              self.listenTo(collection, 'add', self.render);
+              self.listenTo(collection, 'remove', self.render);
             },
             removeColumn: function(m) {
               var self = this,
-                  removedCols = self.model.get('columns').where(
-                    {column: m.get('name')}
-                    );
+                removedCols = self.model.get('columns').where(
+                  {column: m.get('name')}
+                );
 
               self.model.get('columns').remove(removedCols);
               setTimeout(function () {
                 self.render();
               }, 10);
 
-              var key = 'primary_key'
+              var key = 'primary_key';
               setTimeout(function () {
-                constraints = self.model.top.get(key);
-                var removed = [];
+                var constraints = self.model.top.get(key),
+                  removed = [];
                 constraints.each(function(constraint) {
-                  if (constraint.get("columns").length == 0) {
-                     removed.push(constraint);
+                  if (constraint.get('columns').length == 0) {
+                    removed.push(constraint);
                   }
                 });
                 constraints.remove(removed);
@@ -179,7 +179,7 @@ define('pgadmin.node.primary_key', [
             resetColOptions : function(m) {
               var self = this,
                 updatedCols = self.model.get('columns').where(
-                {column: m.previous('name')}
+                  {column: m.previous('name')}
                 );
               if (updatedCols.length > 0) {
                 /*
@@ -187,8 +187,8 @@ define('pgadmin.node.primary_key', [
                  * column name in primary key as well.
                  */
                 updatedCols[0].set(
-                {"column": m.get('name')},
-                {silent: true});
+                  {'column': m.get('name')},
+                  {silent: true});
               }
 
               setTimeout(function () {
@@ -196,19 +196,17 @@ define('pgadmin.node.primary_key', [
               }, 10);
             },
             formatter: {
-              fromRaw: function (rawValue, model) {
-                return rawValue.pluck("column").toString();
+              fromRaw: function (rawValue) {
+                return rawValue.pluck('column').toString();
               },
-              toRaw: function (val, model) {
-                return val;
-              }
+              toRaw: function (val) { return val; },
             },
             render: function() {
               return Backgrid.StringCell.prototype.render.apply(this, arguments);
             },
             remove: function() {
               var tableCols = this.model.top.get('columns'),
-              primary_key_col = this.model.get('columns');
+                primary_key_col = this.model.get('columns');
 
               if (primary_key_col) {
                 primary_key_col.off('pgadmin:multicolumn:updated');
@@ -218,7 +216,7 @@ define('pgadmin.node.primary_key', [
               this.stopListening(tableCols, 'change:name' , self.resetColOptions);
 
               Backgrid.StringCell.prototype.remove.apply(this, arguments);
-            }
+            },
           }),
           canDelete: true, canAdd: true,
           control: Backform.MultiSelectAjaxControl.extend({
@@ -231,13 +229,13 @@ define('pgadmin.node.primary_key', [
                   allowClear: true,
                   width: 'style',
                   placeholder: gettext('Select the column(s)'),
-                }
+                },
               }
             ),
             keyPathAccessor: function(obj, path) {
               var res = obj;
               if(_.isArray(res)) {
-                return _.map(res, function(o) { return o['column']
+                return _.map(res, function(o) { return o['column'];
                 });
               }
               path = path.split('.');
@@ -249,8 +247,8 @@ define('pgadmin.node.primary_key', [
               return _.isObject(res) && !_.isArray(res) ? null : res;
             },
             initialize: function() {
-            // Here we will decide if we need to call URL
-            // Or fetch the data from parent columns collection
+              // Here we will decide if we need to call URL
+              // Or fetch the data from parent columns collection
               var self = this;
               if(this.model.handler) {
                 Backform.Select2Control.prototype.initialize.apply(this, arguments);
@@ -266,17 +264,16 @@ define('pgadmin.node.primary_key', [
                 Backform.MultiSelectAjaxControl.prototype.initialize.apply(this, arguments);
               }
               self.model.get('columns').on('pgadmin:multicolumn:updated', function() {
-                  self.render.apply(self);
-                });
+                self.render.apply(self);
+              });
             },
-            resetColOptions: function(m) {
+            resetColOptions: function() {
               var self = this;
 
               setTimeout(function () {
                 self.custom_options();
                 self.render.apply(self);
               }, 50);
-
             },
             custom_options: function() {
               // We will add all the columns entered by user in table model
@@ -285,73 +282,71 @@ define('pgadmin.node.primary_key', [
 
               if (columns.length > 0) {
                 _.each(columns.models, function(m) {
-                    var col = m.get('name');
-                    if(!_.isUndefined(col) && !_.isNull(col)) {
-                      added_columns_from_tables.push(
-                        {label: col, value: col, image:'icon-column'}
-                      );
-                    }
+                  var col = m.get('name');
+                  if(!_.isUndefined(col) && !_.isNull(col)) {
+                    added_columns_from_tables.push(
+                      {label: col, value: col, image:'icon-column'}
+                    );
+                  }
                 });
               }
               // Set the values in to options so that user can select
               this.field.set('options', added_columns_from_tables);
             },
-            onChange: function(e) {
+            onChange: function() {
               var self = this,
-                  model = this.model,
-                  $el = $(e.target),
-                  attrArr = this.field.get("name").split('.'),
-                  name = attrArr.shift(),
-                  path = attrArr.join('.'),
-                  vals = this.getValueFromDOM(),
-                  collection = model.get(name),
-                  removed = [];
+                model = this.model,
+                attrArr = this.field.get('name').split('.'),
+                name = attrArr.shift(),
+                vals = this.getValueFromDOM(),
+                collection = model.get(name),
+                removed = [];
 
-              this.stopListening(this.model, "change:" + name, this.render);
+              this.stopListening(this.model, 'change:' + name, this.render);
 
-              /*
-               * Iterate through all the values, and find out how many are already
-               * present in the collection.
-               */
+                /*
+                 * Iterate through all the values, and find out how many are already
+                 * present in the collection.
+                 */
               collection.each(function(m) {
-                  var column = m.get('column'),
-                      idx = _.indexOf(vals, column);
+                var column = m.get('column'),
+                  idx = _.indexOf(vals, column);
 
-                  if (idx > -1) {
-                    vals.splice(idx, 1);
-                  } else {
-                    removed.push(column);
-                  }
-               });
+                if (idx > -1) {
+                  vals.splice(idx, 1);
+                } else {
+                  removed.push(column);
+                }
+              });
 
-              /*
-               * Adding new values
-               */
+                /*
+                 * Adding new values
+                 */
 
               _.each(vals, function(v) {
                 var m = new (self.field.get('model'))(
-                      {column: v}, { silent: true,
-                      top: self.model.top,
-                      collection: collection,
-                      handler: collection
-                    });
+                  {column: v}, { silent: true,
+                    top: self.model.top,
+                    collection: collection,
+                    handler: collection,
+                  });
 
                 collection.add(m);
               });
 
-              /*
-               * Removing unwanted!
-               */
+                /*
+                 * Removing unwanted!
+                 */
               _.each(removed, function(v) {
                 collection.remove(collection.where({column: v}));
               });
 
-              this.listenTo(this.model, "change:" + name, this.render);
+              this.listenTo(this.model, 'change:' + name, this.render);
             },
             remove: function() {
               if(this.model.handler) {
                 var self = this,
-                tableCols = self.model.top.get('columns');
+                  tableCols = self.model.top.get('columns');
                 self.stopListening(tableCols, 'remove' , self.resetColOptions);
                 self.stopListening(tableCols, 'change:name' , self.resetColOptions);
                 self.model.get('columns').off('pgadmin:multicolumn:updated');
@@ -361,23 +356,23 @@ define('pgadmin.node.primary_key', [
               } else {
                 Backform.MultiSelectAjaxControl.prototype.remove.apply(this, arguments);
               }
-            }
+            },
           }),
           deps: ['index'], node: 'column',
           model: pgBrowser.Node.Model.extend({
             defaults: {
-              column: undefined
+              column: undefined,
             },
             validate: function() {
               return null;
-           }
+            },
           }),
           transform : function(data){
             var res = [];
             if (data && _.isArray(data)) {
               _.each(data, function(d) {
                 res.push({label: d.label, value: d.label, image:'icon-column'});
-              })
+              });
             }
             return res;
           },
@@ -385,27 +380,27 @@ define('pgadmin.node.primary_key', [
           disabled: function(m) {
             // If we are in table edit mode then
             if (_.has(m, 'top') && !_.isUndefined(m.top)
-                                    && !m.top.isNew()) {
+              && !m.top.isNew()) {
                 // If OID is undefined then user is trying to add
                 // new constraint which should be allowed for Unique
-                return !_.isUndefined(m.get('oid'));
+              return !_.isUndefined(m.get('oid'));
             }
 
             // We can't update columns of existing index constraint.
             if (!m.isNew()) {
-                return true;
+              return true;
             }
             // Disable if index is selected.
             var index = m.get('index');
-              if(_.isUndefined(index) || index == '') {
-                return false;
-              } else {
-                var col = m.get('columns');
-                col.reset();
-                return true;
-              }
+            if(_.isUndefined(index) || index == '') {
+              return false;
+            } else {
+              var col = m.get('columns');
+              col.reset();
+              return true;
             }
-          },{
+          },
+        },{
           id: 'spcname', label: gettext('Tablespace'),
           type: 'text', group: gettext('Definition'),
           control: 'node-list-by-name', node: 'tablespace',
@@ -413,40 +408,40 @@ define('pgadmin.node.primary_key', [
           select2:{allowClear:false},
           filter: function(m) {
             // Don't show pg_global tablespace in selection.
-            if (m.label == "pg_global") return false;
+            if (m.label == 'pg_global') return false;
             else return true;
           },
           disabled: function(m) {
             // Disable if index is selected.
             m = m.top || m;
             var index = m.get('index');
-              if(_.isUndefined(index) || index == '') {
-                return false;
-              } else {
-                setTimeout(function(){
-                  m.set('spcname', '');
-                },10);
-                return true;
-              }
-          }
+            if(_.isUndefined(index) || index == '') {
+              return false;
+            } else {
+              setTimeout(function(){
+                m.set('spcname', '');
+              },10);
+              return true;
+            }
+          },
         },{
           id: 'index', label: gettext('Index'),
           type: 'text', group: gettext('Definition'),
           control: Backform.NodeListByNameControl.extend({
-          initialize:function() {
-            if (_.isUndefined(this.model.top)) {
-              Backform.NodeListByNameControl.prototype.initialize.apply(this,arguments);
-            } else {
-              Backform.Control.prototype.initialize.apply(this,arguments);
-            }
-          }
+            initialize:function() {
+              if (_.isUndefined(this.model.top)) {
+                Backform.NodeListByNameControl.prototype.initialize.apply(this,arguments);
+              } else {
+                Backform.Control.prototype.initialize.apply(this,arguments);
+              }
+            },
           }),
           select2:{allowClear:true}, node: 'index',
           disabled: function(m) {
             // If we are in table edit mode then disable it
             if (_.has(m, 'top') && !_.isUndefined(m.top)
-                                    && !m.top.isNew()) {
-                return true;
+              && !m.top.isNew()) {
+              return true;
             }
 
             // We can't update index of existing index constraint.
@@ -455,37 +450,37 @@ define('pgadmin.node.primary_key', [
           // We will not show this field in Create Table mode
           visible: function(m) {
             return !_.isUndefined(m.top.node_info['table']);
-          }
+          },
         },{
           id: 'fillfactor', label: gettext('Fill factor'), deps: ['index'],
           type: 'int', group: gettext('Definition'), allowNull: true,
           disabled: function(m) {
             // Disable if index is selected.
             var index = m.get('index');
-              if(_.isUndefined(index) || index == '') {
-                return false;
-              } else {
-                setTimeout(function(){
-                  m.set('fillfactor', null);
-                },10);
-                return true;
-              }
+            if(_.isUndefined(index) || index == '') {
+              return false;
+            } else {
+              setTimeout(function(){
+                m.set('fillfactor', null);
+              },10);
+              return true;
             }
+          },
         },{
           id: 'condeferrable', label: gettext('Deferrable?'),
           type: 'switch', group: gettext('Definition'), deps: ['index'],
           disabled: function(m) {
             // If we are in table edit mode then
             if (_.has(m, 'top') && !_.isUndefined(m.top)
-                                    && !m.top.isNew()) {
+              && !m.top.isNew()) {
                 // If OID is undefined then user is trying to add
                 // new constraint which should allowed for Unique
-                return !_.isUndefined(m.get('oid'));
+              return !_.isUndefined(m.get('oid'));
             }
 
             // We can't update condeferrable of existing index constraint.
             if (!m.isNew()) {
-                return true;
+              return true;
             }
             // Disable if index is selected.
             var index = m.get('index');
@@ -498,7 +493,7 @@ define('pgadmin.node.primary_key', [
               },10);
               return true;
             }
-          }
+          },
         },{
           id: 'condeferred', label: gettext('Deferred?'),
           type: 'switch', group: gettext('Definition'),
@@ -506,10 +501,10 @@ define('pgadmin.node.primary_key', [
           disabled: function(m) {
             // If we are in table edit mode then
             if (_.has(m, 'top') && !_.isUndefined(m.top)
-                                    && !m.top.isNew()) {
+              && !m.top.isNew()) {
                 // If OID is undefined then user is trying to add
                 // new constraint which should allowed for Unique
-                return !_.isUndefined(m.get('oid'));
+              return !_.isUndefined(m.get('oid'));
             }
 
             // We can't update condeferred of existing index constraint.
@@ -521,13 +516,13 @@ define('pgadmin.node.primary_key', [
               return false;
             } else {
               setTimeout(function(){
-               if(m.get('condeferred'))
+                if(m.get('condeferred'))
                   m.set('condeferred', false);
               },10);
               return true;
             }
-          }
-        }
+          },
+        },
         ],
         validate: function() {
           this.errorModel.clear();
@@ -539,17 +534,17 @@ define('pgadmin.node.primary_key', [
           var columns = this.get('columns'),
             index = this.get('index');
 
-            if ((_.isUndefined(index) || String(index).replace(/^\s+|\s+$/g, '') == '') &&
-                (_.isUndefined(columns) || _.isNull(columns) || columns.length < 1)) {
-              var msg = gettext('Please specify columns for %(node)s', {node: gettext('Primary key')});
-              this.errorModel.set('columns', msg);
-              return msg;
-            }
+          if ((_.isUndefined(index) || String(index).replace(/^\s+|\s+$/g, '') == '') &&
+            (_.isUndefined(columns) || _.isNull(columns) || columns.length < 1)) {
+            var msg = gettext('Please specify columns for %(node)s', {node: gettext('Primary key')});
+            this.errorModel.set('columns', msg);
+            return msg;
+          }
 
           return null;
-        }
-      })
-  });
+        },
+      }),
+    });
   }
 
   return pgBrowser.Nodes['primary_key'];
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.js
index 0413f2df..769185d6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.js
@@ -1,8 +1,8 @@
 define('pgadmin.node.unique_constraint', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
-  'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform', 'pgadmin.backgrid',
+  'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, Backgrid) {
 
   // Extend the browser's node class for index constraint node
   if (!pgBrowser.Nodes['unique_constraint']) {
@@ -24,7 +24,7 @@ define('pgadmin.node.unique_constraint', [
       Init: function() {
         /* Avoid multiple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -33,9 +33,9 @@ define('pgadmin.node.unique_constraint', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Unique constraint'),
           icon: 'wcTabIcon icon-unique_constraint', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
 
-        }
+        },
         ]);
       },
       canCreate: function(itemData, item, data) {
@@ -44,8 +44,8 @@ define('pgadmin.node.unique_constraint', [
           return true;
 
         var t = pgBrowser.tree, i = item, d = itemData, parents = [],
-            immediate_parent_table_found = false,
-            is_immediate_parent_table_partitioned = false;
+          immediate_parent_table_found = false,
+          is_immediate_parent_table_partitioned = false;
 
         // To iterate over tree to check parent node
         while (i) {
@@ -86,7 +86,7 @@ define('pgadmin.node.unique_constraint', [
           fillfactor: undefined,
           condeferrable: undefined,
           condeferred: undefined,
-          columns: []
+          columns: [],
         },
 
         // Define the schema for the index constraint node
@@ -105,15 +105,15 @@ define('pgadmin.node.unique_constraint', [
             var name = m.get('name');
             if (!(name && name != '')) {
               setTimeout(function(){
-               if(m.get('comment') && m.get('comment') !== '') {
-                 m.set('comment', null);
-               }
+                if(m.get('comment') && m.get('comment') !== '') {
+                  m.set('comment', null);
+                }
               },10);
               return true;
             } else {
               return false;
             }
-          }
+          },
         },{
           id: 'columns', label: gettext('Columns'),
           type: 'collection', group: gettext('Definition'),
@@ -125,47 +125,47 @@ define('pgadmin.node.unique_constraint', [
               var self = this,
                 collection = this.model.get('columns');
 
-               // Do not listen for any event(s) for existing constraint.
+              // Do not listen for any event(s) for existing constraint.
               if (_.isUndefined(self.model.get('oid'))) {
                 var tableCols = self.model.top.get('columns');
-                  self.listenTo(tableCols, 'remove' , self.removeColumn);
-                  self.listenTo(tableCols, 'change:name', self.resetColOptions);
+                self.listenTo(tableCols, 'remove' , self.removeColumn);
+                self.listenTo(tableCols, 'change:name', self.resetColOptions);
               }
 
               collection.on('pgadmin:multicolumn:updated', function() {
                 self.render.apply(self);
               });
-              self.listenTo(collection, "add", self.render);
-              self.listenTo(collection, "remove", self.render);
+              self.listenTo(collection, 'add', self.render);
+              self.listenTo(collection, 'remove', self.render);
             },
             removeColumn: function(m) {
               var self = this,
-                  removedCols = self.model.get('columns').where(
-                    {column: m.get('name')}
-                    );
+                removedCols = self.model.get('columns').where(
+                  {column: m.get('name')}
+                );
 
               self.model.get('columns').remove(removedCols);
               setTimeout(function () {
                 self.render();
               }, 10);
 
-              var key = 'unique_constraint'
+              var key = 'unique_constraint';
               setTimeout(function () {
-                constraints = self.model.top.get(key);
-                var removed = [];
+                var constraints = self.model.top.get(key),
+                  removed = [];
+
                 constraints.each(function(constraint) {
-                  if (constraint.get("columns").length == 0) {
-                     removed.push(constraint);
+                  if (constraint.get('columns').length == 0) {
+                    removed.push(constraint);
                   }
                 });
                 constraints.remove(removed);
               },100);
-
             },
             resetColOptions : function(m) {
               var self = this,
                 updatedCols = self.model.get('columns').where(
-                {column: m.previous('name')}
+                  {column: m.previous('name')}
                 );
               if (updatedCols.length > 0) {
                 /*
@@ -173,8 +173,8 @@ define('pgadmin.node.unique_constraint', [
                  * column name in primary key as well.
                  */
                 updatedCols[0].set(
-                {"column": m.get('name')},
-                {silent: true});
+                  {'column': m.get('name')},
+                  {silent: true});
               }
 
               setTimeout(function () {
@@ -182,19 +182,17 @@ define('pgadmin.node.unique_constraint', [
               }, 10);
             },
             formatter: {
-              fromRaw: function (rawValue, model) {
-                return rawValue.pluck("column").toString();
+              fromRaw: function (rawValue) {
+                return rawValue.pluck('column').toString();
               },
-              toRaw: function (val, model) {
-                return val;
-              }
+              toRaw: function (val) { return val; },
             },
             render: function() {
               return Backgrid.StringCell.prototype.render.apply(this, arguments);
             },
             remove: function() {
               var tableCols = this.model.top.get('columns'),
-              primary_key_col = this.model.get('columns');
+                primary_key_col = this.model.get('columns');
 
               if (primary_key_col) {
                 primary_key_col.off('pgadmin:multicolumn:updated');
@@ -204,7 +202,7 @@ define('pgadmin.node.unique_constraint', [
               this.stopListening(tableCols, 'change:name' , self.resetColOptions);
 
               Backgrid.StringCell.prototype.remove.apply(this, arguments);
-            }
+            },
           }),
           canDelete: true, canAdd: true,
           control: Backform.MultiSelectAjaxControl.extend({
@@ -217,13 +215,13 @@ define('pgadmin.node.unique_constraint', [
                   allowClear: true,
                   width: 'style',
                   placeholder: gettext('Select the column(s)'),
-                }
+                },
               }
             ),
             keyPathAccessor: function(obj, path) {
               var res = obj;
               if(_.isArray(res)) {
-                return _.map(res, function(o) { return o['column']
+                return _.map(res, function(o) { return o['column'];
                 });
               }
               path = path.split('.');
@@ -235,8 +233,8 @@ define('pgadmin.node.unique_constraint', [
               return _.isObject(res) && !_.isArray(res) ? null : res;
             },
             initialize: function() {
-            // Here we will decide if we need to call URL
-            // Or fetch the data from parent columns collection
+              // Here we will decide if we need to call URL
+              // Or fetch the data from parent columns collection
               var self = this;
               if(this.model.handler) {
                 Backform.Select2Control.prototype.initialize.apply(this, arguments);
@@ -252,17 +250,16 @@ define('pgadmin.node.unique_constraint', [
                 Backform.MultiSelectAjaxControl.prototype.initialize.apply(this, arguments);
               }
               self.model.get('columns').on('pgadmin:multicolumn:updated', function() {
-                  self.render.apply(self);
-                });
+                self.render.apply(self);
+              });
             },
-            resetColOptions: function(m) {
+            resetColOptions: function() {
               var self = this;
 
               setTimeout(function () {
                 self.custom_options();
                 self.render.apply(self);
               }, 50);
-
             },
             custom_options: function() {
               // We will add all the columns entered by user in table model
@@ -271,73 +268,71 @@ define('pgadmin.node.unique_constraint', [
 
               if (columns.length > 0) {
                 _.each(columns.models, function(m) {
-                    var col = m.get('name');
-                    if(!_.isUndefined(col) && !_.isNull(col)) {
-                      added_columns_from_tables.push(
-                        {label: col, value: col, image:'icon-column'}
-                      );
-                    }
+                  var col = m.get('name');
+                  if(!_.isUndefined(col) && !_.isNull(col)) {
+                    added_columns_from_tables.push(
+                      {label: col, value: col, image:'icon-column'}
+                    );
+                  }
                 });
               }
               // Set the values in to options so that user can select
               this.field.set('options', added_columns_from_tables);
             },
-            onChange: function(e) {
+            onChange: function() {
               var self = this,
-                  model = this.model,
-                  $el = $(e.target),
-                  attrArr = this.field.get("name").split('.'),
-                  name = attrArr.shift(),
-                  path = attrArr.join('.'),
-                  vals = this.getValueFromDOM(),
-                  collection = model.get(name),
-                  removed = [];
+                model = this.model,
+                attrArr = this.field.get('name').split('.'),
+                name = attrArr.shift(),
+                vals = this.getValueFromDOM(),
+                collection = model.get(name),
+                removed = [];
 
-              this.stopListening(this.model, "change:" + name, this.render);
+              this.stopListening(this.model, 'change:' + name, this.render);
 
-              /*
-               * Iterate through all the values, and find out how many are already
-               * present in the collection.
-               */
+                /*
+                 * Iterate through all the values, and find out how many are already
+                 * present in the collection.
+                 */
               collection.each(function(m) {
-                  var column = m.get('column'),
-                      idx = _.indexOf(vals, column);
+                var column = m.get('column'),
+                  idx = _.indexOf(vals, column);
 
-                  if (idx > -1) {
-                    vals.splice(idx, 1);
-                  } else {
-                    removed.push(column);
-                  }
-               });
+                if (idx > -1) {
+                  vals.splice(idx, 1);
+                } else {
+                  removed.push(column);
+                }
+              });
 
-              /*
-               * Adding new values
-               */
+                /*
+                 * Adding new values
+                 */
 
               _.each(vals, function(v) {
                 var m = new (self.field.get('model'))(
-                      {column: v}, { silent: true,
-                      top: self.model.top,
-                      collection: collection,
-                      handler: collection
-                    });
+                  {column: v}, { silent: true,
+                    top: self.model.top,
+                    collection: collection,
+                    handler: collection,
+                  });
 
                 collection.add(m);
               });
 
-              /*
-               * Removing unwanted!
-               */
+                /*
+                 * Removing unwanted!
+                 */
               _.each(removed, function(v) {
                 collection.remove(collection.where({column: v}));
               });
 
-              this.listenTo(this.model, "change:" + name, this.render);
+              this.listenTo(this.model, 'change:' + name, this.render);
             },
             remove: function() {
               if(this.model.handler) {
                 var self = this,
-                tableCols = self.model.top.get('columns');
+                  tableCols = self.model.top.get('columns');
                 self.stopListening(tableCols, 'remove' , self.resetColOptions);
                 self.stopListening(tableCols, 'change:name' , self.resetColOptions);
                 self.model.get('columns').off('pgadmin:multicolumn:updated');
@@ -347,23 +342,23 @@ define('pgadmin.node.unique_constraint', [
               } else {
                 Backform.MultiSelectAjaxControl.prototype.remove.apply(this, arguments);
               }
-            }
+            },
           }),
           deps: ['index'], node: 'column',
           model: pgBrowser.Node.Model.extend({
             defaults: {
-              column: undefined
+              column: undefined,
             },
             validate: function() {
               return null;
-           }
+            },
           }),
           transform : function(data){
             var res = [];
             if (data && _.isArray(data)) {
               _.each(data, function(d) {
                 res.push({label: d.label, value: d.label, image:'icon-column'});
-              })
+              });
             }
             return res;
           },
@@ -371,27 +366,27 @@ define('pgadmin.node.unique_constraint', [
           disabled: function(m) {
             // If we are in table edit mode then
             if (_.has(m, 'top') && !_.isUndefined(m.top)
-                                    && !m.top.isNew()) {
+              && !m.top.isNew()) {
                 // If OID is undefined then user is trying to add
                 // new constraint which should be allowed for Unique
-                return !_.isUndefined(m.get('oid'));
+              return !_.isUndefined(m.get('oid'));
             }
 
             // We can't update columns of existing index constraint.
             if (!m.isNew()) {
-                return true;
+              return true;
             }
             // Disable if index is selected.
             var index = m.get('index');
-              if(_.isUndefined(index) || index == '') {
-                return false;
-              } else {
-                var col = m.get('columns');
-                col.reset();
-                return true;
-              }
+            if(_.isUndefined(index) || index == '') {
+              return false;
+            } else {
+              var col = m.get('columns');
+              col.reset();
+              return true;
             }
-          },{
+          },
+        },{
           id: 'spcname', label: gettext('Tablespace'),
           type: 'text', group: gettext('Definition'),
           control: 'node-list-by-name', node: 'tablespace',
@@ -399,40 +394,40 @@ define('pgadmin.node.unique_constraint', [
           select2:{allowClear:false},
           filter: function(m) {
             // Don't show pg_global tablespace in selection.
-            if (m.label == "pg_global") return false;
+            if (m.label == 'pg_global') return false;
             else return true;
           },
           disabled: function(m) {
             // Disable if index is selected.
             m = m.top || m;
             var index = m.get('index');
-              if(_.isUndefined(index) || index == '') {
-                return false;
-              } else {
-                setTimeout(function(){
-                  m.set('spcname', '');
-                },10);
-                return true;
-              }
-          }
+            if(_.isUndefined(index) || index == '') {
+              return false;
+            } else {
+              setTimeout(function(){
+                m.set('spcname', '');
+              },10);
+              return true;
+            }
+          },
         },{
           id: 'index', label: gettext('Index'),
           type: 'text', group: gettext('Definition'),
           control: Backform.NodeListByNameControl.extend({
-          initialize:function() {
-            if (_.isUndefined(this.model.top)) {
-              Backform.NodeListByNameControl.prototype.initialize.apply(this,arguments);
-            } else {
-              Backform.Control.prototype.initialize.apply(this,arguments);
-            }
-          }
+            initialize:function() {
+              if (_.isUndefined(this.model.top)) {
+                Backform.NodeListByNameControl.prototype.initialize.apply(this,arguments);
+              } else {
+                Backform.Control.prototype.initialize.apply(this,arguments);
+              }
+            },
           }),
           select2:{allowClear:true}, node: 'index',
           disabled: function(m) {
             // If we are in table edit mode then disable it
             if (_.has(m, 'top') && !_.isUndefined(m.top)
-                                    && !m.top.isNew()) {
-                return true;
+              && !m.top.isNew()) {
+              return true;
             }
 
             // We can't update index of existing index constraint.
@@ -441,37 +436,37 @@ define('pgadmin.node.unique_constraint', [
           // We will not show this field in Create Table mode
           visible: function(m) {
             return !_.isUndefined(m.top.node_info['table']);
-          }
+          },
         },{
           id: 'fillfactor', label: gettext('Fill factor'), deps: ['index'],
           type: 'int', group: gettext('Definition'), allowNull: true,
           disabled: function(m) {
             // Disable if index is selected.
             var index = m.get('index');
-              if(_.isUndefined(index) || index == '') {
-                return false;
-              } else {
-                setTimeout(function(){
-                  m.set('fillfactor', null);
-                },10);
-                return true;
-              }
+            if(_.isUndefined(index) || index == '') {
+              return false;
+            } else {
+              setTimeout(function(){
+                m.set('fillfactor', null);
+              },10);
+              return true;
             }
+          },
         },{
           id: 'condeferrable', label: gettext('Deferrable?'),
           type: 'switch', group: gettext('Definition'), deps: ['index'],
           disabled: function(m) {
             // If we are in table edit mode then
             if (_.has(m, 'top') && !_.isUndefined(m.top)
-                                    && !m.top.isNew()) {
+              && !m.top.isNew()) {
                 // If OID is undefined then user is trying to add
                 // new constraint which should allowed for Unique
-                return !_.isUndefined(m.get('oid'));
+              return !_.isUndefined(m.get('oid'));
             }
 
             // We can't update condeferrable of existing index constraint.
             if (!m.isNew()) {
-                return true;
+              return true;
             }
             // Disable if index is selected.
             var index = m.get('index');
@@ -484,7 +479,7 @@ define('pgadmin.node.unique_constraint', [
               },10);
               return true;
             }
-          }
+          },
         },{
           id: 'condeferred', label: gettext('Deferred?'),
           type: 'switch', group: gettext('Definition'),
@@ -492,10 +487,10 @@ define('pgadmin.node.unique_constraint', [
           disabled: function(m) {
             // If we are in table edit mode then
             if (_.has(m, 'top') && !_.isUndefined(m.top)
-                                    && !m.top.isNew()) {
+              && !m.top.isNew()) {
                 // If OID is undefined then user is trying to add
                 // new constraint which should allowed for Unique
-                return !_.isUndefined(m.get('oid'));
+              return !_.isUndefined(m.get('oid'));
             }
 
             // We can't update condeferred of existing index constraint.
@@ -507,13 +502,13 @@ define('pgadmin.node.unique_constraint', [
               return false;
             } else {
               setTimeout(function(){
-               if(m.get('condeferred'))
+                if(m.get('condeferred'))
                   m.set('condeferred', false);
               },10);
               return true;
             }
-          }
-        }
+          },
+        },
         ],
         validate: function() {
           this.errorModel.clear();
@@ -525,17 +520,17 @@ define('pgadmin.node.unique_constraint', [
           var columns = this.get('columns'),
             index = this.get('index');
 
-            if ((_.isUndefined(index) || String(index).replace(/^\s+|\s+$/g, '') == '') &&
-                (_.isUndefined(columns) || _.isNull(columns) || columns.length < 1)) {
-              var msg = gettext('Please specify columns for %(node)s', {node: gettext('Unique constraint')});
-              this.errorModel.set('columns', msg);
-              return msg;
-            }
+          if ((_.isUndefined(index) || String(index).replace(/^\s+|\s+$/g, '') == '') &&
+            (_.isUndefined(columns) || _.isNull(columns) || columns.length < 1)) {
+            var msg = gettext('Please specify columns for %(node)s', {node: gettext('Unique constraint')});
+            this.errorModel.set('columns', msg);
+            return msg;
+          }
 
           return null;
-        }
-      })
-  });
+        },
+      }),
+    });
   }
 
   return pgBrowser.Nodes['unique_constraint'];
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/static/js/constraints.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/static/js/constraints.js
index eaf7e9a6..cb242cd2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/static/js/constraints.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/static/js/constraints.js
@@ -1,20 +1,21 @@
 define('pgadmin.node.constraints', [
-  'sources/gettext', 'jquery', 'underscore', 'underscore.string', 'sources/pgadmin',
-  'pgadmin.browser', 'pgadmin.browser.collection', 'pgadmin.node.unique_constraint',
-  'pgadmin.node.check_constraint', 'pgadmin.node.foreign_key',
-  'pgadmin.node.exclusion_constraint', 'pgadmin.node.primary_key'
-], function(gettext, $, _, S, pgAdmin, pgBrowser) {
+  'sources/gettext', 'jquery', 'underscore', 'sources/pgadmin',
+  'pgadmin.browser', 'pgadmin.browser.collection',
+  'pgadmin.node.unique_constraint', 'pgadmin.node.check_constraint',
+  'pgadmin.node.foreign_key', 'pgadmin.node.exclusion_constraint',
+  'pgadmin.node.primary_key',
+], function(gettext, $, _, pgAdmin, pgBrowser) {
 
   if (!pgBrowser.Nodes['coll-constraints']) {
-    var databases = pgAdmin.Browser.Nodes['coll-constraints'] =
+    pgAdmin.Browser.Nodes['coll-constraints'] =
       pgAdmin.Browser.Collection.extend({
         node: 'constraints',
         label: gettext('Constraints'),
         type: 'coll-constraints',
         getTreeNodeHierarchy: pgBrowser.tableChildTreeNodeHierarchy,
-        columns: ['name', 'comment']
+        columns: ['name', 'comment'],
       });
-  };
+  }
 
   if (!pgBrowser.Nodes['constraints']) {
     pgAdmin.Browser.Nodes['constraints'] = pgBrowser.Node.extend({
@@ -26,7 +27,7 @@ define('pgadmin.node.constraints', [
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -36,20 +37,20 @@ define('pgadmin.node.constraints', [
         defaults: {
           name: undefined,
           oid: undefined,
-          comment: undefined
-       },
+          comment: undefined,
+        },
         schema: [{
           id: 'name', label: gettext('Name'), type: 'text',
-          mode: ['properties', 'create', 'edit']
+          mode: ['properties', 'create', 'edit'],
         },{
           id: 'oid', label: gettext('Oid'), cell: 'string',
-          type: 'text' , mode: ['properties']
+          type: 'text' , mode: ['properties'],
         },{
           id: 'comment', label: gettext('Comment'), cell: 'string',
-          type: 'multiline', mode: ['properties', 'create', 'edit']
-        }]
-      })
-  });
+          type: 'multiline', mode: ['properties', 'create', 'edit'],
+        }],
+      }),
+    });
   }
 
   return pgBrowser.Nodes['constraints'];
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.js
index f0ce19be..ec2b4da1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.js
@@ -1,11 +1,14 @@
 define('pgadmin.node.index', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'backform', 'alertify',
-  'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
+  'backbone', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
+  'pgadmin.backform', 'pgadmin.backgrid', 'pgadmin.browser.collection',
+], function(
+  gettext, url_for, $, _, Backbone, pgAdmin, pgBrowser, Alertify, Backform,
+  Backgrid
+) {
 
   if (!pgBrowser.Nodes['coll-index']) {
-    var databases = pgAdmin.Browser.Nodes['coll-index'] =
+    pgAdmin.Browser.Nodes['coll-index'] =
       pgAdmin.Browser.Collection.extend({
         node: 'index',
         label: gettext('Indexes'),
@@ -16,199 +19,199 @@ define('pgadmin.node.index', [
         dialogHelp: url_for('help.static', {'filename': 'index_dialog.html'}),
         columns: ['name', 'description'],
         hasStatistics: true,
-        statsPrettifyFields: ['Size', 'Index size']
+        statsPrettifyFields: ['Size', 'Index size'],
       });
-  };
+  }
 
   // Node-Ajax-Cell with Deps
   var NodeAjaxOptionsDepsCell = Backgrid.Extension.NodeAjaxOptionsCell.extend({
-      initialize: function() {
-        Backgrid.Extension.NodeAjaxOptionsCell.prototype.initialize.apply(this, arguments);
-        Backgrid.Extension.DependentCell.prototype.initialize.apply(this, arguments);
-      },
-      dependentChanged: function () {
-        var model = this.model,
-          column = this.column,
-          editable = this.column.get("editable"),
-          input = this.$el.find('select').first();
+    initialize: function() {
+      Backgrid.Extension.NodeAjaxOptionsCell.prototype.initialize.apply(this, arguments);
+      Backgrid.Extension.DependentCell.prototype.initialize.apply(this, arguments);
+    },
+    dependentChanged: function () {
+      var model = this.model,
+        column = this.column,
+        editable = this.column.get('editable'),
+        input = this.$el.find('select').first();
 
-        var is_editable = _.isFunction(editable) ? !!editable.apply(column, [model]) : !!editable;
-        if (is_editable) {
-           this.$el.addClass("editable");
-           input.prop('disabled', false);
-         } else {
-           this.$el.removeClass("editable");
-           input.prop('disabled', true);
-         }
+      var is_editable = _.isFunction(editable) ? !!editable.apply(column, [model]) : !!editable;
+      if (is_editable) {
+        this.$el.addClass('editable');
+        input.prop('disabled', false);
+      } else {
+        this.$el.removeClass('editable');
+        input.prop('disabled', true);
+      }
 
-        this.delegateEvents();
-        return this;
-      },
-      remove: Backgrid.Extension.DependentCell.prototype.remove
-    });
+      this.delegateEvents();
+      return this;
+    },
+    remove: Backgrid.Extension.DependentCell.prototype.remove,
+  });
 
 
-    // Model to create column collection control
-    var ColumnModel = pgAdmin.Browser.Node.Model.extend({
-        defaults: {
-          colname: undefined,
-          collspcname: undefined,
-          op_class: undefined,
-          sort_order: false,
-          nulls: false,
-          is_sort_nulls_applicable: true
+  // Model to create column collection control
+  var ColumnModel = pgAdmin.Browser.Node.Model.extend({
+    defaults: {
+      colname: undefined,
+      collspcname: undefined,
+      op_class: undefined,
+      sort_order: false,
+      nulls: false,
+      is_sort_nulls_applicable: true,
+    },
+    schema: [
+      {
+        id: 'colname', label: gettext('Column'), cell: 'node-list-by-name',
+        type: 'text', disabled: 'inSchemaWithModelCheck', editable: function(m) {
+          // Header cell then skip
+          if (m instanceof Backbone.Collection) {
+            return false;
+          }
+          return !(m.inSchemaWithModelCheck.apply(this, arguments));
         },
-        schema: [
-          {
-            id: 'colname', label: gettext('Column'), cell: 'node-list-by-name',
-            type: 'text', disabled: 'inSchemaWithModelCheck', editable: function(m) {
-                // Header cell then skip
-                if (m instanceof Backbone.Collection) {
-                    return false;
-                }
-                return !(m.inSchemaWithModelCheck.apply(this, arguments));
-            },
-            control: 'node-list-by-name', node: 'column'
-          },{
-            id: 'collspcname', label: gettext('Collation'),
-            cell: NodeAjaxOptionsDepsCell,
-            type: 'text', disabled: 'inSchemaWithModelCheck', editable: function(m) {
-                // Header cell then skip
-                if (m instanceof Backbone.Collection) {
-                    return false;
-                }
-                return !(m.inSchemaWithModelCheck.apply(this, arguments));
-            },
-            control: 'node-ajax-options', url: 'get_collations', node: 'index'
-          },{
-            id: 'op_class', label: gettext('Operator class'),
-            cell: NodeAjaxOptionsDepsCell, tags: true,
-            type: 'text', disabled: 'checkAccessMethod',
-            editable: function(m) {
-                // Header cell then skip
-                if (m instanceof Backbone.Collection) {
-                  return false;
-                } else if (m.inSchemaWithModelCheck.apply(this, arguments)) {
-                  return false;
-                }
-                return !(m.checkAccessMethod.apply(this, arguments));
-            },
-            control: 'node-ajax-options', url: 'get_op_class', node: 'index',
-            deps: ['amname'], transform: function(data, control) {
-             /* We need to extract data from collection according
-              * to access method selected by user if not selected
-              * send btree related op_class options
-              */
-             var amname = control.model.top.get('amname'),
-                 options = data['btree'];
+        control: 'node-list-by-name', node: 'column',
+      },{
+        id: 'collspcname', label: gettext('Collation'),
+        cell: NodeAjaxOptionsDepsCell,
+        type: 'text', disabled: 'inSchemaWithModelCheck', editable: function(m) {
+          // Header cell then skip
+          if (m instanceof Backbone.Collection) {
+            return false;
+          }
+          return !(m.inSchemaWithModelCheck.apply(this, arguments));
+        },
+        control: 'node-ajax-options', url: 'get_collations', node: 'index',
+      },{
+        id: 'op_class', label: gettext('Operator class'),
+        cell: NodeAjaxOptionsDepsCell, tags: true,
+        type: 'text', disabled: 'checkAccessMethod',
+        editable: function(m) {
+          // Header cell then skip
+          if (m instanceof Backbone.Collection) {
+            return false;
+          } else if (m.inSchemaWithModelCheck.apply(this, arguments)) {
+            return false;
+          }
+          return !(m.checkAccessMethod.apply(this, arguments));
+        },
+        control: 'node-ajax-options', url: 'get_op_class', node: 'index',
+        deps: ['amname'], transform: function(data, control) {
+          /* We need to extract data from collection according
+           * to access method selected by user if not selected
+           * send btree related op_class options
+           */
+          var amname = control.model.top.get('amname'),
+            options = data['btree'];
 
-             if(_.isUndefined(amname))
-               return options;
+          if(_.isUndefined(amname))
+            return options;
 
-             _.each(data, function(v, k) {
-                if(amname === k) {
-                  options = v;
-                }
-              });
-             return options;
+          _.each(data, function(v, k) {
+            if(amname === k) {
+              options = v;
             }
-          },{
-            id: 'sort_order', label: gettext('Sort order'),
-            cell: Backgrid.Extension.TableChildSwitchCell, type: 'switch',
-            editable: function(m) {
-              // Header cell then skip
-              if (m instanceof Backbone.Collection) {
-                  return false;
-              } else if (m.inSchemaWithModelCheck.apply(this, arguments)) {
-                  return false;
-              } else if (m.top.get('amname') === 'btree') {
-                m.set('is_sort_nulls_applicable', true);
-                return true;
-              } else {
-                m.set('is_sort_nulls_applicable', false);
-                return false;
-              }
-            },
-            deps: ['amname'],
-            options: {
-             'onText': 'DESC', 'offText': 'ASC',
-             'onColor': 'success', 'offColor': 'primary',
-             'size': 'small'
-            }
-          },{
-            id: 'nulls', label: gettext('NULLs'),
-            cell: Backgrid.Extension.TableChildSwitchCell, type: 'switch',
-            editable: function(m) {
-              // Header cell then skip
-              if (m instanceof Backbone.Collection) {
-                  return false;
-              } else if (m.inSchemaWithModelCheck.apply(this, arguments)) {
-                  return false;
-              } else if (m.top.get('amname') === 'btree') {
-                m.set('is_sort_nulls_applicable', true);
-                return true;
-              } else {
-                m.set('is_sort_nulls_applicable', false);
-                return false;
-              }
-            },
-            deps: ['amname', 'sort_order'],
-            options: {
-             'onText': 'FIRST', 'offText': 'LAST',
-             'onColor': 'success', 'offColor': 'primary',
-             'size': 'small'
-            }
-          }
-        ],
-        validate: function() {
-          this.errorModel.clear();
-
-          if (_.isUndefined(this.get('colname'))
-              || String(this.get('colname')).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Column Name cannot be empty.');
-            this.errorModel.set('colname', msg);
-            return msg;
-          }
+          });
+          return options;
         },
-        // We will check if we are under schema node
-        inSchema: function() {
-          if(this.node_info &&  'catalog' in this.node_info) {
+      },{
+        id: 'sort_order', label: gettext('Sort order'),
+        cell: Backgrid.Extension.TableChildSwitchCell, type: 'switch',
+        editable: function(m) {
+          // Header cell then skip
+          if (m instanceof Backbone.Collection) {
+            return false;
+          } else if (m.inSchemaWithModelCheck.apply(this, arguments)) {
+            return false;
+          } else if (m.top.get('amname') === 'btree') {
+            m.set('is_sort_nulls_applicable', true);
             return true;
+          } else {
+            m.set('is_sort_nulls_applicable', false);
+            return false;
           }
-          return false;
         },
-        // We will check if we are under schema node & in 'create' mode
-        inSchemaWithModelCheck: function(m) {
-          if(m.top.node_info &&  'schema' in m.top.node_info) {
-            // We will disable control if it's in 'edit' mode
-            if (m.top.isNew()) {
-              return false;
-            } else {
-              return true;
-            }
-          }
-          return true;
+        deps: ['amname'],
+        options: {
+          'onText': 'DESC', 'offText': 'ASC',
+          'onColor': 'success', 'offColor': 'primary',
+          'size': 'small',
         },
-        // We will check if we are under schema node and added condition
-        checkAccessMethod: function(m) {
-        //Access method is empty or btree then do not disable field
-          var parent_model = m.top;
-          if(_.isUndefined(parent_model.get('amname')) ||
-               _.isNull(parent_model.get('amname')) ||
-               String(parent_model.get('amname')).replace(/^\s+|\s+$/g, '') == '' ||
-               parent_model.get('amname') === 'btree') {
-            // We need to set nulls to true if sort_order is set to desc
-            // nulls first is default for desc
-            if(m.get('sort_order') == true && m.previous('sort_order') ==  false) {
-               setTimeout(function() { m.set('nulls', true) }, 10);
-            }
-          }
-          else {
+      },{
+        id: 'nulls', label: gettext('NULLs'),
+        cell: Backgrid.Extension.TableChildSwitchCell, type: 'switch',
+        editable: function(m) {
+          // Header cell then skip
+          if (m instanceof Backbone.Collection) {
+            return false;
+          } else if (m.inSchemaWithModelCheck.apply(this, arguments)) {
+            return false;
+          } else if (m.top.get('amname') === 'btree') {
+            m.set('is_sort_nulls_applicable', true);
+            return true;
+          } else {
             m.set('is_sort_nulls_applicable', false);
+            return false;
           }
+        },
+        deps: ['amname', 'sort_order'],
+        options: {
+          'onText': 'FIRST', 'offText': 'LAST',
+          'onColor': 'success', 'offColor': 'primary',
+          'size': 'small',
+        },
+      },
+    ],
+    validate: function() {
+      this.errorModel.clear();
+
+      if (_.isUndefined(this.get('colname'))
+        || String(this.get('colname')).replace(/^\s+|\s+$/g, '') == '') {
+        var msg = gettext('Column Name cannot be empty.');
+        this.errorModel.set('colname', msg);
+        return msg;
+      }
+    },
+    // We will check if we are under schema node
+    inSchema: function() {
+      if(this.node_info &&  'catalog' in this.node_info) {
+        return true;
+      }
+      return false;
+    },
+    // We will check if we are under schema node & in 'create' mode
+    inSchemaWithModelCheck: function(m) {
+      if(m.top.node_info &&  'schema' in m.top.node_info) {
+        // We will disable control if it's in 'edit' mode
+        if (m.top.isNew()) {
           return false;
+        } else {
+          return true;
         }
-    });
+      }
+      return true;
+    },
+    // We will check if we are under schema node and added condition
+    checkAccessMethod: function(m) {
+      //Access method is empty or btree then do not disable field
+      var parent_model = m.top;
+      if(_.isUndefined(parent_model.get('amname')) ||
+        _.isNull(parent_model.get('amname')) ||
+          String(parent_model.get('amname')).replace(/^\s+|\s+$/g, '') == '' ||
+          parent_model.get('amname') === 'btree') {
+            // We need to set nulls to true if sort_order is set to desc
+            // nulls first is default for desc
+        if(m.get('sort_order') == true && m.previous('sort_order') ==  false) {
+          setTimeout(function() { m.set('nulls', true); }, 10);
+        }
+      }
+      else {
+        m.set('is_sort_nulls_applicable', false);
+      }
+      return false;
+    },
+  });
 
   if (!pgBrowser.Nodes['index']) {
     pgAdmin.Browser.Nodes['index'] = pgBrowser.Node.extend({
@@ -226,7 +229,7 @@ define('pgadmin.node.index', [
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -235,32 +238,32 @@ define('pgadmin.node.index', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Index...'),
           icon: 'wcTabIcon icon-index', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_index', node: 'index', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Index...'),
           icon: 'wcTabIcon icon-index', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_index_onTable', node: 'table', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Index...'),
           icon: 'wcTabIcon icon-index', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_index_onPartition', node: 'partition', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Index...'),
           icon: 'wcTabIcon icon-index', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_index_onMatView', node: 'mview', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 5, label: gettext('Index...'),
           icon: 'wcTabIcon icon-index', data: {action: 'create', check: true},
-          enable: 'canCreate'
-        }
+          enable: 'canCreate',
+        },
         ]);
       },
       canDrop: pgBrowser.Nodes['schema'].canChildDrop,
@@ -274,14 +277,14 @@ define('pgadmin.node.index', [
           nspname: undefined,
           tabname: undefined,
           spcname: undefined,
-          amname: 'btree'
+          amname: 'btree',
         },
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text', disabled: 'inSchema'
+          type: 'text', disabled: 'inSchema',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'int', disabled: true, mode: ['edit', 'properties']
+          type: 'int', disabled: true, mode: ['edit', 'properties'],
         },{
           id: 'spcname', label: gettext('Tablespace'), cell: 'string',
           control: 'node-list-by-name', node: 'tablespace',
@@ -294,7 +297,7 @@ define('pgadmin.node.index', [
               return false;
             }
             return true;
-          }
+          },
         },{
           id: 'amname', label: gettext('Access Method'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'],
@@ -305,63 +308,63 @@ define('pgadmin.node.index', [
             onChange: function() {
               Backform.NodeAjaxOptionsControl.prototype.onChange.apply(this, arguments);
               var self = this,
-              // current access method
-              current_am = self.model.get('amname'),
-              // previous access method
-              previous_am = self.model.previous('amname');
+                // current access method
+                current_am = self.model.get('amname'),
+                // previous access method
+                previous_am = self.model.previous('amname');
               if (current_am != previous_am && self.model.get('columns').length !== 0) {
                 var msg = gettext('Changing access method will clear columns collection');
-                alertify.confirm(msg, function (e) {
-                    // User clicks Ok, lets clear collection
-                    var column_collection = self.model.get('columns'),
-                      col_length = column_collection.length;
-                    for (var i=(col_length-1);i>=0;i--) {
-                       column_collection.remove(column_collection.models[i]);
-                    }
-                  }, function() {
-                    // User clicks Cancel set previous value again in combo box
-                    setTimeout(function(){
-                      self.model.set('amname', previous_am);
-                    }, 10);
+                Alertify.confirm(msg, function () {
+                  // User clicks Ok, lets clear collection
+                  var column_collection = self.model.get('columns'),
+                    col_length = column_collection.length;
+                  for (var i=(col_length-1);i>=0;i--) {
+                    column_collection.remove(column_collection.models[i]);
+                  }
+                }, function() {
+                  // User clicks Cancel set previous value again in combo box
+                  setTimeout(function(){
+                    self.model.set('amname', previous_am);
+                  }, 10);
                 });
               }
-            }
-          })
+            },
+          }),
         },{
           id: 'cols', label: gettext('Columns'), cell: 'string',
           type: 'text', disabled: 'inSchema', mode: ['properties'],
-          group: gettext('Definition')
+          group: gettext('Definition'),
         },{
           id: 'fillfactor', label: gettext('Fill factor'), cell: 'string',
           type: 'int', disabled: 'inSchema', mode: ['create', 'edit', 'properties'],
-          min: 10, max:100, group: gettext('Definition')
+          min: 10, max:100, group: gettext('Definition'),
         },{
           id: 'indisunique', label: gettext('Unique?'), cell: 'string',
           type: 'switch', disabled: 'inSchemaWithModelCheck',
-          group: gettext('Definition')
+          group: gettext('Definition'),
         },{
           id: 'indisclustered', label: gettext('Clustered?'), cell: 'string',
           type: 'switch', disabled: 'inSchema',
-          group: gettext('Definition')
+          group: gettext('Definition'),
         },{
           id: 'indisvalid', label: gettext('Valid?'), cell: 'string',
           type: 'switch', disabled: true, mode: ['properties'],
-          group: gettext('Definition')
+          group: gettext('Definition'),
         },{
           id: 'indisprimary', label: gettext('Primary?'), cell: 'string',
           type: 'switch', disabled: true, mode: ['properties'],
-          group: gettext('Definition')
+          group: gettext('Definition'),
         },{
           id: 'is_sys_idx', label: gettext('System index?'), cell: 'string',
-          type: 'switch', disabled: true, mode: ['properties']
+          type: 'switch', disabled: true, mode: ['properties'],
         },{
           id: 'isconcurrent', label: gettext('Concurrent build?'), cell: 'string',
           type: 'switch', disabled: 'inSchemaWithModelCheck',
-          mode: ['create', 'edit'], group: gettext('Definition')
+          mode: ['create', 'edit'], group: gettext('Definition'),
         },{
           id: 'indconstraint', label: gettext('Constraint'), cell: 'string',
           type: 'text', disabled: 'inSchemaWithModelCheck', mode: ['create', 'edit'],
-          control: 'sql-field', visible: true, group: gettext('Definition')
+          control: 'sql-field', visible: true, group: gettext('Definition'),
         },{
           id: 'columns', label: gettext('Columns'), type: 'collection', deps: ['amname'],
           group: gettext('Definition'), model: ColumnModel, mode: ['edit', 'create'],
@@ -383,17 +386,15 @@ define('pgadmin.node.index', [
             }
           },
           control: 'unique-col-collection', uniqueCol : ['colname'],
-          columns: ['colname', 'op_class', 'sort_order', 'nulls', 'collspcname']
+          columns: ['colname', 'op_class', 'sort_order', 'nulls', 'collspcname'],
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
           type: 'multiline', mode: ['properties', 'create', 'edit'],
-          disabled: 'inSchema'
-        }
+          disabled: 'inSchema',
+        },
         ],
         validate: function(keys) {
-          var err = {},
-              changedAttrs = this.changed,
-              msg = undefined;
+          var msg;
 
           // Nothing to validate
           if (keys && keys.length == 0) {
@@ -404,19 +405,19 @@ define('pgadmin.node.index', [
           }
 
           if (_.isUndefined(this.get('name'))
-              || String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
+            || String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
             msg = gettext('Name cannot be empty.');
             this.errorModel.set('name', msg);
             return msg;
           }
           if (_.isUndefined(this.get('spcname'))
-              || String(this.get('spcname')).replace(/^\s+|\s+$/g, '') == '') {
+            || String(this.get('spcname')).replace(/^\s+|\s+$/g, '') == '') {
             msg = gettext('Tablespace cannot be empty.');
             this.errorModel.set('spcname', msg);
             return msg;
           }
           if (_.isUndefined(this.get('amname'))
-              || String(this.get('amname')).replace(/^\s+|\s+$/g, '') == '') {
+            || String(this.get('amname')).replace(/^\s+|\s+$/g, '') == '') {
             msg = gettext('Access method cannot be empty.');
             this.errorModel.set('amname', msg);
             return msg;
@@ -424,15 +425,15 @@ define('pgadmin.node.index', [
           // Checks if all columns has names
           var cols = this.get('columns');
           if(cols && cols.length > 0) {
-             if(!_.every(cols.pluck('colname'))) {
-               msg = gettext('You must specify column name.');
-               this.errorModel.set('columns', msg);
-               return msg;
-             }
+            if(!_.every(cols.pluck('colname'))) {
+              msg = gettext('You must specify column name.');
+              this.errorModel.set('columns', msg);
+              return msg;
+            }
           } else if(cols){
-               msg = gettext('You must specify at least one column.');
-               this.errorModel.set('columns', msg);
-               return msg;
+            msg = gettext('You must specify at least one column.');
+            this.errorModel.set('columns', msg);
+            return msg;
           }
           return null;
         },
@@ -469,47 +470,47 @@ define('pgadmin.node.index', [
               } else {
                 return true;
               }
-           }
+            }
           }
           return true;
-        }
+        },
       }),
       // Below function will enable right click menu for creating column
       canCreate: function(itemData, item, data) {
-          // If check is false then , we will allow create menu
-          if (data && data.check == false)
-            return true;
+        // If check is false then , we will allow create menu
+        if (data && data.check == false)
+          return true;
 
-          var t = pgBrowser.tree, i = item, d = itemData, parents = [],
-            immediate_parent_table_found = false,
-            is_immediate_parent_table_partitioned = false;
-          // To iterate over tree to check parent node
-          while (i) {
-            // Do not allow creating index on partitioned tables.
-            if (!immediate_parent_table_found &&
-                _.indexOf(['table', 'partition'], d._type) > -1) {
-              immediate_parent_table_found = true;
-              if ('is_partitioned' in d && d.is_partitioned) {
-                is_immediate_parent_table_partitioned = true;
-              }
+        var t = pgBrowser.tree, i = item, d = itemData, parents = [],
+          immediate_parent_table_found = false,
+          is_immediate_parent_table_partitioned = false;
+        // To iterate over tree to check parent node
+        while (i) {
+          // Do not allow creating index on partitioned tables.
+          if (!immediate_parent_table_found &&
+            _.indexOf(['table', 'partition'], d._type) > -1) {
+            immediate_parent_table_found = true;
+            if ('is_partitioned' in d && d.is_partitioned) {
+              is_immediate_parent_table_partitioned = true;
             }
-
-            // If it is schema then allow user to create index
-            if (_.indexOf(['schema'], d._type) > -1)
-              return !is_immediate_parent_table_partitioned;
-            parents.push(d._type);
-            i = t.hasParent(i) ? t.parent(i) : null;
-            d = i ? t.itemData(i) : null;
           }
-          // If node is under catalog then do not allow 'create' menu
-          if (_.indexOf(parents, 'catalog') > -1) {
-            return false;
-          } else {
+
+          // If it is schema then allow user to create index
+          if (_.indexOf(['schema'], d._type) > -1)
             return !is_immediate_parent_table_partitioned;
-          }
-      }
-  });
- }
+          parents.push(d._type);
+          i = t.hasParent(i) ? t.parent(i) : null;
+          d = i ? t.itemData(i) : null;
+        }
+        // If node is under catalog then do not allow 'create' menu
+        if (_.indexOf(parents, 'catalog') > -1) {
+          return false;
+        } else {
+          return !is_immediate_parent_table_partitioned;
+        }
+      },
+    });
+  }
 
   return pgBrowser.Nodes['index'];
 });
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js
index a1a27b2c..fd53f743 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js
@@ -1,26 +1,28 @@
 define([
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'backform', 'pgadmin.alertifyjs',
-  'pgadmin.browser.collection', 'pgadmin.browser.table.partition.utils'
+  'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
+  'pgadmin.alertifyjs', 'pgadmin.backform', 'pgadmin.backgrid',
+  'pgadmin.browser.collection', 'pgadmin.browser.table.partition.utils',
 ],
-function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
+function(
+  gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify, Backform, Backgrid
+) {
 
   if (!pgBrowser.Nodes['coll-partition']) {
-    var databases = pgAdmin.Browser.Nodes['coll-partition'] =
+    pgAdmin.Browser.Nodes['coll-partition'] =
       pgAdmin.Browser.Collection.extend({
         node: 'partition',
         label: gettext('Partitions'),
         getTreeNodeHierarchy: pgBrowser.tableChildTreeNodeHierarchy,
         type: 'coll-partition',
         columns: [
-          'name', 'schema', 'partition_value', 'is_partitioned', 'description'
-        ]
+          'name', 'schema', 'partition_value', 'is_partitioned', 'description',
+        ],
       });
-  };
+  }
 
   if (!pgBrowser.Nodes['partition']) {
     pgAdmin.Browser.Nodes['partition'] = pgBrowser.Node.extend({
-      getTreeNodeHierarchy: pgBrowser.tableChildTreeNodeHierarchy,
       parent_type: 'table',
       collection_type: 'coll-partition',
       type: 'partition',
@@ -29,8 +31,8 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
       hasDepends: true,
       hasStatistics: true,
       statsPrettifyFields: ['Size', 'Indexes size', 'Table size',
-                            'Toast table size', 'Tuple length',
-                            'Dead tuple length', 'Free space'],
+        'Toast table size', 'Tuple length',
+        'Dead tuple length', 'Free space'],
       sqlAlterHelp: 'sql-altertable.html',
       sqlCreateHelp: 'sql-createtable.html',
       dialogHelp: url_for('help.static', {'filename': 'table_dialog.html'}),
@@ -40,7 +42,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -48,40 +50,40 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
           name: 'truncate_table', node: 'partition', module: this,
           applies: ['object', 'context'], callback: 'truncate_table',
           category: 'Truncate', priority: 3, label: gettext('Truncate'),
-          icon: 'fa fa-eraser', enable : 'canCreate'
+          icon: 'fa fa-eraser', enable : 'canCreate',
         },{
           name: 'truncate_table_cascade', node: 'partition', module: this,
           applies: ['object', 'context'], callback: 'truncate_table_cascade',
           category: 'Truncate', priority: 3, label: gettext('Truncate Cascade'),
-          icon: 'fa fa-eraser', enable : 'canCreate'
+          icon: 'fa fa-eraser', enable : 'canCreate',
         },{
           // To enable/disable all triggers for the table
           name: 'enable_all_triggers', node: 'partition', module: this,
           applies: ['object', 'context'], callback: 'enable_triggers_on_table',
           category: 'Trigger(s)', priority: 4, label: gettext('Enable All'),
-          icon: 'fa fa-check', enable : 'canCreate_with_trigger_enable'
+          icon: 'fa fa-check', enable : 'canCreate_with_trigger_enable',
         },{
           name: 'disable_all_triggers', node: 'partition', module: this,
           applies: ['object', 'context'], callback: 'disable_triggers_on_table',
           category: 'Trigger(s)', priority: 4, label: gettext('Disable All'),
-          icon: 'fa fa-times', enable : 'canCreate_with_trigger_disable'
+          icon: 'fa fa-times', enable : 'canCreate_with_trigger_disable',
         },{
           name: 'reset_table_stats', node: 'partition', module: this,
           applies: ['object', 'context'], callback: 'reset_table_stats',
           category: 'Reset', priority: 4, label: gettext('Reset Statistics'),
-          icon: 'fa fa-bar-chart', enable : 'canCreate'
+          icon: 'fa fa-bar-chart', enable : 'canCreate',
         },{
           name: 'detach_partition', node: 'partition', module: this,
           applies: ['object', 'context'], callback: 'detach_partition',
           priority: 2, label: gettext('Detach Partition'),
-          icon: 'fa fa-remove'
-        }
+          icon: 'fa fa-remove',
+        },
         ]);
       },
       getTreeNodeHierarchy: function(i) {
         var idx = 0,
-            res = {},
-            t = pgBrowser.tree;
+          res = {},
+          t = pgBrowser.tree;
 
         do {
           var d = t.itemData(i);
@@ -110,9 +112,9 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
       },
       generate_url: function(item, type, d, with_id, info) {
         if (_.indexOf([
-            'stats', 'statistics', 'dependency', 'dependent', 'reset',
-            'get_relations', 'get_oftype', 'get_attach_tables'
-            ], type) == -1) {
+          'stats', 'statistics', 'dependency', 'dependent', 'reset',
+          'get_relations', 'get_oftype', 'get_attach_tables',
+        ], type) == -1) {
           return pgBrowser.Node.generate_url.apply(this, arguments);
         }
 
@@ -136,22 +138,22 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
       callbacks: {
         /* Enable trigger(s) on table */
         enable_triggers_on_table: function(args) {
-            var params = {'enable': true };
-            this.callbacks.set_triggers.apply(this, [args, params]);
+          var params = {'enable': true };
+          this.callbacks.set_triggers.apply(this, [args, params]);
         },
         /* Disable trigger(s) on table */
         disable_triggers_on_table: function(args) {
-            var params = {'enable': false };
-            this.callbacks.set_triggers.apply(this, [args, params]);
+          var params = {'enable': false };
+          this.callbacks.set_triggers.apply(this, [args, params]);
         },
         set_triggers: function(args, params) {
           // This function will send request to enable or
           // disable triggers on table level
           var input = args || {},
-              obj = this,
-              t = pgBrowser.tree,
-              i = input.item || t.selected(),
-              d = i && i.length == 1 ? t.itemData(i) : undefined;
+            obj = this,
+            t = pgBrowser.tree,
+            i = input.item || t.selected(),
+            d = i && i.length == 1 ? t.itemData(i) : undefined;
 
           if (!d)
             return false;
@@ -160,10 +162,10 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
             url: obj.generate_url(i, 'set_trigger' , d, true),
             type:'PUT',
             data: params,
-            dataType: "json",
+            dataType: 'json',
             success: function(res) {
               if (res.success == 1) {
-                alertify.success(res.info);
+                Alertify.success(res.info);
                 t.unload(i);
                 t.setInode(i);
                 t.deselect(i);
@@ -172,74 +174,78 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
                 }, 10);
               }
             },
-            error: function(xhr, status, error) {
+            error: function(xhr) {
               try {
                 var err = $.parseJSON(xhr.responseText);
                 if (err.success == 0) {
-                  alertify.error(err.errormsg);
+                  Alertify.error(err.errormsg);
                 }
-              } catch (e) {}
+              } catch (e) {
+                console.warn(e.stack || e);
+              }
               t.unload(i);
-            }
+            },
           });
         },
         /* Truncate table */
         truncate_table: function(args) {
-            var params = {'cascade': false };
-            this.callbacks.truncate.apply(this, [args, params]);
+          var params = {'cascade': false };
+          this.callbacks.truncate.apply(this, [args, params]);
         },
         /* Truncate table with cascade */
         truncate_table_cascade: function(args) {
-            var params = {'cascade': true };
-            this.callbacks.truncate.apply(this, [args, params]);
+          var params = {'cascade': true };
+          this.callbacks.truncate.apply(this, [args, params]);
         },
         truncate: function(args, params) {
           var input = args || {},
-              obj = this,
-              t = pgBrowser.tree,
-              i = input.item || t.selected(),
-              d = i && i.length == 1 ? t.itemData(i) : undefined;
+            obj = this,
+            t = pgBrowser.tree,
+            i = input.item || t.selected(),
+            d = i && i.length == 1 ? t.itemData(i) : undefined;
 
           if (!d)
             return false;
 
-          alertify.confirm(
+          Alertify.confirm(
             gettext('Truncate Table'),
             S(gettext('Are you sure you want to truncate table %s?')).sprintf(d.label).value(),
             function (e) {
-            if (e) {
-              var data = d;
-              $.ajax({
-                url: obj.generate_url(i, 'truncate' , d, true),
-                type:'PUT',
-                data: params,
-                dataType: "json",
-                success: function(res) {
-                  if (res.success == 1) {
-                    alertify.success(res.info);
-                    t.removeIcon(i);
-                    data.icon = 'icon-partition';
-                    t.addIcon(i, {icon: data.icon});
-                    t.unload(i);
-                    t.setInode(i);
-                    t.deselect(i);
+              if (e) {
+                var data = d;
+                $.ajax({
+                  url: obj.generate_url(i, 'truncate' , d, true),
+                  type:'PUT',
+                  data: params,
+                  dataType: 'json',
+                  success: function(res) {
+                    if (res.success == 1) {
+                      Alertify.success(res.info);
+                      t.removeIcon(i);
+                      data.icon = 'icon-partition';
+                      t.addIcon(i, {icon: data.icon});
+                      t.unload(i);
+                      t.setInode(i);
+                      t.deselect(i);
                     // Fetch updated data from server
-                    setTimeout(function() {
-                      t.select(i);
-                    }, 10);
-                  }
-                },
-                error: function(xhr, status, error) {
-                  try {
-                    var err = $.parseJSON(xhr.responseText);
-                    if (err.success == 0) {
-                      alertify.error(err.errormsg);
+                      setTimeout(function() {
+                        t.select(i);
+                      }, 10);
                     }
-                  } catch (e) {}
-                  t.unload(i);
-                }
-              });
-            }},
+                  },
+                  error: function(xhr) {
+                    try {
+                      var err = $.parseJSON(xhr.responseText);
+                      if (err.success == 0) {
+                        Alertify.error(err.errormsg);
+                      }
+                    } catch (e) {
+                      console.warn(e.stack || e);
+                    }
+                    t.unload(i);
+                  },
+                });
+              }},
             function() {}
           );
         },
@@ -253,7 +259,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
           if (!d)
             return false;
 
-          alertify.confirm(
+          Alertify.confirm(
             gettext('Reset statistics'),
             S(gettext('Are you sure you want to reset the statistics for table "%s"?')).sprintf(d._label).value(),
             function (e) {
@@ -264,7 +270,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
                   type:'DELETE',
                   success: function(res) {
                     if (res.success == 1) {
-                      alertify.success(res.info);
+                      Alertify.success(res.info);
                       t.removeIcon(i);
                       data.icon = 'icon-partition';
                       t.addIcon(i, {icon: data.icon});
@@ -277,15 +283,17 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
                       }, 10);
                     }
                   },
-                  error: function(xhr, status, error) {
+                  error: function(xhr) {
                     try {
                       var err = $.parseJSON(xhr.responseText);
                       if (err.success == 0) {
-                        alertify.error(err.errormsg);
+                        Alertify.error(err.errormsg);
                       }
-                    } catch (e) {}
+                    } catch (e) {
+                      console.warn(e.stack || e);
+                    }
                     t.unload(i);
-                  }
+                  },
                 });
               }
             },
@@ -302,18 +310,17 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
           if (!d)
             return false;
 
-          alertify.confirm(
+          Alertify.confirm(
             gettext('Detach Partition'),
             S(gettext('Are you sure you want to detach the partition %s?')).sprintf(d._label).value(),
             function (e) {
               if (e) {
-                var data = d;
                 $.ajax({
                   url: obj.generate_url(i, 'detach' , d, true),
                   type:'PUT',
                   success: function(res) {
                     if (res.success == 1) {
-                      alertify.success(res.info);
+                      Alertify.success(res.info);
                       var n = t.next(i);
                       if (!n || !n.length) {
                         n = t.prev(i);
@@ -328,20 +335,22 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
                       }
                     }
                   },
-                  error: function(xhr, status, error) {
+                  error: function(xhr) {
                     try {
                       var err = $.parseJSON(xhr.responseText);
                       if (err.success == 0) {
-                        alertify.error(err.errormsg);
+                        Alertify.error(err.errormsg);
                       }
-                    } catch (e) {}
-                  }
+                    } catch (e) {
+                      console.warn(e.stack || e);
+                    }
+                  },
                 });
               }
             },
             function() {}
           );
-       }
+        },
       },
       model: pgBrowser.Node.Model.extend({
         defaults: {
@@ -374,18 +383,18 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
           partitions: [],
           partition_type: 'range',
           is_partitioned: false,
-          partition_value: undefined
+          partition_value: undefined,
         },
         // Default values!
         initialize: function(attrs, args) {
-          var self = this;
-
           if (_.size(attrs) === 0) {
-            var userInfo = pgBrowser.serverInfo[args.node_info.server._id].user,
-                schemaInfo = args.node_info.schema;
+            var userInfo = pgBrowser.serverInfo[
+              args.node_info.server._id
+            ].user,
+              schemaInfo = args.node_info.schema;
 
             this.set({
-              'relowner': userInfo.name, 'schema': schemaInfo._label
+              'relowner': userInfo.name, 'schema': schemaInfo._label,
             }, {silent: true});
           }
           pgBrowser.Node.Model.prototype.initialize.apply(this, arguments);
@@ -393,13 +402,13 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
         },
         schema: [{
           id: 'name', label: gettext('Name'), type: 'text',
-          mode: ['properties', 'create', 'edit'], disabled: 'inSchema'
+          mode: ['properties', 'create', 'edit'], disabled: 'inSchema',
         },{
-          id: 'oid', label: gettext('OID'), type: 'text', mode: ['properties']
+          id: 'oid', label: gettext('OID'), type: 'text', mode: ['properties'],
         },{
           id: 'relowner', label: gettext('Owner'), type: 'text', node: 'role',
           mode: ['properties', 'create', 'edit'], select2: {allowClear: false},
-          disabled: 'inSchema', control: 'node-list-by-name'
+          disabled: 'inSchema', control: 'node-list-by-name',
         },{
           id: 'schema', label: gettext('Schema'), type: 'text', node: 'schema',
           control: 'node-list-by-name', mode: ['create', 'edit', 'properties'],
@@ -410,15 +419,15 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
               return false;
             }
             return true;
-          }, cache_node: 'database', cache_level: 'database'
+          }, cache_node: 'database', cache_level: 'database',
         },{
           id: 'spcname', label: gettext('Tablespace'), node: 'tablespace',
           type: 'text', control: 'node-list-by-name', disabled: 'inSchema',
           mode: ['properties', 'create', 'edit'],
           filter: function(d) {
             // If tablespace name is not "pg_global" then we need to exclude them
-            return (!(d && d.label.match(/pg_global/)))
-          }
+            return (!(d && d.label.match(/pg_global/)));
+          },
         },{
           id: 'partition', type: 'group', label: gettext('Partition'),
           mode: ['edit', 'create'], min_version: 100000,
@@ -427,7 +436,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
             if (m.isNew() || m.get('is_partitioned'))
               return true;
             return false;
-          }
+          },
         },{
           id: 'is_partitioned', label:gettext('Partitioned Table?'), cell: 'switch',
           type: 'switch', mode: ['properties', 'create', 'edit'],
@@ -443,24 +452,22 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
             if (!m.isNew())
               return true;
             return false;
-          }
+          },
         },{
           id: 'description', label: gettext('Comment'), type: 'multiline',
-          mode: ['properties', 'create', 'edit'], disabled: 'inSchema'
+          mode: ['properties', 'create', 'edit'], disabled: 'inSchema',
         },
         {
           id: 'partition_value', label:gettext('Partition Scheme'),
-          type: 'text', visible: false
+          type: 'text', visible: false,
         },{
           id: 'coll_inherits', label: gettext('Inherited from table(s)'),
-          type: 'text', group: gettext('Advanced'), mode: ['properties']
+          type: 'text', group: gettext('Advanced'), mode: ['properties'],
         },{
           id: 'Columns', type: 'group', label: gettext('Columns'),
           mode: ['edit', 'create'], min_version: 100000,
-          visible: function(m) {
-            // Always hide in case of partition table.
-            return false;
-          }
+          // Always hide in case of partition table.
+          visible: function() { return false; },
         },{
           // Tab control for columns
           id: 'columns', label: gettext('Columns'), type: 'collection',
@@ -499,12 +506,12 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
             initialize: function() {
               Backform.UniqueColCollectionControl.prototype.initialize.apply(this, arguments);
               var self = this,
-                  collection = self.model.get(self.field.get('name'));
+                collection = self.model.get(self.field.get('name'));
 
-              collection.on("change:is_primary_key", function(m) {
+              collection.on('change:is_primary_key', function(m) {
                 var primary_key_coll = self.model.get('primary_key'),
-                    column_name = m.get('name'),
-                    primary_key;
+                  column_name = m.get('name'),
+                  primary_key, primary_key_column_coll;
 
                 if(m.get('is_primary_key')) {
                 // Add column to primary key.
@@ -512,7 +519,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
                     primary_key = new (primary_key_coll.model)({}, {
                       top: self.model,
                       collection: primary_key_coll,
-                      handler: primary_key_coll
+                      handler: primary_key_coll,
                     });
                     primary_key_coll.add(primary_key);
                   } else {
@@ -520,39 +527,43 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
                   }
                   // Do not alter existing primary key columns.
                   if (_.isUndefined(primary_key.get('oid'))) {
-                    var primary_key_column_coll = primary_key.get('columns'),
-                      primary_key_column_exist = primary_key_column_coll.where({column:column_name});
+                    primary_key_column_coll = primary_key.get('columns');
+                    var  primary_key_column_exist = primary_key_column_coll.where({column:column_name});
 
                     if (primary_key_column_exist.length == 0) {
                       var primary_key_column = new (primary_key_column_coll.model)(
                           {column: column_name}, { silent: true,
-                          top: self.model,
-                          collection: primary_key_coll,
-                          handler: primary_key_coll
-                        });
+                            top: self.model,
+                            collection: primary_key_coll,
+                            handler: primary_key_coll,
+                          });
 
                       primary_key_column_coll.add(primary_key_column);
                     }
 
-                    primary_key_column_coll.trigger('pgadmin:multicolumn:updated', primary_key_column_coll);
+                    primary_key_column_coll.trigger(
+                      'pgadmin:multicolumn:updated', primary_key_column_coll
+                    );
                   }
 
                 } else {
                 // remove column from primary key.
                   if (primary_key_coll.length > 0) {
-                    var primary_key = primary_key_coll.first();
+                    primary_key = primary_key_coll.first();
                     // Do not alter existing primary key columns.
                     if (!_.isUndefined(primary_key.get('oid'))) {
                       return;
                     }
 
-                    var  primary_key_column_coll = primary_key.get('columns'),
-                        removedCols = primary_key_column_coll.where({column:column_name});
+                    primary_key_column_coll = primary_key.get('columns');
+                    var removedCols = primary_key_column_coll.where({
+                      column: column_name,
+                    });
                     if (removedCols.length > 0) {
                       primary_key_column_coll.remove(removedCols);
                       _.each(removedCols, function(m) {
                         m.destroy();
-                      })
+                      });
                       if (primary_key_column_coll.length == 0) {
                         setTimeout(function () {
                           // There will be only on primary key so remove the first one.
@@ -568,226 +579,218 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
                     primary_key_column_coll.trigger('pgadmin:multicolumn:updated', primary_key_column_coll);
                   }
                 }
-              })
+              });
             },
             remove: function() {
               var collection = this.model.get(this.field.get('name'));
               if (collection) {
-                collection.off("change:is_primary_key");
+                collection.off('change:is_primary_key');
               }
 
               Backform.UniqueColCollectionControl.prototype.remove.apply(this, arguments);
-            }
+            },
           }),
-          allowMultipleEmptyRow: false
+          allowMultipleEmptyRow: false,
         },{
           id: 'inherited_tables_cnt', label: gettext('Inherited tables count'),
           type: 'text', mode: ['properties'], group: gettext('Advanced'),
-          disabled: 'inSchema'
+          disabled: 'inSchema',
         },{
           // Here we will create tab control for constraints
           type: 'nested', control: 'tab', group: gettext('Constraints'),
           mode: ['edit', 'create'],
           schema: [{
-              id: 'primary_key', label: gettext('Primary key'),
-              model: pgBrowser.Nodes['primary_key'].model,
-              subnode: pgBrowser.Nodes['primary_key'].model,
-              editable: false, type: 'collection',
-              group: gettext('Primary Key'), mode: ['edit', 'create'],
-              canEdit: true, canDelete: true, deps:['is_partitioned'],
-              control: 'unique-col-collection',
-              columns : ['name', 'columns'],
-              canAdd: function(m) {
-                if (m.get('is_partitioned')) {
-                  setTimeout(function() {
-                    var coll = m.get('primary_key');
-                    coll.remove(coll.filter(function(model) {
-                      return true;
-                    }));
-                  }, 10);
-                  return false;
-                }
+            id: 'primary_key', label: gettext('Primary key'),
+            model: pgBrowser.Nodes['primary_key'].model,
+            subnode: pgBrowser.Nodes['primary_key'].model,
+            editable: false, type: 'collection',
+            group: gettext('Primary Key'), mode: ['edit', 'create'],
+            canEdit: true, canDelete: true, deps:['is_partitioned'],
+            control: 'unique-col-collection',
+            columns : ['name', 'columns'],
+            canAdd: function(m) {
+              if (m.get('is_partitioned')) {
+                setTimeout(function() {
+                  var coll = m.get('primary_key');
+                  coll.remove(coll.filter(function() { return true; }));
+                }, 10);
+                return false;
+              }
 
-                return true;
-              },
-              canAddRow: function(m) {
+              return true;
+            },
+            canAddRow: function(m) {
                // User can only add one primary key
-               var columns = m.get('columns');
+              var columns = m.get('columns');
 
-               return (m.get('primary_key') &&
+              return (m.get('primary_key') &&
                         m.get('primary_key').length < 1 &&
                         _.some(columns.pluck('name')));
+            },
+          },{
+            id: 'foreign_key', label: gettext('Foreign key'),
+            model: pgBrowser.Nodes['foreign_key'].model,
+            subnode: pgBrowser.Nodes['foreign_key'].model,
+            editable: false, type: 'collection',
+            group: gettext('Foreign Key'), mode: ['edit', 'create'],
+            canEdit: true, canDelete: true, deps:['is_partitioned'],
+            control: 'unique-col-collection',
+            canAdd: function(m) {
+              if (m.get('is_partitioned')) {
+                setTimeout(function() {
+                  var coll = m.get('foreign_key');
+                  coll.remove(coll.filter(function() { return true; }));
+                }, 10);
+                return false;
               }
-            },{
-              id: 'foreign_key', label: gettext('Foreign key'),
-              model: pgBrowser.Nodes['foreign_key'].model,
-              subnode: pgBrowser.Nodes['foreign_key'].model,
-              editable: false, type: 'collection',
-              group: gettext('Foreign Key'), mode: ['edit', 'create'],
-              canEdit: true, canDelete: true, deps:['is_partitioned'],
-              control: 'unique-col-collection',
-              canAdd: function(m) {
-                if (m.get('is_partitioned')) {
-                  setTimeout(function() {
-                    var coll = m.get('foreign_key');
-                    coll.remove(coll.filter(function(model) {
-                      return true;
-                    }));
-                  }, 10);
-                  return false;
-                }
 
-                return true;
-              },
-              columns : ['name', 'columns'],
-              canAddRow: function(m) {
+              return true;
+            },
+            columns : ['name', 'columns'],
+            canAddRow: function(m) {
                // User can only add if there is at least one column with name.
-               var columns = m.get('columns');
-               return _.some(columns.pluck('name'));
+              var columns = m.get('columns');
+              return _.some(columns.pluck('name'));
+            },
+          },{
+            id: 'check_constraint', label: gettext('Check constraint'),
+            model: pgBrowser.Nodes['check_constraint'].model,
+            subnode: pgBrowser.Nodes['check_constraint'].model,
+            editable: false, type: 'collection',
+            group: gettext('Check'), mode: ['edit', 'create'],
+            canEdit: true, canDelete: true, deps:['is_partitioned'],
+            control: 'unique-col-collection',
+            canAdd: true,
+            columns : ['name', 'consrc'],
+          },{
+            id: 'unique_constraint', label: gettext('Unique Constraint'),
+            model: pgBrowser.Nodes['unique_constraint'].model,
+            subnode: pgBrowser.Nodes['unique_constraint'].model,
+            editable: false, type: 'collection',
+            group: gettext('Unique'), mode: ['edit', 'create'],
+            canEdit: true, canDelete: true, deps:['is_partitioned'],
+            control: 'unique-col-collection',
+            columns : ['name', 'columns'],
+            canAdd: function(m) {
+              if (m.get('is_partitioned')) {
+                setTimeout(function() {
+                  var coll = m.get('unique_constraint');
+                  coll.remove(coll.filter(function() { return true; }));
+                }, 10);
+                return false;
               }
-            },{
-              id: 'check_constraint', label: gettext('Check constraint'),
-              model: pgBrowser.Nodes['check_constraint'].model,
-              subnode: pgBrowser.Nodes['check_constraint'].model,
-              editable: false, type: 'collection',
-              group: gettext('Check'), mode: ['edit', 'create'],
-              canEdit: true, canDelete: true, deps:['is_partitioned'],
-              control: 'unique-col-collection',
-              canAdd: true,
-              columns : ['name', 'consrc']
-            },{
-              id: 'unique_constraint', label: gettext('Unique Constraint'),
-              model: pgBrowser.Nodes['unique_constraint'].model,
-              subnode: pgBrowser.Nodes['unique_constraint'].model,
-              editable: false, type: 'collection',
-              group: gettext('Unique'), mode: ['edit', 'create'],
-              canEdit: true, canDelete: true, deps:['is_partitioned'],
-              control: 'unique-col-collection',
-              columns : ['name', 'columns'],
-              canAdd: function(m) {
-                if (m.get('is_partitioned')) {
-                  setTimeout(function() {
-                    var coll = m.get('unique_constraint');
-                    coll.remove(coll.filter(function(model) {
-                      return true;
-                    }));
-                  }, 10);
-                  return false;
-                }
 
-                return true;
-              },
-              canAddRow: function(m) {
+              return true;
+            },
+            canAddRow: function(m) {
                // User can only add if there is at least one column with name.
-               var columns = m.get('columns');
-               return _.some(columns.pluck('name'));
+              var columns = m.get('columns');
+              return _.some(columns.pluck('name'));
+            },
+          },{
+            id: 'exclude_constraint', label: gettext('Exclude constraint'),
+            model: pgBrowser.Nodes['exclusion_constraint'].model,
+            subnode: pgBrowser.Nodes['exclusion_constraint'].model,
+            editable: false, type: 'collection',
+            group: gettext('Exclude'), mode: ['edit', 'create'],
+            canEdit: true, canDelete: true, deps:['is_partitioned'],
+            control: 'unique-col-collection',
+            columns : ['name', 'columns', 'constraint'],
+            canAdd: function(m) {
+              if (m.get('is_partitioned')) {
+                setTimeout(function() {
+                  var coll = m.get('exclude_constraint');
+                  coll.remove(coll.filter(function() { return true; }));
+                }, 10);
+                return false;
               }
-            },{
-              id: 'exclude_constraint', label: gettext('Exclude constraint'),
-              model: pgBrowser.Nodes['exclusion_constraint'].model,
-              subnode: pgBrowser.Nodes['exclusion_constraint'].model,
-              editable: false, type: 'collection',
-              group: gettext('Exclude'), mode: ['edit', 'create'],
-              canEdit: true, canDelete: true, deps:['is_partitioned'],
-              control: 'unique-col-collection',
-              columns : ['name', 'columns', 'constraint'],
-              canAdd: function(m) {
-                if (m.get('is_partitioned')) {
-                  setTimeout(function() {
-                    var coll = m.get('exclude_constraint');
-                    coll.remove(coll.filter(function(model) {
-                      return true;
-                    }));
-                  }, 10);
-                  return false;
-                }
 
-                return true;
-              },
-              canAddRow: function(m) {
+              return true;
+            },
+            canAddRow: function(m) {
                // User can only add if there is at least one column with name.
-               var columns = m.get('columns');
-               return _.some(columns.pluck('name'));
-              }
-          }]
+              var columns = m.get('columns');
+              return _.some(columns.pluck('name'));
+            },
+          }],
         },{
           id: 'typname', label: gettext('Of type'), type: 'text',
-          control: 'node-ajax-options', mode: ['properties', 'create', 'edit'],
-          disabled: 'checkOfType', url: 'get_oftype', group: gettext('Advanced'),
-          deps: ['coll_inherits', 'is_partitioned'], transform: function(data, cell) {
+          mode: ['properties', 'create', 'edit'], group: gettext('Advanced'),
+          disabled: 'checkOfType', url: 'get_oftype',
+          deps: ['coll_inherits', 'is_partitioned'],
+          transform: function(data, cell) {
             var control = cell || this,
               m = control.model;
-              m.of_types_tables = data;
-              return data;
+            m.of_types_tables = data;
+            return data;
           },
           control: Backform.NodeAjaxOptionsControl.extend({
               // When of_types changes we need to clear columns collection
-              onChange: function() {
-                Backform.NodeAjaxOptionsControl.prototype.onChange.apply(this, arguments);
-                var self = this,
-                  tbl_oid = undefined,
-                  tbl_name = self.model.get('typname'),
-                  data = undefined,
-                  arg = undefined,
-                  column_collection = self.model.get('columns');
+            onChange: function() {
+              Backform.NodeAjaxOptionsControl.prototype.onChange.apply(this, arguments);
+              var self = this,
+                tbl_name = self.model.get('typname'),
+                data = undefined,
+                arg = undefined,
+                column_collection = self.model.get('columns');
 
-                if (!_.isUndefined(tbl_name) &&
+              if (!_.isUndefined(tbl_name) &&
                     tbl_name !== '' && column_collection.length !== 0) {
-                  var msg = gettext('Changing of table type will clear columns collection.');
-                  alertify.confirm(msg, function (e) {
-                    if (e) {
+                var msg = gettext('Changing of table type will clear columns collection.');
+                Alertify.confirm(msg, function (e) {
+                  if (e) {
                       // User clicks Ok, lets clear columns collection
-                      column_collection.reset();
-                    } else {
-                      return this;
-                    }
-                  });
-                } else if (!_.isUndefined(tbl_name) && tbl_name === '') {
-                  column_collection.reset();
-                }
+                    column_collection.reset();
+                  } else {
+                    return this;
+                  }
+                });
+              } else if (!_.isUndefined(tbl_name) && tbl_name === '') {
+                column_collection.reset();
+              }
 
                 // Run Ajax now to fetch columns
-                if (!_.isUndefined(tbl_name) && tbl_name !== '') {
-                  arg = { 'tname': tbl_name }
-                  data = self.model.fetch_columns_ajax.apply(self, [arg]);
+              if (!_.isUndefined(tbl_name) && tbl_name !== '') {
+                arg = { 'tname': tbl_name };
+                data = self.model.fetch_columns_ajax.apply(self, [arg]);
                   // Add into column collection
-                  column_collection.set(data, { merge:false,remove:false });
-                }
+                column_collection.set(data, { merge:false,remove:false });
               }
-            })
+            },
+          }),
         },{
           id: 'fillfactor', label: gettext('Fill factor'), type: 'int',
           mode: ['create', 'edit'], min: 10, max: 100,
-          disabled: 'inSchema',group: gettext('Advanced')
+          disabled: 'inSchema',group: gettext('Advanced'),
         },{
           id: 'relhasoids', label: gettext('Has OIDs?'), cell: 'switch',
           type: 'switch', mode: ['properties', 'create', 'edit'],
-          disabled: 'inSchema', group: gettext('Advanced')
+          disabled: 'inSchema', group: gettext('Advanced'),
         },{
           id: 'relpersistence', label: gettext('Unlogged?'), cell: 'switch',
           type: 'switch', mode: ['properties', 'create', 'edit'],
           disabled: 'inSchemaWithModelCheck',
-          group: gettext('Advanced')
+          group: gettext('Advanced'),
         },{
           id: 'conname', label: gettext('Primary key'), cell: 'string',
           type: 'text', mode: ['properties'], group: gettext('Advanced'),
-          disabled: 'inSchema'
+          disabled: 'inSchema',
         },{
           id: 'reltuples', label: gettext('Rows (estimated)'), cell: 'string',
           type: 'text', mode: ['properties'], group: gettext('Advanced'),
-          disabled: 'inSchema'
+          disabled: 'inSchema',
         },{
           id: 'rows_cnt', label: gettext('Rows (counted)'), cell: 'string',
           type: 'text', mode: ['properties'], group: gettext('Advanced'),
-          disabled: 'inSchema'
+          disabled: 'inSchema',
         },{
           id: 'relhassubclass', label: gettext('Inherits tables?'), cell: 'switch',
           type: 'switch', mode: ['properties'], group: gettext('Advanced'),
-          disabled: 'inSchema'
+          disabled: 'inSchema',
         },{
           id: 'is_sys_table', label: gettext('System table?'), cell: 'switch',
           type: 'switch', mode: ['properties'],
-          disabled: 'inSchema'
+          disabled: 'inSchema',
         },{
           type: 'nested', control: 'fieldset', label: gettext('Like'),
           group: gettext('Advanced'),
@@ -795,36 +798,36 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
             id: 'like_relation', label: gettext('Relation'),
             type: 'text', mode: ['create', 'edit'], deps: ['typname'],
             control: 'node-ajax-options', url: 'get_relations',
-            disabled: 'isLikeDisable', group: gettext('Like')
+            disabled: 'isLikeDisable', group: gettext('Like'),
           },{
             id: 'like_default_value', label: gettext('With default values?'),
             type: 'switch', mode: ['create', 'edit'], deps: ['typname'],
-            disabled: 'isLikeDisable', group: gettext('Like')
+            disabled: 'isLikeDisable', group: gettext('Like'),
           },{
             id: 'like_constraints', label: gettext('With constraints?'),
             type: 'switch', mode: ['create', 'edit'], deps: ['typname'],
-            disabled: 'isLikeDisable', group: gettext('Like')
+            disabled: 'isLikeDisable', group: gettext('Like'),
           },{
             id: 'like_indexes', label: gettext('With indexes?'),
             type: 'switch', mode: ['create', 'edit'], deps: ['typname'],
-            disabled: 'isLikeDisable', group: gettext('Like')
+            disabled: 'isLikeDisable', group: gettext('Like'),
           },{
             id: 'like_storage', label: gettext('With storage?'),
             type: 'switch', mode: ['create', 'edit'], deps: ['typname'],
-            disabled: 'isLikeDisable', group: gettext('Like')
+            disabled: 'isLikeDisable', group: gettext('Like'),
           },{
             id: 'like_comments', label: gettext('With comments?'),
             type: 'switch', mode: ['create', 'edit'], deps: ['typname'],
-            disabled: 'isLikeDisable', group: gettext('Like')
-          }]
+            disabled: 'isLikeDisable', group: gettext('Like'),
+          }],
         },{
           id: 'partition_type', label:gettext('Partition Type'),
           editable: false, type: 'select2', select2: {allowClear: false},
           group: 'partition', deps: ['is_partitioned'],
           options:[{
-            label: gettext('Range'), value: 'range'
+            label: gettext('Range'), value: 'range',
           },{
-            label: gettext('List'), value: 'list'
+            label: gettext('List'), value: 'list',
           }],
           mode:['create'],
           visible: function(m) {
@@ -839,7 +842,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
             if (!m.isNew() || !m.get('is_partitioned'))
               return true;
             return false;
-          }
+          },
         },{
           id: 'partition_keys', label:gettext('Partition Keys'),
           model: Backform.PartitionKeyModel,
@@ -878,12 +881,10 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
             if (m.get('partition_keys') && m.get('partition_keys').models.length > 0) {
               setTimeout(function () {
                 var coll = m.get('partition_keys');
-                coll.remove(coll.filter(function(model) {
-                  return true;
-                }));
+                coll.remove(coll.filter(function() { return true; }));
               }, 10);
             }
-          }
+          },
         },{
           id: 'partition_scheme', label: gettext('Partition Scheme'),
           type: 'note', group: 'partition', mode: ['edit'],
@@ -899,7 +900,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
             if (!m.isNew()) {
               this.text = m.get('partition_scheme');
             }
-          }
+          },
         },{
           id: 'partitions', label:gettext('Partitions'),
           model: Backform.PartitionsModel,
@@ -918,14 +919,14 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
               var self = this;
               if (!this.model.isNew()) {
                 var node = this.field.get('schema_node'),
-                    node_info = this.field.get('node_info');
+                  node_info = this.field.get('node_info');
 
                 // Make ajax call to get the tables to be attached
                 $.ajax({
                   url: node.generate_url.apply(
                       node, [
                         null, 'get_attach_tables', this.field.get('node_data'),
-                        true, node_info
+                        true, node_info,
                       ]),
 
                   type: 'GET',
@@ -935,18 +936,18 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
                       self.model.table_options = res.data;
                     }
                     else {
-                      alertify.alert(
+                      Alertify.alert(
                         gettext('Error fetching tables to be attached'), res.data.result
                       );
                     }
                   },
                   error: function(e) {
                     var errmsg = $.parseJSON(e.responseText);
-                    alertify.alert(gettext('Error fetching tables to be attached'), errmsg.errormsg);
-                  }
+                    Alertify.alert(gettext('Error fetching tables to be attached'), errmsg.errormsg);
+                  },
                 });
               }
-            }
+            },
           }
           ),
           canAdd: function(m) {
@@ -963,15 +964,16 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
             return false;
           },
           disabled: function(m) {
-            if (m.isNew() && m.get('partitions') && m.get('partitions').models.length > 0) {
+            if (
+              m.isNew() && m.get('partitions') &&
+                m.get('partitions').models.length > 0
+            ) {
               setTimeout(function () {
                 var coll = m.get('partitions');
-                coll.remove(coll.filter(function(model) {
-                  return true;
-                }));
+                coll.remove(coll.filter(function() { return true; }));
               }, 10);
             }
-          }
+          },
         },{
           id: 'partition_note', label: gettext('Partition'),
           type: 'note', group: 'partition',
@@ -986,41 +988,39 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
               return true;
 
             return false;
-          }
+          },
         },{
           // Here - we will create tab control for storage parameters
           // (auto vacuum).
           type: 'nested', control: 'tab', group: gettext('Parameter'),
           mode: ['edit', 'create'], deps: ['is_partitioned'],
-          schema: Backform.VacuumSettingsSchema
+          schema: Backform.VacuumSettingsSchema,
         },{
           id: 'relacl_str', label: gettext('Privileges'), disabled: 'inSchema',
-          type: 'text', mode: ['properties'], group: gettext('Security')
+          type: 'text', mode: ['properties'], group: gettext('Security'),
         }, pgBrowser.SecurityGroupSchema,{
           id: 'relacl', label: gettext('Privileges'), type: 'collection',
           group: 'security', control: 'unique-col-collection',
           model: pgBrowser.Node.PrivilegeRoleModel.extend({
-          privileges: ['a','r','w','d','D','x','t']}),
+            privileges: ['a','r','w','d','D','x','t']}),
           mode: ['edit', 'create'], canAdd: true, canDelete: true,
-          uniqueCol : ['grantee']
+          uniqueCol : ['grantee'],
         },{
           id: 'seclabels', label: gettext('Security labels'), canEdit: false,
           model: pgBrowser.SecLabelModel, editable: false, canAdd: true,
           type: 'collection', min_version: 90100, mode: ['edit', 'create'],
-          group: 'security', canDelete: true, control: 'unique-col-collection'
+          group: 'security', canDelete: true, control: 'unique-col-collection',
         },{
           id: 'vacuum_settings_str', label: gettext('Storage settings'),
-          type: 'multiline', group: gettext('Advanced'), mode: ['properties']
+          type: 'multiline', group: gettext('Advanced'), mode: ['properties'],
         }],
         validate: function(keys) {
-          var err = {},
-              changedAttrs = this.changed,
-              msg = undefined,
-              name = this.get('name'),
-              schema = this.get('schema'),
-              relowner = this.get('relowner'),
-              is_partitioned = this.get('is_partitioned'),
-              partition_keys = this.get('partition_keys');
+          var msg,
+            name = this.get('name'),
+            schema = this.get('schema'),
+            relowner = this.get('relowner'),
+            is_partitioned = this.get('is_partitioned'),
+            partition_keys = this.get('partition_keys');
 
           // If nothing to validate or VacuumSetting keys then
           // return from here
@@ -1085,7 +1085,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
           // Disabled if it is partitioned table
           if (m.get('is_partitioned')) {
             setTimeout( function() {
-               m.set('coll_inherits', []);
+              m.set('coll_inherits', []);
             }, 10);
             return true;
           }
@@ -1117,8 +1117,8 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
             if (!_.isUndefined(m.get('typname')) &&
                 !_.isNull(m.get('typname')) &&
                 m.get('typname') !== '') {
-                    enable_flag = false;
-                }
+              enable_flag = false;
+            }
           }
           return enable_flag;
         },
@@ -1137,7 +1137,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
           // Disabled if it is partitioned table
           if (m.get('is_partitioned')) {
             setTimeout( function() {
-               m.set('typname', undefined);
+              m.set('typname', undefined);
             }, 10);
             return true;
           }
@@ -1184,20 +1184,19 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
         },
         fetch_columns_ajax: function(arg) {
           var self = this,
-              url = 'get_columns',
-              m = self.model.top || self.model,
-              old_columns = _.clone(m.get('columns')),
-              data = undefined,
-              node = this.field.get('schema_node'),
-              node_info = this.field.get('node_info'),
-              full_url = node.generate_url.apply(
+            url = 'get_columns',
+            m = self.model.top || self.model,
+            data = undefined,
+            node = this.field.get('schema_node'),
+            node_info = this.field.get('node_info'),
+            full_url = node.generate_url.apply(
                 node, [
                   null, url, this.field.get('node_data'),
-                  this.field.get('url_with_id') || false, node_info
+                  this.field.get('url_with_id') || false, node_info,
                 ]
               ),
-              cache_level = this.field.get('cache_level') || node.type,
-              cache_node = this.field.get('cache_node');
+            cache_level = this.field.get('cache_level') || node.type,
+            cache_node = this.field.get('cache_node');
 
           cache_node = (cache_node && pgBrowser.Nodes['cache_node']) || node;
 
@@ -1212,40 +1211,40 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
             },
             error: function() {
               m.trigger('pgadmin:view:fetch:error', m, self.field);
-            }
+            },
           });
           m.trigger('pgadmin:view:fetched', m, self.field);
           data = (data && data.data) || [];
           return data;
-        }
+        },
       }),
       canCreate: function(itemData, item, data) {
           //If check is false then , we will allow create menu
-          if (data && data.check == false)
-            return true;
+        if (data && data.check == false)
+          return true;
 
-          var t = pgBrowser.tree, i = item, d = itemData;
+        var t = pgBrowser.tree, i = item, d = itemData;
           // To iterate over tree to check parent node
-          while (i) {
+        while (i) {
             // If it is schema then allow user to create table
-            if (_.indexOf(['schema'], d._type) > -1)
-              return true;
+          if (_.indexOf(['schema'], d._type) > -1)
+            return true;
 
-            if ('coll-table' == d._type) {
+          if ('coll-table' == d._type) {
               //Check if we are not child of catalog
-              var prev_i = t.hasParent(i) ? t.parent(i) : null;
-              var prev_d = prev_i ? t.itemData(prev_i) : null;
-              if( prev_d._type == 'catalog') {
-                return false;
-              } else {
-                return true;
-              }
+            var prev_i = t.hasParent(i) ? t.parent(i) : null;
+            var prev_d = prev_i ? t.itemData(prev_i) : null;
+            if( prev_d._type == 'catalog') {
+              return false;
+            } else {
+              return true;
             }
-            i = t.hasParent(i) ? t.parent(i) : null;
-            d = i ? t.itemData(i) : null;
           }
+          i = t.hasParent(i) ? t.parent(i) : null;
+          d = i ? t.itemData(i) : null;
+        }
           // by default we do not want to allow create menu
-          return true;
+        return true;
       },
       // Check to whether table has disable trigger(s)
       canCreate_with_trigger_enable: function(itemData, item, data) {
@@ -1268,7 +1267,7 @@ function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
             return false;
           }
         }
-      }
+      },
     });
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/static/js/rule.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/static/js/rule.js
index 0ad89576..3af61754 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/static/js/rule.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/static/js/rule.js
@@ -1,7 +1,7 @@
 define('pgadmin.node.rule', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'codemirror'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, CodeMirror) {
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
+], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform) {
 
   /**
     Create and add a rule collection into nodes
@@ -11,13 +11,13 @@ define('pgadmin.node.rule', [
       display under under properties.
    */
   if (!pgBrowser.Nodes['coll-rule']) {
-    var rules = pgAdmin.Browser.Nodes['coll-rule'] =
+    pgAdmin.Browser.Nodes['coll-rule'] =
       pgAdmin.Browser.Collection.extend({
         node: 'rule',
         label: gettext('Rules'),
         type: 'coll-rule',
         getTreeNodeHierarchy: pgBrowser.tableChildTreeNodeHierarchy,
-        columns: ["name", "owner", "comment"]
+        columns: ['name', 'owner', 'comment'],
       });
   }
 
@@ -65,7 +65,7 @@ define('pgadmin.node.rule', [
 
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -81,32 +81,32 @@ define('pgadmin.node.rule', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 1, label: gettext('Rule...'),
           icon: 'wcTabIcon icon-rule', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_rule_onView', node: 'view', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 5, label: gettext('Rule...'),
           icon: 'wcTabIcon icon-rule', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_rule', node: 'rule', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 1, label: gettext('Rule...'),
           icon: 'wcTabIcon icon-rule', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_rule', node: 'table', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Rule...'),
           icon: 'wcTabIcon icon-rule', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_rule', node: 'partition', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Rule...'),
           icon: 'wcTabIcon icon-rule', data: {action: 'create', check: true},
-          enable: 'canCreate'
-        }
+          enable: 'canCreate',
+        },
         ]);
       },
 
@@ -119,7 +119,7 @@ define('pgadmin.node.rule', [
           id: 'name', label: gettext('Name'),
           type: 'text', disabled: function(m) {
             // disable name field it it is system rule
-            if (m && m.get('name') == "_RETURN") {
+            if (m && m.get('name') == '_RETURN') {
               return true;
             }
             if (m.isNew()) {
@@ -128,18 +128,18 @@ define('pgadmin.node.rule', [
               return false;
             }
             return true;
-          }
+          },
         },
         {
           id: 'oid', label: gettext('OID'),
-          type: 'text', disabled: true, mode: ['properties']
+          type: 'text', disabled: true, mode: ['properties'],
         },
         {
           id: 'schema', label:'',
           type: 'text', visible: false, disabled: function(m) {
             // It is used while generating sql
             m.set('schema', m.node_info.schema.label);
-          }
+          },
         },
         {
           id: 'view', label:'',
@@ -147,47 +147,47 @@ define('pgadmin.node.rule', [
 
             // It is used while generating sql
             m.set('view', this.node_data.label);
-          }
+          },
         },
         {
           id: 'event', label: gettext('Event'), control: 'select2',
           group: gettext('Definition'), type: 'text',
           select2: {
             width: '100%',
-            allowClear: false
+            allowClear: false,
           },
           options:[
             {label: 'Select', value: 'Select'},
             {label: 'Insert', value: 'Insert'},
             {label: 'Update', value: 'Update'},
-            {label: 'Delete', value: 'Delete'}
-          ]
+            {label: 'Delete', value: 'Delete'},
+          ],
         },
         {
           id: 'do_instead', label: gettext('Do Instead'), group: gettext('Definition'),
-          type: 'switch'
+          type: 'switch',
         },
         {
           id: 'condition', label: gettext('Condition'),
           type: 'text', group: gettext('Definition'),
-          control: Backform.SqlFieldControl
+          control: Backform.SqlFieldControl,
         },
         {
           id: 'statements', label: gettext('Commands'),
           type: 'text', group: gettext('Definition'),
-          control: Backform.SqlFieldControl
+          control: Backform.SqlFieldControl,
         },
         {
           id: 'system_rule', label: gettext('System rule?'),
-          type: 'switch', mode: ['properties']
+          type: 'switch', mode: ['properties'],
         },
         {
           id: 'enabled', label: gettext('Enabled?'),
-          type: 'switch', mode: ['properties']
+          type: 'switch', mode: ['properties'],
         },
         {
-          id: 'comment', label: gettext('Comment'), cell: 'string', type: 'multiline'
-        }
+          id: 'comment', label: gettext('Comment'), cell: 'string', type: 'multiline',
+        },
         ],
         validate: function() {
 
@@ -208,7 +208,7 @@ define('pgadmin.node.rule', [
             this.errorModel.unset('name');
           }
           return null;
-        }
+        },
       }),
 
       // Show or hide create rule menu option on parent node
@@ -231,7 +231,6 @@ define('pgadmin.node.rule', [
 
             //Check if we are not child of rule
             var prev_i = t.hasParent(i) ? t.parent(i) : null,
-              prev_d = prev_i ? t.itemData(prev_i) : null,
               prev_j = t.hasParent(prev_i) ? t.parent(prev_i) : null,
               prev_e = prev_j ? t.itemData(prev_j) : null,
               prev_k = t.hasParent(prev_j) ? t.parent(prev_j) : null,
@@ -249,7 +248,6 @@ define('pgadmin.node.rule', [
            */
           else if('view' == d._type || 'table' == d._type){
             prev_i = t.hasParent(i) ? t.parent(i) : null;
-            prev_d = prev_i ? t.itemData(prev_i) : null;
             prev_j = t.hasParent(prev_i) ? t.parent(prev_i) : null;
             prev_e = prev_j ? t.itemData(prev_j) : null;
             if(prev_e._type == 'schema') {
@@ -265,9 +263,9 @@ define('pgadmin.node.rule', [
         // By default we do not want to allow create menu
         return true;
 
-      }
+      },
 
-  });
+    });
   }
 
   return pgBrowser.Nodes['coll-rule'];
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/partition.utils.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/partition.utils.js
index 542463fa..80610cfe 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/partition.utils.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/partition.utils.js
@@ -1,30 +1,30 @@
-define('pgadmin.node.table_partition_utils',
-        ['sources/gettext', 'jquery', 'underscore', 'pgadmin.browser',
-        'backform','backgrid', 'pgadmin.browser.collection'],
-function(gettext, $, _, pgBrowser, Backform, Backgrid) {
+define('pgadmin.node.table_partition_utils', [
+  'sources/gettext', 'jquery', 'underscore', 'backbone', 'pgadmin.browser',
+  'pgadmin.backform','pgadmin.backgrid', 'pgadmin.browser.collection',
+], function(gettext, $, _, Backbone, pgBrowser, Backform, Backgrid) {
 
   Backgrid.PartitionRow = Backgrid.Row.extend({
-    modelDuplicateColor: "lightYellow",
+    modelDuplicateColor: 'lightYellow',
 
-    modelUniqueColor: "#fff",
+    modelUniqueColor: '#fff',
 
     initialize: function () {
       Backgrid.Row.prototype.initialize.apply(this, arguments);
       var self = this;
-      self.model.on("change:is_attach", function() {
+      self.model.on('change:is_attach', function() {
         setTimeout(function() {
           self.columns.each(function(col) {
             if (col.get('name') == 'partition_name') {
               var idx = self.columns.indexOf(col),
-                cf = col.get("cellFunction"),
+                cf = col.get('cellFunction'),
                 cell = new (cf.apply(col, [self.model]))({
                   column: col,
-                  model: self.model
+                  model: self.model,
                 }),
-                  oldCell = self.cells[idx];
-                oldCell.remove();
-                self.cells[idx] = cell;
-                self.render();
+                oldCell = self.cells[idx];
+              oldCell.remove();
+              self.cells[idx] = cell;
+              self.render();
             }
           });
         }, 10);
@@ -33,16 +33,16 @@ function(gettext, $, _, pgBrowser, Backform, Backgrid) {
       self.listenTo(self.model, 'pgadmin-session:model:unique', self.modelUnique);
     },
     modelDuplicate: function() {
-      $(this.el).removeClass("new");
+      $(this.el).removeClass('new');
       this.el.style.backgroundColor = this.modelDuplicateColor;
     },
     modelUnique: function() {
       this.el.style.backgroundColor = this.modelUniqueColor;
-    }
+    },
   });
 
   var getPartitionCell = function(model) {
-    var is_attach = model.get("is_attach");
+    var is_attach = model.get('is_attach');
     if (is_attach) {
       var options = [];
       model.set({'partition_name': undefined}, {silent:true});
@@ -57,147 +57,148 @@ function(gettext, $, _, pgBrowser, Backform, Backgrid) {
   };
 
   Backform.PartitionKeyModel = pgBrowser.Node.Model.extend({
-     defaults: {
-       key_type: 'column',
-       pt_column: undefined,
-       expression: undefined
-     },
-     keys:['pt_column'],
-     schema: [{
-       id: 'key_type', label: gettext('Key type'), type:'select2', editable: true,
-       cell:'select2', cellHeaderClasses: 'width_percent_25',
-       select2: {allowClear: false},
-       options:[{
-         label: gettext('Column'), value: 'column'
-       },{
-         label: gettext('Expression'), value: 'expression'
-       }]
-     },{
-       id: 'pt_column', label: gettext('Column'), type:'text',
-       cell: Backgrid.Extension.Select2DepCell.extend({
-         keyPathAccessor: function(obj, path) {
-           var res = obj;
-           if(_.isArray(res)) {
-             return _.map(res, function(o) { return o['pt_column']
-             });
-           }
-           path = path.split('.');
-           for (var i = 0; i < path.length; i++) {
-             if (_.isNull(res)) return null;
-             if (_.isEmpty(path[i])) continue;
-             if (!_.isUndefined(res[path[i]])) res = res[path[i]];
-           }
-           return _.isObject(res) && !_.isArray(res) ? null : res;
-         },
-         initialize: function() {
+    defaults: {
+      key_type: 'column',
+      pt_column: undefined,
+      expression: undefined,
+    },
+    keys:['pt_column'],
+    schema: [{
+      id: 'key_type', label: gettext('Key type'), type:'select2', editable: true,
+      cell:'select2', cellHeaderClasses: 'width_percent_25',
+      select2: {allowClear: false},
+      options:[{
+        label: gettext('Column'), value: 'column',
+      },{
+        label: gettext('Expression'), value: 'expression',
+      }],
+    },{
+      id: 'pt_column', label: gettext('Column'), type:'text',
+      cell: Backgrid.Extension.Select2DepCell.extend({
+        keyPathAccessor: function(obj, path) {
+          var res = obj;
+          if(_.isArray(res)) {
+            return _.map(res, function(o) { return o['pt_column'];
+            });
+          }
+          path = path.split('.');
+          for (var i = 0; i < path.length; i++) {
+            if (_.isNull(res)) return null;
+            if (_.isEmpty(path[i])) continue;
+            if (!_.isUndefined(res[path[i]])) res = res[path[i]];
+          }
+          return _.isObject(res) && !_.isArray(res) ? null : res;
+        },
+        initialize: function() {
          // Here we will decide if we need to call URL
          // Or fetch the data from parent columns collection
-           var self = this;
-           if(this.model.handler) {
-             Backgrid.Extension.Select2DepCell.prototype.initialize.apply(this, arguments);
+          var self = this;
+          if(this.model.handler) {
+            Backgrid.Extension.Select2DepCell.prototype.initialize.apply(this, arguments);
              // Do not listen for any event(s) for existing constraint.
-             if (_.isUndefined(self.model.get('oid'))) {
-               var tableCols = self.model.top.get('columns');
-               self.listenTo(tableCols, 'remove' , self.resetColOptions);
-               self.listenTo(tableCols, 'change:name', self.resetColOptions);
-             }
+            if (_.isUndefined(self.model.get('oid'))) {
+              var tableCols = self.model.top.get('columns');
+              self.listenTo(tableCols, 'remove' , self.resetColOptions);
+              self.listenTo(tableCols, 'change:name', self.resetColOptions);
+            }
 
-             self.custom_options();
-           }
-         },
-         resetColOptions: function(m) {
-           var self = this;
+            self.custom_options();
+          }
+        },
+        resetColOptions: function() {
+          var self = this;
 
-           setTimeout(function () {
-             self.custom_options();
-             self.render.apply(self);
-           }, 50);
-         },
-         custom_options: function() {
+          setTimeout(function () {
+            self.custom_options();
+            self.render.apply(self);
+          }, 50);
+        },
+        custom_options: function() {
            // We will add all the columns entered by user in table model
-           var columns = this.model.top.get('columns'),
-               typename = this.model.top.get('typname'),
-               of_types_tables = this.model.top.of_types_tables,
-               added_columns_from_tables = [];
+          var columns = this.model.top.get('columns'),
+            typename = this.model.top.get('typname'),
+            of_types_tables = this.model.top.of_types_tables,
+            added_columns_from_tables = [];
 
-           if (columns.length > 0) {
-             _.each(columns.models, function(m) {
-                 var col = m.get('name');
-                 if(!_.isUndefined(col) && !_.isNull(col)) {
-                   added_columns_from_tables.push(
+          if (columns.length > 0) {
+            _.each(columns.models, function(m) {
+              var col = m.get('name');
+              if(!_.isUndefined(col) && !_.isNull(col)) {
+                added_columns_from_tables.push(
                      {label: col, value: col, image:'icon-column'}
                    );
-                 }
-             });
-           } else if (!_.isUndefined(typename) && !_.isNull(typename)
+              }
+            });
+          } else if (!_.isUndefined(typename) && !_.isNull(typename)
               && !_.isUndefined(of_types_tables) && of_types_tables.length > 0) {
               // Iterate through all the of_type tables
-              _.each(of_types_tables, function(type) {
-                if (type.label == typename) {
+            _.each(of_types_tables, function(type) {
+              if (type.label == typename) {
                   // Iterate all the columns of selected "OF TYPE".
-                  _.each(type.oftype_columns, function(col) {
-                    added_columns_from_tables.push(
+                _.each(type.oftype_columns, function(col) {
+                  added_columns_from_tables.push(
                       {label: col.name, value: col.name, image:'icon-column'}
                     );
-                  });
-                }
-              });
-           }
+                });
+              }
+            });
+          }
 
            // Set the values in to options so that user can select
-           this.column.set('options', added_columns_from_tables);
-         },
-         remove: function() {
-           if(this.model.handler) {
-             var self = this,
-             tableCols = self.model.top.get('columns');
-             self.stopListening(tableCols, 'remove' , self.resetColOptions);
-             self.stopListening(tableCols, 'change:name' , self.resetColOptions);
-             Backgrid.Extension.Select2DepCell.prototype.remove.apply(this, arguments);
-           }
-         }
-       }),
-       deps: ['key_type'],
-       cellHeaderClasses: 'width_percent_30',
-       transform : function(data){
-         var res = [];
-         if (data && _.isArray(data)) {
-           _.each(data, function(d) {
-             res.push({label: d.label, value: d.label, image:'icon-column'});
-           })
-         }
-         return res;
-       },
-       select2:{allowClear:false},
-       editable: function(m) {
-         if (m.get('key_type') == 'expression') {
-           setTimeout( function() {
-              m.set('pt_column', undefined);
-           }, 10);
-           return false;
-         }
-         return true;
-       }
-     },{
-       id: 'expression', label: gettext('Expression'), type:'text',
-       cell:Backgrid.Extension.StringDepCell,
-       cellHeaderClasses: 'width_percent_45',
-       deps: ['key_type'],
-       editable: function(m) {
-         if (m.get('key_type') == 'column') {
-           setTimeout( function() {
-              m.set('expression', undefined);
-           }, 10);
-           return false;
-         }
-         return true;
-       }
-     }
+          this.column.set('options', added_columns_from_tables);
+        },
+        remove: function() {
+          if(this.model.handler) {
+            var self = this,
+              tableCols = self.model.top.get('columns');
+            self.stopListening(tableCols, 'remove' , self.resetColOptions);
+            self.stopListening(tableCols, 'change:name' , self.resetColOptions);
+            Backgrid.Extension.Select2DepCell.prototype.remove.apply(this, arguments);
+          }
+        },
+      }),
+      deps: ['key_type'],
+      cellHeaderClasses: 'width_percent_30',
+      transform : function(data){
+        var res = [];
+        if (data && _.isArray(data)) {
+          _.each(data, function(d) {
+            res.push({label: d.label, value: d.label, image:'icon-column'});
+          });
+        }
+        return res;
+      },
+      select2:{allowClear:false},
+      editable: function(m) {
+        if (m.get('key_type') == 'expression') {
+          setTimeout( function() {
+            m.set('pt_column', undefined);
+          }, 10);
+          return false;
+        }
+        return true;
+      },
+    },{
+      id: 'expression', label: gettext('Expression'), type:'text',
+      cell:Backgrid.Extension.StringDepCell,
+      cellHeaderClasses: 'width_percent_45',
+      deps: ['key_type'],
+      editable: function(m) {
+        if (m.get('key_type') == 'column') {
+          setTimeout( function() {
+            m.set('expression', undefined);
+          }, 10);
+          return false;
+        }
+        return true;
+      },
+    },
     ],
-    validate: function(keys) {
+    validate: function() {
       var col_type = this.get('key_type'),
-         pt_column = this.get('pt_column'),
-         expression = this.get('expression');
+        pt_column = this.get('pt_column'),
+        expression = this.get('expression'),
+        msg;
 
       // Have to clear existing validation before initiating current state
       // validation only
@@ -205,27 +206,27 @@ function(gettext, $, _, pgBrowser, Backform, Backgrid) {
 
       if (_.isUndefined(col_type) || _.isNull(col_type) ||
         String(col_type).replace(/^\s+|\s+$/g, '') == '') {
-        var msg = gettext('Partition key type cannot be empty.');
+        msg = gettext('Partition key type cannot be empty.');
         this.errorModel.set('key_type', msg);
         return msg;
       }
       else if (col_type == 'column' &&
         _.isUndefined(pt_column) || _.isNull(pt_column) ||
         String(pt_column).replace(/^\s+|\s+$/g, '') == '') {
-        var msg = gettext('Partition key column cannot be empty.');
+        msg = gettext('Partition key column cannot be empty.');
         this.errorModel.set('pt_column', msg);
         return msg;
       }
       else if (col_type == 'expression' &&
         _.isUndefined(expression) || _.isNull(expression) ||
         String(expression).replace(/^\s+|\s+$/g, '') == '') {
-        var msg = gettext('Partition key expression cannot be empty.');
+        msg = gettext('Partition key expression cannot be empty.');
         this.errorModel.set('expression', msg);
         return msg;
       }
 
       return null;
-    }
+    },
   });
 
   Backform.PartitionsModel = pgBrowser.Node.Model.extend({
@@ -235,11 +236,11 @@ function(gettext, $, _, pgBrowser, Backform, Backgrid) {
       partition_name: undefined,
       values_from: undefined,
       values_to: undefined,
-      values_in: undefined
+      values_in: undefined,
     },
     keys:['partition_name'],
     schema: [{
-      id: 'oid', label: gettext('OID'), type: 'text'
+      id: 'oid', label: gettext('OID'), type: 'text',
     },{
       id: 'is_attach', label:gettext('Operation'), cell: 'switch',
       type: 'switch', options: { 'onText': gettext('Attach'), 'offText': gettext('Create')},
@@ -248,7 +249,7 @@ function(gettext, $, _, pgBrowser, Backform, Backgrid) {
         if (m instanceof Backbone.Model && m.isNew() && !m.top.isNew())
           return true;
         return false;
-      }
+      },
     },{
       id: 'partition_name', label: gettext('Name'), type: 'text', cell:'string',
       cellHeaderClasses: 'width_percent_25',
@@ -256,19 +257,19 @@ function(gettext, $, _, pgBrowser, Backform, Backgrid) {
         if (m instanceof Backbone.Model && m.isNew())
           return true;
         return false;
-      }, cellFunction: getPartitionCell
+      }, cellFunction: getPartitionCell,
     },{
       id: 'values_from', label: gettext('From'), type:'text',
       cell:Backgrid.Extension.StringDepCell,
       cellHeaderClasses: 'width_percent_20',
       editable: function(m) {
-       if(m.handler && m.handler.top &&
+        if(m.handler && m.handler.top &&
           m.handler.top.attributes &&
           m.handler.top.attributes.partition_type == 'range' &&
           m instanceof Backbone.Model && m.isNew())
           return true;
-       return false;
-      }
+        return false;
+      },
     },{
       id: 'values_to', label: gettext('To'), type:'text',
       cell:Backgrid.Extension.StringDepCell,
@@ -280,7 +281,7 @@ function(gettext, $, _, pgBrowser, Backform, Backgrid) {
           m instanceof Backbone.Model && m.isNew())
           return true;
         return false;
-      }
+      },
     },{
       id: 'values_in', label: gettext('In'), type:'text',
       cell:Backgrid.Extension.StringDepCell,
@@ -292,13 +293,14 @@ function(gettext, $, _, pgBrowser, Backform, Backgrid) {
           m instanceof Backbone.Model && m.isNew())
           return true;
         return false;
-      }
+      },
     }],
-    validate: function(keys) {
+    validate: function() {
       var partition_name = this.get('partition_name'),
-         values_from = this.get('values_from'),
-         values_to = this.get('values_to'),
-         values_in = this.get('values_in');
+        values_from = this.get('values_from'),
+        values_to = this.get('values_to'),
+        values_in = this.get('values_in'),
+        msg;
 
       // Have to clear existing validation before initiating current state
       // validation only
@@ -306,34 +308,34 @@ function(gettext, $, _, pgBrowser, Backform, Backgrid) {
 
       if (_.isUndefined(partition_name) || _.isNull(partition_name) ||
        String(partition_name).replace(/^\s+|\s+$/g, '') == '') {
-       var msg = gettext('Partition name cannot be empty.');
-       this.errorModel.set('partition_name', msg);
-       return msg;
+        msg = gettext('Partition name cannot be empty.');
+        this.errorModel.set('partition_name', msg);
+        return msg;
       }
 
       if (this.top.get('partition_type') == 'range') {
         if (_.isUndefined(values_from) || _.isNull(values_from) ||
           String(values_from).replace(/^\s+|\s+$/g, '') == '') {
-          var msg = gettext('For range partition From field cannot be empty.');
+          msg = gettext('For range partition From field cannot be empty.');
           this.errorModel.set('values_from', msg);
           return msg;
         } else if (_.isUndefined(values_to) || _.isNull(values_to) ||
           String(values_to).replace(/^\s+|\s+$/g, '') == '') {
-          var msg = gettext('For range partition To field cannot be empty.');
+          msg = gettext('For range partition To field cannot be empty.');
           this.errorModel.set('values_to', msg);
           return msg;
         }
       } else if (this.top.get('partition_type') == 'list') {
         if (_.isUndefined(values_in) || _.isNull(values_in) ||
           String(values_in).replace(/^\s+|\s+$/g, '') == '') {
-          var msg = gettext('For list partition In field cannot be empty.');
+          msg = gettext('For list partition In field cannot be empty.');
           this.errorModel.set('values_in', msg);
           return msg;
         }
       }
 
       return null;
-    }
+    },
   });
 
 });
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js
index 78ab8f3b..2eb7f59f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js
@@ -1,13 +1,15 @@
 define('pgadmin.node.table', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
+  'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
+  'pgadmin.alertifyjs', 'pgadmin.backform', 'pgadmin.backgrid',
   'pgadmin.browser.collection', 'pgadmin.node.column',
-  'pgadmin.node.constraints', 'pgadmin.browser.table.partition.utils'
+  'pgadmin.node.constraints', 'pgadmin.browser.table.partition.utils',
 ], function(
-  gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify, Backform, Backgrid
+) {
 
   if (!pgBrowser.Nodes['coll-table']) {
-    var databases = pgBrowser.Nodes['coll-table'] =
+    pgBrowser.Nodes['coll-table'] =
       pgBrowser.Collection.extend({
         node: 'table',
         label: gettext('Tables'),
@@ -15,10 +17,10 @@ define('pgadmin.node.table', [
         columns: ['name', 'relowner', 'is_partitioned', 'description'],
         hasStatistics: true,
         statsPrettifyFields: ['Size', 'Indexes size', 'Table size',
-                              'Toast table size', 'Tuple length',
-                              'Dead tuple length', 'Free space']
+          'Toast table size', 'Tuple length',
+          'Dead tuple length', 'Free space'],
       });
-  };
+  }
 
   if (!pgBrowser.Nodes['table']) {
     pgBrowser.Nodes['table'] = pgBrowser.Node.extend({
@@ -30,8 +32,8 @@ define('pgadmin.node.table', [
       hasDepends: true,
       hasStatistics: true,
       statsPrettifyFields: ['Size', 'Indexes size', 'Table size',
-                            'Toast table size', 'Tuple length',
-                            'Dead tuple length', 'Free space'],
+        'Toast table size', 'Tuple length',
+        'Dead tuple length', 'Free space'],
       sqlAlterHelp: 'sql-altertable.html',
       sqlCreateHelp: 'sql-createtable.html',
       dialogHelp: url_for('help.static', {'filename': 'table_dialog.html'}),
@@ -42,7 +44,7 @@ define('pgadmin.node.table', [
       Init: function() {
         /* Avoid multiple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -51,51 +53,51 @@ define('pgadmin.node.table', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 1, label: gettext('Table...'),
           icon: 'wcTabIcon icon-table', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_table', node: 'table', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 1, label: gettext('Table...'),
           icon: 'wcTabIcon icon-table', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_table__on_schema', node: 'schema', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Table...'),
           icon: 'wcTabIcon icon-table', data: {action: 'create', check: false},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'truncate_table', node: 'table', module: this,
           applies: ['object', 'context'], callback: 'truncate_table',
           category: 'Truncate', priority: 3, label: gettext('Truncate'),
-          icon: 'fa fa-eraser', enable : 'canCreate'
+          icon: 'fa fa-eraser', enable : 'canCreate',
         },{
           name: 'truncate_table_cascade', node: 'table', module: this,
           applies: ['object', 'context'], callback: 'truncate_table_cascade',
           category: 'Truncate', priority: 3, label: gettext('Truncate Cascade'),
-          icon: 'fa fa-eraser', enable : 'canCreate'
+          icon: 'fa fa-eraser', enable : 'canCreate',
         },{
           // To enable/disable all triggers for the table
           name: 'enable_all_triggers', node: 'table', module: this,
           applies: ['object', 'context'], callback: 'enable_triggers_on_table',
           category: 'Trigger(s)', priority: 4, label: gettext('Enable All'),
-          icon: 'fa fa-check', enable : 'canCreate_with_trigger_enable'
+          icon: 'fa fa-check', enable : 'canCreate_with_trigger_enable',
         },{
           name: 'disable_all_triggers', node: 'table', module: this,
           applies: ['object', 'context'], callback: 'disable_triggers_on_table',
           category: 'Trigger(s)', priority: 4, label: gettext('Disable All'),
-          icon: 'fa fa-times', enable : 'canCreate_with_trigger_disable'
+          icon: 'fa fa-times', enable : 'canCreate_with_trigger_disable',
         },{
           name: 'reset_table_stats', node: 'table', module: this,
           applies: ['object', 'context'], callback: 'reset_table_stats',
           category: 'Reset', priority: 4, label: gettext('Reset Statistics'),
-          icon: 'fa fa-bar-chart', enable : 'canCreate'
+          icon: 'fa fa-bar-chart', enable : 'canCreate',
         },{
           name: 'count_table_rows', node: 'table', module: this,
           applies: ['object', 'context'], callback: 'count_table_rows',
           category: 'Count', priority: 2, label: gettext('Count Rows'),
-          enable: true
-        }
+          enable: true,
+        },
         ]);
         pgBrowser.Events.on(
           'pgadmin:browser:node:table:updated', this.onTableUpdated, this
@@ -114,22 +116,22 @@ define('pgadmin.node.table', [
       callbacks: {
         /* Enable trigger(s) on table */
         enable_triggers_on_table: function(args) {
-            var params = {'enable': true };
-            this.callbacks.set_triggers.apply(this, [args, params]);
+          var params = {'enable': true };
+          this.callbacks.set_triggers.apply(this, [args, params]);
         },
         /* Disable trigger(s) on table */
         disable_triggers_on_table: function(args) {
-            var params = {'enable': false };
-            this.callbacks.set_triggers.apply(this, [args, params]);
+          var params = {'enable': false };
+          this.callbacks.set_triggers.apply(this, [args, params]);
         },
         set_triggers: function(args, params) {
           // This function will send request to enable or
           // disable triggers on table level
           var input = args || {},
-          obj = this,
-          t = pgBrowser.tree,
-          i = input.item || t.selected(),
-          d = i && i.length == 1 ? t.itemData(i) : undefined;
+            obj = this,
+            t = pgBrowser.tree,
+            i = input.item || t.selected(),
+            d = i && i.length == 1 ? t.itemData(i) : undefined;
           if (!d)
             return false;
 
@@ -137,10 +139,10 @@ define('pgadmin.node.table', [
             url: obj.generate_url(i, 'set_trigger' , d, true),
             type:'PUT',
             data: params,
-            dataType: "json",
+            dataType: 'json',
             success: function(res) {
               if (res.success == 1) {
-                alertify.success(res.info);
+                Alertify.success(res.info);
                 t.unload(i);
                 t.setInode(i);
                 t.deselect(i);
@@ -149,76 +151,80 @@ define('pgadmin.node.table', [
                 }, 10);
               }
             },
-            error: function(xhr, status, error) {
+            error: function(xhr) {
               try {
                 var err = $.parseJSON(xhr.responseText);
                 if (err.success == 0) {
-                  alertify.error(err.errormsg);
+                  Alertify.error(err.errormsg);
                 }
-              } catch (e) {}
+              } catch (e) {
+                console.warn(e.stack || e);
+              }
               t.unload(i);
-            }
+            },
           });
         },
         /* Truncate table */
         truncate_table: function(args) {
-            var params = {'cascade': false };
-            this.callbacks.truncate.apply(this, [args, params]);
+          var params = {'cascade': false };
+          this.callbacks.truncate.apply(this, [args, params]);
         },
         /* Truncate table with cascade */
         truncate_table_cascade: function(args) {
-            var params = {'cascade': true };
-            this.callbacks.truncate.apply(this, [args, params]);
+          var params = {'cascade': true };
+          this.callbacks.truncate.apply(this, [args, params]);
         },
         truncate: function(args, params) {
           var input = args || {},
-          obj = this,
-          t = pgBrowser.tree,
-          i = input.item || t.selected(),
-          d = i && i.length == 1 ? t.itemData(i) : undefined;
+            obj = this,
+            t = pgBrowser.tree,
+            i = input.item || t.selected(),
+            d = i && i.length == 1 ? t.itemData(i) : undefined;
 
           if (!d)
             return false;
 
-          alertify.confirm(
+          Alertify.confirm(
             gettext('Truncate Table'),
             S(gettext('Are you sure you want to truncate table %s?')).sprintf(d.label).value(),
             function (e) {
-            if (e) {
-              var data = d;
-              $.ajax({
-                url: obj.generate_url(i, 'truncate' , d, true),
-                type:'PUT',
-                data: params,
-                dataType: "json",
-                success: function(res) {
-                  if (res.success == 1) {
-                    alertify.success(res.info);
-                    t.removeIcon(i);
-                    data.icon = data.is_partitioned ? 'icon-partition': 'icon-table';
-                    t.addIcon(i, {icon: data.icon});
-                    t.unload(i);
-                    t.setInode(i);
-                    t.deselect(i);
-                    // Fetch updated data from server
-                    setTimeout(function() {
-                      t.select(i);
-                    }, 10);
-                  }
-                },
-                error: function(xhr, status, error) {
-                  try {
-                    var err = $.parseJSON(xhr.responseText);
-                    if (err.success == 0) {
-                      alertify.error(err.errormsg);
+              if (e) {
+                var data = d;
+                $.ajax({
+                  url: obj.generate_url(i, 'truncate' , d, true),
+                  type:'PUT',
+                  data: params,
+                  dataType: 'json',
+                  success: function(res) {
+                    if (res.success == 1) {
+                      Alertify.success(res.info);
+                      t.removeIcon(i);
+                      data.icon = data.is_partitioned ? 'icon-partition': 'icon-table';
+                      t.addIcon(i, {icon: data.icon});
+                      t.unload(i);
+                      t.setInode(i);
+                      t.deselect(i);
+                      // Fetch updated data from server
+                      setTimeout(function() {
+                        t.select(i);
+                      }, 10);
                     }
-                  } catch (e) {}
-                  t.unload(i);
-                }
-              });
-            }
-          }, function() {}
-        );
+                  },
+                  error: function(xhr) {
+                    try {
+                      var err = $.parseJSON(xhr.responseText);
+                      if (err.success == 0) {
+                        Alertify.error(err.errormsg);
+                      }
+                    } catch (e) {
+                      console.warn(e.stack || e);
+                    }
+                    t.unload(i);
+                  },
+                });
+              }
+            }, function() {}
+          );
         },
         reset_table_stats: function(args) {
           var input = args || {},
@@ -230,7 +236,7 @@ define('pgadmin.node.table', [
           if (!d)
             return false;
 
-          alertify.confirm(
+          Alertify.confirm(
             gettext('Reset statistics'),
             S(gettext('Are you sure you want to reset the statistics for table "%s"?')).sprintf(d._label).value(),
             function (e) {
@@ -241,7 +247,7 @@ define('pgadmin.node.table', [
                   type:'DELETE',
                   success: function(res) {
                     if (res.success == 1) {
-                      alertify.success(res.info);
+                      Alertify.success(res.info);
                       t.removeIcon(i);
                       data.icon = data.is_partitioned ? 'icon-partition': 'icon-table';
                       t.addIcon(i, {icon: data.icon});
@@ -254,15 +260,17 @@ define('pgadmin.node.table', [
                       }, 10);
                     }
                   },
-                  error: function(xhr, status, error) {
+                  error: function(xhr) {
                     try {
                       var err = $.parseJSON(xhr.responseText);
                       if (err.success == 0) {
-                        alertify.error(err.errormsg);
+                        Alertify.error(err.errormsg);
                       }
-                    } catch (e) {}
+                    } catch (e) {
+                      console.warn(e.stack || e);
+                    }
                     t.unload(i);
-                  }
+                  },
                 });
               }
             },
@@ -271,10 +279,10 @@ define('pgadmin.node.table', [
         },
         count_table_rows: function(args) {
           var input = args || {},
-          obj = this,
-          t = pgBrowser.tree,
-          i = input.item || t.selected(),
-          d = i && i.length == 1 ? t.itemData(i) : undefined;
+            obj = this,
+            t = pgBrowser.tree,
+            i = input.item || t.selected(),
+            d = i && i.length == 1 ? t.itemData(i) : undefined;
           if (!d)
             return false;
 
@@ -283,26 +291,28 @@ define('pgadmin.node.table', [
             url: obj.generate_url(i, 'count_rows' , d, true),
             type:'GET',
             success: function(res) {
-                alertify.success(res.info);
-                d.rows_cnt = res.data.total_rows;
-                t.unload(i);
-                t.setInode(i);
-                t.deselect(i);
-                setTimeout(function() {
-                  t.select(i);
-                }, 10);
+              Alertify.success(res.info);
+              d.rows_cnt = res.data.total_rows;
+              t.unload(i);
+              t.setInode(i);
+              t.deselect(i);
+              setTimeout(function() {
+                t.select(i);
+              }, 10);
             },
-            error: function(xhr, status, error) {
+            error: function(xhr) {
               try {
                 var err = $.parseJSON(xhr.responseText);
                 if (err.success == 0) {
-                  alertify.error(err.errormsg);
+                  Alertify.error(err.errormsg);
                 }
-              } catch (e) {}
+              } catch (e) {
+                console.warn(e.stack || e);
+              }
               t.unload(i);
-            }
+            },
           });
-        }
+        },
       },
       model: pgBrowser.Node.Model.extend({
         defaults: {
@@ -334,18 +344,18 @@ define('pgadmin.node.table', [
           primary_key: [],
           partitions: [],
           partition_type: 'range',
-          is_partitioned: false
+          is_partitioned: false,
         },
         // Default values!
         initialize: function(attrs, args) {
-          var self = this;
-
           if (_.size(attrs) === 0) {
-            var userInfo = pgBrowser.serverInfo[args.node_info.server._id].user,
-                schemaInfo = args.node_info.schema;
+            var userInfo = pgBrowser.serverInfo[
+              args.node_info.server._id
+            ].user,
+              schemaInfo = args.node_info.schema;
 
             this.set({
-              'relowner': userInfo.name, 'schema': schemaInfo._label
+              'relowner': userInfo.name, 'schema': schemaInfo._label,
             }, {silent: true});
           }
           pgBrowser.Node.Model.prototype.initialize.apply(this, arguments);
@@ -353,13 +363,13 @@ define('pgadmin.node.table', [
         },
         schema: [{
           id: 'name', label: gettext('Name'), type: 'text',
-          mode: ['properties', 'create', 'edit'], disabled: 'inSchema'
+          mode: ['properties', 'create', 'edit'], disabled: 'inSchema',
         },{
-          id: 'oid', label: gettext('OID'), type: 'text', mode: ['properties']
+          id: 'oid', label: gettext('OID'), type: 'text', mode: ['properties'],
         },{
           id: 'relowner', label: gettext('Owner'), type: 'text', node: 'role',
           mode: ['properties', 'create', 'edit'], select2: {allowClear: false},
-          disabled: 'inSchema', control: 'node-list-by-name'
+          disabled: 'inSchema', control: 'node-list-by-name',
         },{
           id: 'schema', label: gettext('Schema'), type: 'text', node: 'schema',
           control: 'node-list-by-name', mode: ['create', 'edit'],
@@ -370,15 +380,15 @@ define('pgadmin.node.table', [
               return false;
             }
             return true;
-          }, cache_node: 'database', cache_level: 'database'
+          }, cache_node: 'database', cache_level: 'database',
         },{
           id: 'spcname', label: gettext('Tablespace'), node: 'tablespace',
           type: 'text', control: 'node-list-by-name', disabled: 'inSchema',
           mode: ['properties', 'create', 'edit'],
           filter: function(d) {
             // If tablespace name is not "pg_global" then we need to exclude them
-            return (!(d && d.label.match(/pg_global/)))
-          }
+            return (!(d && d.label.match(/pg_global/)));
+          },
         },{
           id: 'partition', type: 'group', label: gettext('Partition'),
           mode: ['edit', 'create'], min_version: 100000,
@@ -387,14 +397,14 @@ define('pgadmin.node.table', [
             if (m.isNew() || m.get('is_partitioned'))
               return true;
             return false;
-          }
+          },
         },{
           id: 'is_partitioned', label:gettext('Partitioned Table?'), cell: 'switch',
           type: 'switch', mode: ['properties', 'create', 'edit'],
           visible: function(m) {
             if(!_.isUndefined(m.node_info) && !_.isUndefined(m.node_info.server)
               && !_.isUndefined(m.node_info.server.version) &&
-              m.node_info.server.version >= 100000)
+                m.node_info.server.version >= 100000)
               return true;
 
             return false;
@@ -403,31 +413,31 @@ define('pgadmin.node.table', [
             if (!m.isNew())
               return true;
             return false;
-          }
+          },
         },{
           id: 'description', label: gettext('Comment'), type: 'multiline',
-          mode: ['properties', 'create', 'edit'], disabled: 'inSchema'
+          mode: ['properties', 'create', 'edit'], disabled: 'inSchema',
         },{
           id: 'coll_inherits', label: gettext('Inherited from table(s)'),
           url: 'get_inherits', type: 'array', group: gettext('Columns'),
           disabled: 'checkInheritance', deps: ['typname', 'is_partitioned'],
           mode: ['create', 'edit'],
           select2: { multiple: true, allowClear: true,
-          placeholder: gettext('Select to inherit from...')},
+            placeholder: gettext('Select to inherit from...')},
           transform: function(data, cell) {
             var control = cell || this,
               m = control.model;
-              m.inherited_tables_list = data;
-              return data;
+            m.inherited_tables_list = data;
+            return data;
           },
           control: Backform.MultiSelectAjaxControl.extend({
             // When changes we need to add/clear columns collection
             onChange: function() {
               Backform.MultiSelectAjaxControl.prototype.onChange.apply(this, arguments);
               var self = this,
-              // current table list and previous table list
-              cTbl_list = self.model.get('coll_inherits') || [],
-              pTbl_list = self.model.previous('coll_inherits') || [];
+                // current table list and previous table list
+                cTbl_list = self.model.get('coll_inherits') || [],
+                pTbl_list = self.model.previous('coll_inherits') || [];
 
               if (!_.isUndefined(cTbl_list)) {
                 var tbl_name = undefined,
@@ -463,13 +473,11 @@ define('pgadmin.node.table', [
               // Create copy of old model if anything goes wrong at-least we have backup
               // Then send AJAX request to fetch table specific columns
               var self = this,
-                url = 'get_columns',
                 m = self.model.top || self.model,
                 data = undefined,
-                old_columns = _.clone(m.get('columns')),
                 column_collection = m.get('columns');
 
-              var arg = {'tid': tid}
+              var arg = {'tid': tid};
               data = self.model.fetch_columns_ajax.apply(self, [arg]);
 
               // Update existing column collection
@@ -486,20 +494,20 @@ define('pgadmin.node.table', [
               var tbl_oid = undefined;
               // iterate over list to find table oid
               _.each(this.model.inherited_tables_list, function(obj) {
-                  if(obj.label === tblname) {
-                    tbl_oid = obj.tid;
-                  }
+                if(obj.label === tblname) {
+                  tbl_oid = obj.tid;
+                }
               });
               return tbl_oid;
-            }
-          })
+            },
+          }),
         },{
           id: 'coll_inherits', label: gettext('Inherited from table(s)'),
-          type: 'text', group: gettext('Advanced'), mode: ['properties']
+          type: 'text', group: gettext('Advanced'), mode: ['properties'],
         },{
           id: 'inherited_tables_cnt', label: gettext('Inherited tables count'),
           type: 'text', mode: ['properties'], group: gettext('Advanced'),
-          disabled: 'inSchema'
+          disabled: 'inSchema',
         },{
           // Tab control for columns
           id: 'columns', label: gettext('Columns'), type: 'collection',
@@ -538,20 +546,20 @@ define('pgadmin.node.table', [
             initialize: function() {
               Backform.UniqueColCollectionControl.prototype.initialize.apply(this, arguments);
               var self = this,
-                  collection = self.model.get(self.field.get('name'));
+                collection = self.model.get(self.field.get('name'));
 
-              collection.on("change:is_primary_key", function(m) {
+              collection.on('change:is_primary_key', function(m) {
                 var primary_key_coll = self.model.get('primary_key'),
-                    column_name = m.get('name'),
-                    primary_key;
+                  column_name = m.get('name'),
+                  primary_key, primary_key_column_coll;
 
                 if(m.get('is_primary_key')) {
-                // Add column to primary key.
+                  // Add column to primary key.
                   if (primary_key_coll.length < 1) {
                     primary_key = new (primary_key_coll.model)({}, {
                       top: self.model,
                       collection: primary_key_coll,
-                      handler: primary_key_coll
+                      handler: primary_key_coll,
                     });
                     primary_key_coll.add(primary_key);
                   } else {
@@ -559,189 +567,185 @@ define('pgadmin.node.table', [
                   }
                   // Do not alter existing primary key columns.
                   if (_.isUndefined(primary_key.get('oid'))) {
-                    var primary_key_column_coll = primary_key.get('columns'),
-                      primary_key_column_exist = primary_key_column_coll.where({column:column_name});
+                    primary_key_column_coll = primary_key.get('columns');
+                    var primary_key_column_exist = primary_key_column_coll.where({column:column_name});
 
                     if (primary_key_column_exist.length == 0) {
-                      var primary_key_column = new (primary_key_column_coll.model)(
-                          {column: column_name}, { silent: true,
-                          top: self.model,
-                          collection: primary_key_coll,
-                          handler: primary_key_coll
-                        });
+                      var primary_key_column = new (
+                        primary_key_column_coll.model
+                      )({column: column_name}, {
+                        silent: true,
+                        top: self.model,
+                        collection: primary_key_coll,
+                        handler: primary_key_coll,
+                      });
 
                       primary_key_column_coll.add(primary_key_column);
                     }
 
-                    primary_key_column_coll.trigger('pgadmin:multicolumn:updated', primary_key_column_coll);
+                    primary_key_column_coll.trigger(
+                      'pgadmin:multicolumn:updated', primary_key_column_coll
+                    );
                   }
 
                 } else {
-                // remove column from primary key.
+                  // remove column from primary key.
                   if (primary_key_coll.length > 0) {
-                    var primary_key = primary_key_coll.first();
+                    primary_key = primary_key_coll.first();
                     // Do not alter existing primary key columns.
                     if (!_.isUndefined(primary_key.get('oid'))) {
                       return;
                     }
 
-                    var  primary_key_column_coll = primary_key.get('columns'),
-                        removedCols = primary_key_column_coll.where({column:column_name});
+                    primary_key_column_coll = primary_key.get('columns');
+                    var removedCols = primary_key_column_coll.where({column:column_name});
                     if (removedCols.length > 0) {
                       primary_key_column_coll.remove(removedCols);
                       _.each(removedCols, function(m) {
                         m.destroy();
-                      })
+                      });
                       if (primary_key_column_coll.length == 0) {
-                          /* Ideally above line of code should be "primary_key_coll.reset()".
-                           * But our custom DataCollection (extended from Backbone collection in datamodel.js)
-                           * does not respond to reset event, it only supports add, remove, change events.
-                           * And hence no custom event listeners/validators get called for reset event.
-                           */
-                          primary_key_coll.remove(primary_key_coll.first());
+                        /* Ideally above line of code should be "primary_key_coll.reset()".
+                         * But our custom DataCollection (extended from Backbone collection in datamodel.js)
+                         * does not respond to reset event, it only supports add, remove, change events.
+                         * And hence no custom event listeners/validators get called for reset event.
+                         */
+                        primary_key_coll.remove(primary_key_coll.first());
                       }
                     }
                     primary_key_column_coll.trigger('pgadmin:multicolumn:updated', primary_key_column_coll);
                   }
                 }
-              })
+              });
             },
             remove: function() {
               var collection = this.model.get(this.field.get('name'));
               if (collection) {
-                collection.off("change:is_primary_key");
+                collection.off('change:is_primary_key');
               }
 
               Backform.UniqueColCollectionControl.prototype.remove.apply(this, arguments);
-            }
+            },
           }),
-          allowMultipleEmptyRow: false
+          allowMultipleEmptyRow: false,
         },{
           // Here we will create tab control for constraints
           type: 'nested', control: 'tab', group: gettext('Constraints'),
           mode: ['edit', 'create'],
           schema: [{
-              id: 'primary_key', label: gettext('Primary key'),
-              model: pgBrowser.Nodes['primary_key'].model,
-              subnode: pgBrowser.Nodes['primary_key'].model,
-              editable: false, type: 'collection',
-              group: gettext('Primary Key'), mode: ['edit', 'create'],
-              canEdit: true, canDelete: true, deps:['is_partitioned'],
-              control: 'unique-col-collection',
-              columns : ['name', 'columns'],
-              canAdd: function(m) {
-                if (m.get('is_partitioned')) {
-                  setTimeout(function() {
-                    var coll = m.get('primary_key');
-                    coll.remove(coll.filter(function(model) {
-                      return true;
-                    }));
-                  }, 10);
-                  return false;
-                }
+            id: 'primary_key', label: gettext('Primary key'),
+            model: pgBrowser.Nodes['primary_key'].model,
+            subnode: pgBrowser.Nodes['primary_key'].model,
+            editable: false, type: 'collection',
+            group: gettext('Primary Key'), mode: ['edit', 'create'],
+            canEdit: true, canDelete: true, deps:['is_partitioned'],
+            control: 'unique-col-collection',
+            columns : ['name', 'columns'],
+            canAdd: function(m) {
+              if (m.get('is_partitioned')) {
+                setTimeout(function() {
+                  var coll = m.get('primary_key');
+                  coll.remove(coll.filter(function() { return true; }));
+                }, 10);
+                return false;
+              }
 
-                return true;
-              },
-              canAddRow: function(m) {
-               // User can only add one primary key
-               var columns = m.get('columns');
+              return true;
+            },
+            canAddRow: function(m) {
+              // User can only add one primary key
+              var columns = m.get('columns');
 
-               return (m.get('primary_key') &&
-                        m.get('primary_key').length < 1 &&
-                        _.some(columns.pluck('name')));
+              return (m.get('primary_key') &&
+                m.get('primary_key').length < 1 &&
+                  _.some(columns.pluck('name')));
+            },
+          },{
+            id: 'foreign_key', label: gettext('Foreign key'),
+            model: pgBrowser.Nodes['foreign_key'].model,
+            subnode: pgBrowser.Nodes['foreign_key'].model,
+            editable: false, type: 'collection',
+            group: gettext('Foreign Key'), mode: ['edit', 'create'],
+            canEdit: true, canDelete: true, deps:['is_partitioned'],
+            control: 'unique-col-collection',
+            canAdd: function(m) {
+              if (m.get('is_partitioned')) {
+                setTimeout(function() {
+                  var coll = m.get('foreign_key');
+                  coll.remove(coll.filter(function() { return true; }));
+                }, 10);
+                return false;
               }
-            },{
-              id: 'foreign_key', label: gettext('Foreign key'),
-              model: pgBrowser.Nodes['foreign_key'].model,
-              subnode: pgBrowser.Nodes['foreign_key'].model,
-              editable: false, type: 'collection',
-              group: gettext('Foreign Key'), mode: ['edit', 'create'],
-              canEdit: true, canDelete: true, deps:['is_partitioned'],
-              control: 'unique-col-collection',
-              canAdd: function(m) {
-                if (m.get('is_partitioned')) {
-                  setTimeout(function() {
-                    var coll = m.get('foreign_key');
-                    coll.remove(coll.filter(function(model) {
-                      return true;
-                    }));
-                  }, 10);
-                  return false;
-                }
 
-                return true;
-              },
-              columns : ['name', 'columns'],
-              canAddRow: function(m) {
-               // User can only add if there is at least one column with name.
-               var columns = m.get('columns');
-               return _.some(columns.pluck('name'));
+              return true;
+            },
+            columns : ['name', 'columns'],
+            canAddRow: function(m) {
+              // User can only add if there is at least one column with name.
+              var columns = m.get('columns');
+              return _.some(columns.pluck('name'));
+            },
+          },{
+            id: 'check_constraint', label: gettext('Check constraint'),
+            model: pgBrowser.Nodes['check_constraint'].model,
+            subnode: pgBrowser.Nodes['check_constraint'].model,
+            editable: false, type: 'collection',
+            group: gettext('Check'), mode: ['edit', 'create'],
+            canEdit: true, canDelete: true, deps:['is_partitioned'],
+            control: 'unique-col-collection',
+            canAdd: true,
+            columns : ['name', 'consrc'],
+          },{
+            id: 'unique_constraint', label: gettext('Unique Constraint'),
+            model: pgBrowser.Nodes['unique_constraint'].model,
+            subnode: pgBrowser.Nodes['unique_constraint'].model,
+            editable: false, type: 'collection',
+            group: gettext('Unique'), mode: ['edit', 'create'],
+            canEdit: true, canDelete: true, deps:['is_partitioned'],
+            control: 'unique-col-collection',
+            columns : ['name', 'columns'],
+            canAdd: function(m) {
+              if (m.get('is_partitioned')) {
+                setTimeout(function() {
+                  var coll = m.get('unique_constraint');
+                  coll.remove(coll.filter(function() { return true; }));
+                }, 10);
+                return false;
               }
-            },{
-              id: 'check_constraint', label: gettext('Check constraint'),
-              model: pgBrowser.Nodes['check_constraint'].model,
-              subnode: pgBrowser.Nodes['check_constraint'].model,
-              editable: false, type: 'collection',
-              group: gettext('Check'), mode: ['edit', 'create'],
-              canEdit: true, canDelete: true, deps:['is_partitioned'],
-              control: 'unique-col-collection',
-              canAdd: true,
-              columns : ['name', 'consrc']
-            },{
-              id: 'unique_constraint', label: gettext('Unique Constraint'),
-              model: pgBrowser.Nodes['unique_constraint'].model,
-              subnode: pgBrowser.Nodes['unique_constraint'].model,
-              editable: false, type: 'collection',
-              group: gettext('Unique'), mode: ['edit', 'create'],
-              canEdit: true, canDelete: true, deps:['is_partitioned'],
-              control: 'unique-col-collection',
-              columns : ['name', 'columns'],
-              canAdd: function(m) {
-                if (m.get('is_partitioned')) {
-                  setTimeout(function() {
-                    var coll = m.get('unique_constraint');
-                    coll.remove(coll.filter(function(model) {
-                      return true;
-                    }));
-                  }, 10);
-                  return false;
-                }
 
-                return true;
-              },
-              canAddRow: function(m) {
-               // User can only add if there is at least one column with name.
-               var columns = m.get('columns');
-               return _.some(columns.pluck('name'));
+              return true;
+            },
+            canAddRow: function(m) {
+              // User can only add if there is at least one column with name.
+              var columns = m.get('columns');
+              return _.some(columns.pluck('name'));
+            },
+          },{
+            id: 'exclude_constraint', label: gettext('Exclude constraint'),
+            model: pgBrowser.Nodes['exclusion_constraint'].model,
+            subnode: pgBrowser.Nodes['exclusion_constraint'].model,
+            editable: false, type: 'collection',
+            group: gettext('Exclude'), mode: ['edit', 'create'],
+            canEdit: true, canDelete: true, deps:['is_partitioned'],
+            control: 'unique-col-collection',
+            columns : ['name', 'columns', 'constraint'],
+            canAdd: function(m) {
+              if (m.get('is_partitioned')) {
+                setTimeout(function() {
+                  var coll = m.get('exclude_constraint');
+                  coll.remove(coll.filter(function() { return true; }));
+                }, 10);
+                return false;
               }
-            },{
-              id: 'exclude_constraint', label: gettext('Exclude constraint'),
-              model: pgBrowser.Nodes['exclusion_constraint'].model,
-              subnode: pgBrowser.Nodes['exclusion_constraint'].model,
-              editable: false, type: 'collection',
-              group: gettext('Exclude'), mode: ['edit', 'create'],
-              canEdit: true, canDelete: true, deps:['is_partitioned'],
-              control: 'unique-col-collection',
-              columns : ['name', 'columns', 'constraint'],
-              canAdd: function(m) {
-                if (m.get('is_partitioned')) {
-                  setTimeout(function() {
-                    var coll = m.get('exclude_constraint');
-                    coll.remove(coll.filter(function(model) {
-                      return true;
-                    }));
-                  }, 10);
-                  return false;
-                }
 
-                return true;
-              },
-              canAddRow: function(m) {
-               // User can only add if there is at least one column with name.
-               var columns = m.get('columns');
-               return _.some(columns.pluck('name'));
-              }
-          }]
+              return true;
+            },
+            canAddRow: function(m) {
+              // User can only add if there is at least one column with name.
+              var columns = m.get('columns');
+              return _.some(columns.pluck('name'));
+            },
+          }],
         },{
           id: 'typname', label: gettext('Of type'), type: 'text',
           mode: ['properties', 'create', 'edit'],
@@ -749,108 +753,103 @@ define('pgadmin.node.table', [
           deps: ['coll_inherits'], transform: function(data, cell) {
             var control = cell || this,
               m = control.model;
-              m.of_types_tables = data;
-              return data;
+            m.of_types_tables = data;
+            return data;
           },
           control: Backform.NodeAjaxOptionsControl.extend({
-              // When of_types changes we need to clear columns collection
-              onChange: function() {
-                Backform.NodeAjaxOptionsControl.prototype.onChange.apply(this, arguments);
-                var self = this,
-                  tbl_oid = undefined,
-                  tbl_name = self.model.get('typname'),
-                  data = undefined,
-                  arg = undefined,
-                  column_collection = self.model.get('columns');
-
-                if (!_.isUndefined(tbl_name) && !_.isNull(tbl_name) &&
-                    tbl_name !== '' && column_collection.length !== 0) {
-                  var title = gettext('Remove column definitions?'),
-                      msg = gettext('Changing \'Of type\' will remove column definitions.');
-
-                  alertify.confirm(title, msg, function (e) {
+            // When of_types changes we need to clear columns collection
+            onChange: function() {
+              Backform.NodeAjaxOptionsControl.prototype.onChange.apply(this, arguments);
+              var self = this,
+                tbl_name = self.model.get('typname'),
+                data = undefined,
+                arg = undefined,
+                column_collection = self.model.get('columns');
+
+              if (!_.isUndefined(tbl_name) && !_.isNull(tbl_name) &&
+                tbl_name !== '' && column_collection.length !== 0) {
+                var title = gettext('Remove column definitions?'),
+                  msg = gettext('Changing \'Of type\' will remove column definitions.');
+
+                Alertify.confirm(
+                    title, msg, function () {
                       // User clicks Ok, lets clear columns collection
                       column_collection.remove(
-                        column_collection.filter(function(model) {
-                          return true;
-                          }
-                        )
+                        column_collection.filter(function() { return true; })
                       );
                     },
                     function() {
                       setTimeout(function() {
                         self.model.set('typname', null);
-                      }, 10)
+                      }, 10);
                     }
                   );
-                } else if (!_.isUndefined(tbl_name) && tbl_name === '') {
-                  column_collection.remove(
-                    column_collection.filter(function(model) {
-                      return true;
-                      }
-                    )
+              } else if (!_.isUndefined(tbl_name) && tbl_name === '') {
+                column_collection.remove(
+                    column_collection.filter(function() { return true; })
                   );
-                }
+              }
 
-                // Run Ajax now to fetch columns
-                if (!_.isUndefined(tbl_name) && tbl_name !== '') {
-                  arg = { 'tname': tbl_name }
-                  data = self.model.fetch_columns_ajax.apply(self, [arg]);
-                  // Add into column collection
-                  column_collection.set(data, { merge:false,remove:false });
-                }
+              // Run Ajax now to fetch columns
+              if (!_.isUndefined(tbl_name) && tbl_name !== '') {
+                arg = { 'tname': tbl_name };
+                data = self.model.fetch_columns_ajax.apply(self, [arg]);
+                // Add into column collection
+                column_collection.set(data, { merge:false,remove:false });
               }
-            })
+            },
+          }),
         },{
           id: 'fillfactor', label: gettext('Fill factor'), type: 'int',
           mode: ['create', 'edit'], min: 10, max: 100,
-          disabled: 'inSchema',group: gettext('Advanced')
+          disabled: 'inSchema',group: gettext('Advanced'),
         },{
           id: 'relhasoids', label: gettext('Has OIDs?'), cell: 'switch',
           type: 'switch', mode: ['properties', 'create', 'edit'],
-          disabled: 'inSchema', group: gettext('Advanced')
+          disabled: 'inSchema', group: gettext('Advanced'),
         },{
           id: 'relpersistence', label: gettext('Unlogged?'), cell: 'switch',
           type: 'switch', mode: ['properties', 'create', 'edit'],
           disabled: 'inSchemaWithModelCheck',
-          group: gettext('Advanced')
+          group: gettext('Advanced'),
         },{
           id: 'conname', label: gettext('Primary key'), cell: 'string',
           type: 'text', mode: ['properties'], group: gettext('Advanced'),
-          disabled: 'inSchema'
+          disabled: 'inSchema',
         },{
           id: 'reltuples', label: gettext('Rows (estimated)'), cell: 'string',
           type: 'text', mode: ['properties'], group: gettext('Advanced'),
-          disabled: 'inSchema'
+          disabled: 'inSchema',
         },{
           id: 'rows_cnt', label: gettext('Rows (counted)'), cell: 'string',
           type: 'text', mode: ['properties'], group: gettext('Advanced'),
           disabled: 'inSchema', control: Backform.InputControl.extend({
             formatter: {
-               fromRaw: function (rawData, model) {
-                  var t = pgAdmin.Browser.tree,
+              fromRaw: function (rawData) {
+                var t = pgAdmin.Browser.tree,
                   i = t.selected(),
                   d = i && i.length == 1 ? t.itemData(i) : undefined;
 
-                  // Return the actual rows count if the selected node has already counted.
-                  if(d && d.rows_cnt && parseInt(d.rows_cnt, 10) > 0)
-                    return d.rows_cnt;
-                  else
-                    return rawData;
-               },
-               toRaw: function (formattedData, model) {
-                  return formattedData;
-               }
-            }
-          })
+                // Return the actual rows count if the selected node
+                // has already counted.
+                if(d && d.rows_cnt && parseInt(d.rows_cnt, 10) > 0)
+                  return d.rows_cnt;
+                else
+                  return rawData;
+              },
+              toRaw: function (formattedData) {
+                return formattedData;
+              },
+            },
+          }),
         },{
           id: 'relhassubclass', label: gettext('Inherits tables?'), cell: 'switch',
           type: 'switch', mode: ['properties'], group: gettext('Advanced'),
-          disabled: 'inSchema'
+          disabled: 'inSchema',
         },{
           id: 'is_sys_table', label: gettext('System table?'), cell: 'switch',
           type: 'switch', mode: ['properties'],
-          disabled: 'inSchema'
+          disabled: 'inSchema',
         },{
           type: 'nested', control: 'fieldset', label: gettext('Like'),
           group: gettext('Advanced'),
@@ -858,42 +857,42 @@ define('pgadmin.node.table', [
             id: 'like_relation', label: gettext('Relation'),
             type: 'text', mode: ['create', 'edit'], deps: ['typname'],
             control: 'node-ajax-options', url: 'get_relations',
-            disabled: 'isLikeDisable', group: gettext('Like')
+            disabled: 'isLikeDisable', group: gettext('Like'),
           },{
             id: 'like_default_value', label: gettext('With default values?'),
             type: 'switch', mode: ['create', 'edit'], deps: ['typname'],
-            disabled: 'isLikeDisable', group: gettext('Like')
+            disabled: 'isLikeDisable', group: gettext('Like'),
           },{
             id: 'like_constraints', label: gettext('With constraints?'),
             type: 'switch', mode: ['create', 'edit'], deps: ['typname'],
-            disabled: 'isLikeDisable', group: gettext('Like')
+            disabled: 'isLikeDisable', group: gettext('Like'),
           },{
             id: 'like_indexes', label: gettext('With indexes?'),
             type: 'switch', mode: ['create', 'edit'], deps: ['typname'],
-            disabled: 'isLikeDisable', group: gettext('Like')
+            disabled: 'isLikeDisable', group: gettext('Like'),
           },{
             id: 'like_storage', label: gettext('With storage?'),
             type: 'switch', mode: ['create', 'edit'], deps: ['typname'],
-            disabled: 'isLikeDisable', group: gettext('Like')
+            disabled: 'isLikeDisable', group: gettext('Like'),
           },{
             id: 'like_comments', label: gettext('With comments?'),
             type: 'switch', mode: ['create', 'edit'], deps: ['typname'],
-            disabled: 'isLikeDisable', group: gettext('Like')
-          }]
+            disabled: 'isLikeDisable', group: gettext('Like'),
+          }],
         },{
           id: 'partition_type', label:gettext('Partition Type'),
           editable: false, type: 'select2', select2: {allowClear: false},
           group: 'partition', deps: ['is_partitioned'],
           options:[{
-            label: gettext('Range'), value: 'range'
+            label: gettext('Range'), value: 'range',
           },{
-            label: gettext('List'), value: 'list'
+            label: gettext('List'), value: 'list',
           }],
           mode:['create'],
           visible: function(m) {
             if(!_.isUndefined(m.node_info) && !_.isUndefined(m.node_info.server)
               && !_.isUndefined(m.node_info.server.version) &&
-              m.node_info.server.version >= 100000)
+                m.node_info.server.version >= 100000)
               return true;
 
             return false;
@@ -902,7 +901,7 @@ define('pgadmin.node.table', [
             if (!m.isNew() || !m.get('is_partitioned'))
               return true;
             return false;
-          }
+          },
         },{
           id: 'partition_keys', label:gettext('Partition Keys'),
           model: Backform.PartitionKeyModel,
@@ -919,17 +918,17 @@ define('pgadmin.node.table', [
           },
           canAddRow: function(m) {
             var columns = m.get('columns'),
-                typename = m.get('typname'),
-                columns_exist= false;
+              typename = m.get('typname'),
+              columns_exist= false;
 
             var max_row_count = 1000;
             if (m.get('partition_type') && m.get('partition_type') == 'list')
               max_row_count = 1;
 
-            /* If columns are not specified by the user then it may be
-             * possible that he/she selected 'OF TYPE', so we should check
-             * for that as well.
-             */
+              /* If columns are not specified by the user then it may be
+               * possible that he/she selected 'OF TYPE', so we should check
+               * for that as well.
+               */
             if (columns.length <= 0 && !_.isUndefined(typename)
               && !_.isNull(typename) && m.of_types_tables.length > 0){
               _.each(m.of_types_tables, function(data) {
@@ -942,14 +941,14 @@ define('pgadmin.node.table', [
             }
 
             return (m.get('partition_keys') &&
-                m.get('partition_keys').length < max_row_count && columns_exist
+              m.get('partition_keys').length < max_row_count && columns_exist
             );
 
           },
           visible: function(m) {
             if(!_.isUndefined(m.node_info) && !_.isUndefined(m.node_info.server)
               && !_.isUndefined(m.node_info.server.version) &&
-              m.node_info.server.version >= 100000)
+                m.node_info.server.version >= 100000)
               return true;
 
             return false;
@@ -958,19 +957,18 @@ define('pgadmin.node.table', [
             if (m.get('partition_keys') && m.get('partition_keys').models.length > 0) {
               setTimeout(function () {
                 var coll = m.get('partition_keys');
-                coll.remove(coll.filter(function(model) {
-                  return true;
-                }));
+                coll.remove(coll.filter(function() { return true; }));
+
               }, 10);
             }
-          }
+          },
         },{
           id: 'partition_scheme', label: gettext('Partition Scheme'),
           type: 'note', group: 'partition', mode: ['edit'],
           visible: function(m) {
             if(!_.isUndefined(m.node_info) && !_.isUndefined(m.node_info.server)
               && !_.isUndefined(m.node_info.server.version) &&
-              m.node_info.server.version >= 100000)
+                m.node_info.server.version >= 100000)
               return true;
 
             return false;
@@ -979,7 +977,7 @@ define('pgadmin.node.table', [
             if (!m.isNew()) {
               this.text = m.get('partition_scheme');
             }
-          }
+          },
         },{
           id: 'partition_key_note', label: gettext('Partition Keys'),
           type: 'note', group: 'partition', mode: ['create'],
@@ -993,17 +991,17 @@ define('pgadmin.node.table', [
             '<br><p>',
             gettext('Example'),
             ':',
-            gettext("Let's say, we want to create a partition table based per year for the column 'saledate', having datatype 'date/timestamp', then we need to specify the expression as 'extract(YEAR from saledate)' as partition key."),
-            '</p></li></ul>'
+            gettext('Let\'s say, we want to create a partition table based per year for the column \'saledate\', having datatype \'date/timestamp\', then we need to specify the expression as \'extract(YEAR from saledate)\' as partition key.'),
+            '</p></li></ul>',
           ].join(''),
           visible: function(m) {
             if(!_.isUndefined(m.node_info) && !_.isUndefined(m.node_info.server)
               && !_.isUndefined(m.node_info.server.version) &&
-              m.node_info.server.version >= 100000)
+                m.node_info.server.version >= 100000)
               return true;
 
             return false;
-          }
+          },
         }, {
           id: 'partitions', label:gettext('Partitions'),
           model: Backform.PartitionsModel,
@@ -1022,15 +1020,15 @@ define('pgadmin.node.table', [
               var self = this;
               if (!this.model.isNew()) {
                 var node = this.field.get('schema_node'),
-                    node_info = this.field.get('node_info');
+                  node_info = this.field.get('node_info');
 
                 // Make ajax call to get the tables to be attached
                 $.ajax({
                   url: node.generate_url.apply(
-                      node, [
-                        null, 'get_attach_tables', this.field.get('node_data'),
-                        true, node_info
-                      ]),
+                    node, [
+                      null, 'get_attach_tables', this.field.get('node_data'),
+                      true, node_info,
+                    ]),
 
                   type: 'GET',
                   async: false,
@@ -1039,18 +1037,18 @@ define('pgadmin.node.table', [
                       self.model.table_options = res.data;
                     }
                     else {
-                      alertify.alert(
+                      Alertify.alert(
                         gettext('Error fetching tables to be attached'), res.data.result
                       );
                     }
                   },
                   error: function(e) {
                     var errmsg = $.parseJSON(e.responseText);
-                    alertify.alert(gettext('Error fetching tables to be attached'), errmsg.errormsg);
-                  }
+                    Alertify.alert(gettext('Error fetching tables to be attached'), errmsg.errormsg);
+                  },
                 });
               }
-            }
+            },
           }
           ),
           canAdd: function(m) {
@@ -1061,7 +1059,7 @@ define('pgadmin.node.table', [
           visible: function(m) {
             if(!_.isUndefined(m.node_info) && !_.isUndefined(m.node_info.server)
               && !_.isUndefined(m.node_info.server.version) &&
-              m.node_info.server.version >= 100000)
+                m.node_info.server.version >= 100000)
               return true;
 
             return false;
@@ -1070,12 +1068,10 @@ define('pgadmin.node.table', [
             if (m.isNew() && m.get('partitions') && m.get('partitions').models.length > 0) {
               setTimeout(function () {
                 var coll = m.get('partitions');
-                coll.remove(coll.filter(function(model) {
-                  return true;
-                }));
+                coll.remove(coll.filter(function() { return true; }));
               }, 10);
             }
-          }
+          },
         },{
           id: 'partition_note', label: gettext('Partitions'),
           type: 'note', group: 'partition',
@@ -1090,57 +1086,55 @@ define('pgadmin.node.table', [
             '<br>',
             gettext('Example'),
             ':<ul><li>',
-            gettext("From/To: Enabled for range partition. Consider partitioned table with multiple keys of type Integer, then values should be specified like '100','200'."),
+            gettext('From/To: Enabled for range partition. Consider partitioned table with multiple keys of type Integer, then values should be specified like \'100\',\'200\'.'),
             '</li><li> ',
             gettext('In: Enabled for list partition. Values must be comma(,) separated and quoted with single quote.'),
-            '</li></ul></li></ul>'
+            '</li></ul></li></ul>',
           ].join(''),
           visible: function(m) {
             if(!_.isUndefined(m.node_info) && !_.isUndefined(m.node_info.server)
               && !_.isUndefined(m.node_info.server.version) &&
-              m.node_info.server.version >= 100000)
+                m.node_info.server.version >= 100000)
               return true;
 
             return false;
-          }
+          },
         },{
           // Here - we will create tab control for storage parameters
           // (auto vacuum).
           type: 'nested', control: 'tab', group: gettext('Parameter'),
           mode: ['edit', 'create'], deps: ['is_partitioned'],
-          schema: Backform.VacuumSettingsSchema
+          schema: Backform.VacuumSettingsSchema,
         },{
           id: 'relacl_str', label: gettext('Privileges'), disabled: 'inSchema',
-          type: 'text', mode: ['properties'], group: gettext('Security')
+          type: 'text', mode: ['properties'], group: gettext('Security'),
         }, pgBrowser.SecurityGroupSchema,{
           id: 'relacl', label: gettext('Privileges'), type: 'collection',
           group: 'security', control: 'unique-col-collection',
           model: pgBrowser.Node.PrivilegeRoleModel.extend({
-          privileges: ['a','r','w','d','D','x','t']}),
+            privileges: ['a','r','w','d','D','x','t']}),
           mode: ['edit', 'create'], canAdd: true, canDelete: true,
-          uniqueCol : ['grantee']
+          uniqueCol : ['grantee'],
         },{
           id: 'seclabels', label: gettext('Security labels'), canEdit: false,
           model: pgBrowser.SecLabelModel, editable: false, canAdd: true,
           type: 'collection', min_version: 90100, mode: ['edit', 'create'],
-          group: 'security', canDelete: true, control: 'unique-col-collection'
+          group: 'security', canDelete: true, control: 'unique-col-collection',
         },{
           id: 'vacuum_settings_str', label: gettext('Storage settings'),
-          type: 'multiline', group: gettext('Advanced'), mode: ['properties']
+          type: 'multiline', group: gettext('Advanced'), mode: ['properties'],
         }],
-        validate: function(keys) {
-          var err = {},
-              changedAttrs = this.changed,
-              msg = undefined,
-              name = this.get('name'),
-              schema = this.get('schema'),
-              relowner = this.get('relowner'),
-              is_partitioned = this.get('is_partitioned'),
-              partition_keys = this.get('partition_keys');
+        validate: function() {
+          var msg,
+            name = this.get('name'),
+            schema = this.get('schema'),
+            relowner = this.get('relowner'),
+            is_partitioned = this.get('is_partitioned'),
+            partition_keys = this.get('partition_keys');
 
           if (
             _.isUndefined(name) || _.isNull(name) ||
-            String(name).replace(/^\s+|\s+$/g, '') == ''
+              String(name).replace(/^\s+|\s+$/g, '') == ''
           ) {
             msg = gettext('Table name cannot be empty.');
             this.errorModel.set('name', msg);
@@ -1149,7 +1143,7 @@ define('pgadmin.node.table', [
           this.errorModel.unset('name');
           if (
             _.isUndefined(schema) || _.isNull(schema) ||
-            String(schema).replace(/^\s+|\s+$/g, '') == ''
+              String(schema).replace(/^\s+|\s+$/g, '') == ''
           ) {
             msg = gettext('Table schema cannot be empty.');
             this.errorModel.set('schema', msg);
@@ -1158,7 +1152,7 @@ define('pgadmin.node.table', [
           this.errorModel.unset('schema');
           if (
             _.isUndefined(relowner) || _.isNull(relowner) ||
-            String(relowner).replace(/^\s+|\s+$/g, '') == ''
+              String(relowner).replace(/^\s+|\s+$/g, '') == ''
           ) {
             msg = gettext('Table owner cannot be empty.');
             this.errorModel.set('relowner', msg);
@@ -1167,7 +1161,7 @@ define('pgadmin.node.table', [
           this.errorModel.unset('relowner');
           if (
             is_partitioned && this.isNew() &&
-            !_.isNull(partition_keys) && partition_keys.length <= 0
+              !_.isNull(partition_keys) && partition_keys.length <= 0
           ) {
             msg = gettext('Please specify at least one key for partitioned table.');
             this.errorModel.set('partition_keys', msg);
@@ -1189,7 +1183,7 @@ define('pgadmin.node.table', [
             if(
               (!_.isUndefined(m.get('coll_inherits')) && m.get('coll_inherits').length != 0)
                 ||
-                  (!_.isUndefined(m.get('typname')) && String(m.get('typname')).replace(/^\s+|\s+$/g, '') !== '')
+                (!_.isUndefined(m.get('typname')) && String(m.get('typname')).replace(/^\s+|\s+$/g, '') !== '')
             ) {
               // Either of_types or coll_inherits has value
               return false;
@@ -1204,15 +1198,15 @@ define('pgadmin.node.table', [
           // Disabled if it is partitioned table
           if (m.get('is_partitioned')) {
             setTimeout( function() {
-               m.set('coll_inherits', []);
+              m.set('coll_inherits', []);
             }, 10);
             return true;
           }
 
           // coll_inherits || typname
           if(!m.inSchema.apply(this, [m]) &&
-              ( _.isUndefined(m.get('typname')) ||
-                _.isNull(m.get('typname')) ||
+            ( _.isUndefined(m.get('typname')) ||
+              _.isNull(m.get('typname')) ||
                 String(m.get('typname')).replace(/^\s+|\s+$/g, '') == '')) {
             return false;
           }
@@ -1221,8 +1215,8 @@ define('pgadmin.node.table', [
         // We will disable Like if ofType is defined
         isLikeDisable: function(m) {
           if(!m.inSchemaWithModelCheck.apply(this, [m]) &&
-              ( _.isUndefined(m.get('typname')) ||
-                _.isNull(m.get('typname')) ||
+            ( _.isUndefined(m.get('typname')) ||
+              _.isNull(m.get('typname')) ||
                 String(m.get('typname')).replace(/^\s+|\s+$/g, '') == '')) {
             return false;
           }
@@ -1234,10 +1228,10 @@ define('pgadmin.node.table', [
           if(!m.inSchema.apply(this, [m])) {
             // if of_type then disable add in grid
             if (!_.isUndefined(m.get('typname')) &&
-                !_.isNull(m.get('typname')) &&
+              !_.isNull(m.get('typname')) &&
                 m.get('typname') !== '') {
-                    enable_flag = false;
-                }
+              enable_flag = false;
+            }
           }
           return enable_flag;
         },
@@ -1245,8 +1239,8 @@ define('pgadmin.node.table', [
         check_grid_row_edit_delete: function(m) {
           var flag = true;
           if(!_.isUndefined(m.get('inheritedfrom')) &&
-               !_.isNull(m.get('inheritedfrom')) &&
-               String(m.get('inheritedfrom')).replace(/^\s+|\s+$/g, '') !== '') {
+            !_.isNull(m.get('inheritedfrom')) &&
+              String(m.get('inheritedfrom')).replace(/^\s+|\s+$/g, '') !== '') {
             flag = false;
           }
           return flag;
@@ -1255,9 +1249,9 @@ define('pgadmin.node.table', [
         checkOfType: function(m) {
           //coll_inherits || typname
           if(!m.inSchemaWithModelCheck.apply(this, [m]) &&
-              (_.isUndefined(m.get('coll_inherits')) ||
-               _.isNull(m.get('coll_inherits')) ||
-               String(m.get('coll_inherits')).replace(/^\s+|\s+$/g, '') == '')) {
+            (_.isUndefined(m.get('coll_inherits')) ||
+              _.isNull(m.get('coll_inherits')) ||
+                String(m.get('coll_inherits')).replace(/^\s+|\s+$/g, '') == '')) {
             return false;
           }
           return true;
@@ -1279,7 +1273,7 @@ define('pgadmin.node.table', [
           // We need to check additional condition to toggle enable/disable
           // for table auto-vacuum
           if(!m.inSchema.apply(this, [m]) &&
-              m.get('autovacuum_enabled') === true) {
+            m.get('autovacuum_enabled') === true) {
             return false;
           }
           return true;
@@ -1288,27 +1282,26 @@ define('pgadmin.node.table', [
           // We need to check additional condition to toggle enable/disable
           // for toast table auto-vacuum
           if(!m.inSchemaWithModelCheck.apply(this, [m]) &&
-              m.get('toast_autovacuum_enabled') == true) {
+            m.get('toast_autovacuum_enabled') == true) {
             return false;
           }
           return true;
         },
         fetch_columns_ajax: function(arg) {
           var self = this,
-              url = 'get_columns',
-              m = self.model.top || self.model,
-              old_columns = _.clone(m.get('columns')),
-              data = undefined,
-              node = this.field.get('schema_node'),
-              node_info = this.field.get('node_info'),
-              full_url = node.generate_url.apply(
-                node, [
-                  null, url, this.field.get('node_data'),
-                  this.field.get('url_with_id') || false, node_info
-                ]
-              ),
-              cache_level = this.field.get('cache_level') || node.type,
-              cache_node = this.field.get('cache_node');
+            url = 'get_columns',
+            m = self.model.top || self.model,
+            data = undefined,
+            node = this.field.get('schema_node'),
+            node_info = this.field.get('node_info'),
+            full_url = node.generate_url.apply(
+              node, [
+                null, url, this.field.get('node_data'),
+                this.field.get('url_with_id') || false, node_info,
+              ]
+            ),
+            cache_level = this.field.get('cache_level') || node.type,
+            cache_node = this.field.get('cache_node');
 
           cache_node = (cache_node && pgBrowser.Nodes[cache_node]) || node;
 
@@ -1323,40 +1316,40 @@ define('pgadmin.node.table', [
             },
             error: function() {
               m.trigger('pgadmin:view:fetch:error', m, self.field);
-            }
+            },
           });
           m.trigger('pgadmin:view:fetched', m, self.field);
           data = (data && data.data) || [];
           return data;
-        }
+        },
       }),
       canCreate: function(itemData, item, data) {
-          //If check is false then , we will allow create menu
-          if (data && data.check == false)
-            return true;
+        //If check is false then , we will allow create menu
+        if (data && data.check == false)
+          return true;
 
-          var t = pgBrowser.tree, i = item, d = itemData;
-          // To iterate over tree to check parent node
-          while (i) {
-            // If it is schema then allow user to create table
-            if (_.indexOf(['schema'], d._type) > -1)
-              return true;
+        var t = pgBrowser.tree, i = item, d = itemData;
+        // To iterate over tree to check parent node
+        while (i) {
+          // If it is schema then allow user to create table
+          if (_.indexOf(['schema'], d._type) > -1)
+            return true;
 
-            if ('coll-table' == d._type) {
-              //Check if we are not child of catalog
-              var prev_i = t.hasParent(i) ? t.parent(i) : null,
+          if ('coll-table' == d._type) {
+            //Check if we are not child of catalog
+            var prev_i = t.hasParent(i) ? t.parent(i) : null,
               prev_d = prev_i ? t.itemData(prev_i) : null;
-              if( prev_d._type == 'catalog') {
-                return false;
-              } else {
-                return true;
-              }
+            if( prev_d._type == 'catalog') {
+              return false;
+            } else {
+              return true;
             }
-            i = t.hasParent(i) ? t.parent(i) : null;
-            d = i ? t.itemData(i) : null;
           }
-          // by default we do not want to allow create menu
-          return true;
+          i = t.hasParent(i) ? t.parent(i) : null;
+          d = i ? t.itemData(i) : null;
+        }
+        // by default we do not want to allow create menu
+        return true;
       },
       // Check to whether table has disable trigger(s)
       canCreate_with_trigger_enable: function(itemData, item, data) {
@@ -1381,22 +1374,24 @@ define('pgadmin.node.table', [
         }
       },
       onTableUpdated: function(_node, _oldNodeData, _newNodeData) {
+        var key, childIDs;
         if (
-          _newNodeData.is_partitioned && 'affected_partitions' in _newNodeData
+          _newNodeData.is_partitioned &&
+            'affected_partitions' in _newNodeData
         ) {
           var partitions = _newNodeData.affected_partitions,
-              idx, node_info, self = this,
-              newPartitionsIDs = [],
-              insertChildTreeNodes = [],
-              insertChildrenNodes = function() {
-                if (!insertChildTreeNodes.length)
-                  return;
-                var option = insertChildTreeNodes.pop();
-                pgBrowser.addChildTreeNodes(
-                  option.treeHierarchy, option.parent, option.type,
-                  option.childrenIDs, insertChildrenNodes
-                );
-              };
+            self = this,
+            newPartitionsIDs = [],
+            insertChildTreeNodes = [],
+            insertChildrenNodes = function() {
+              if (!insertChildTreeNodes.length)
+                return;
+              var option = insertChildTreeNodes.pop();
+              pgBrowser.addChildTreeNodes(
+                option.treeHierarchy, option.parent, option.type,
+                option.childrenIDs, insertChildrenNodes
+              );
+            }, schemaNode ;
 
           if ('detached' in partitions && partitions.detached.length > 0) {
             // Remove it from the partition collections node first
@@ -1406,15 +1401,15 @@ define('pgadmin.node.table', [
               )
             );
 
-            var schemaNode = pgBrowser.findParentTreeNodeByType(
-                  _node, 'schema'
-                ),
-                detachedBySchema = _.groupBy(
-                  partitions.detached,
-                  function(_d) { return parseInt(_d.schema_id); }
-                ), childIDs;
+            schemaNode = pgBrowser.findParentTreeNodeByType(
+              _node, 'schema'
+            );
+            var detachedBySchema = _.groupBy(
+              partitions.detached,
+              function(_d) { return parseInt(_d.schema_id); }
+            );
 
-            for (var key in detachedBySchema) {
+            for (key in detachedBySchema) {
               schemaNode = pgBrowser.findSiblingTreeNode(schemaNode, key);
 
               if (schemaNode) {
@@ -1431,8 +1426,11 @@ define('pgadmin.node.table', [
                   insertChildTreeNodes.push({
                     'parent': tablesCollNode,
                     'type': 'table',
-                    'treeHierarchy': pgAdmin.Browser.Nodes.schema.getTreeNodeHierarchy(schemaNode),
-                    'childrenIDs': _.clone(childIDs)
+                    'treeHierarchy':
+                      pgAdmin.Browser.Nodes.schema.getTreeNodeHierarchy(
+                        schemaNode
+                      ),
+                    'childrenIDs': _.clone(childIDs),
                   });
                 }
               }
@@ -1440,15 +1438,15 @@ define('pgadmin.node.table', [
           }
 
           if ('attached' in partitions && partitions.attached.length > 0) {
-            var schemaNode = pgBrowser.findParentTreeNodeByType(
-                  _node, 'schema'
-                ),
-                attachedBySchema = _.groupBy(
-                  partitions.attached,
-                  function(_d) { return parseInt(_d.schema_id); }
-                ), childIDs;
-
-            for (var key in attachedBySchema) {
+            schemaNode = pgBrowser.findParentTreeNodeByType(
+              _node, 'schema'
+            );
+            var attachedBySchema = _.groupBy(
+              partitions.attached,
+              function(_d) { return parseInt(_d.schema_id); }
+            );
+
+            for (key in attachedBySchema) {
               schemaNode = pgBrowser.findSiblingTreeNode(schemaNode, key);
 
               if (schemaNode) {
@@ -1472,8 +1470,6 @@ define('pgadmin.node.table', [
           }
 
           if (newPartitionsIDs.length) {
-            node_info = self.getTreeNodeHierarchy(_node);
-
             var partitionsCollNode = pgBrowser.findChildCollectionTreeNode(
               _node, 'coll-partition'
             );
@@ -1483,7 +1479,7 @@ define('pgadmin.node.table', [
                 'parent': partitionsCollNode,
                 'type': 'partition',
                 'treeHierarchy': self.getTreeNodeHierarchy(_node),
-                'childrenIDs': newPartitionsIDs
+                'childrenIDs': newPartitionsIDs,
               });
             }
           }
@@ -1494,7 +1490,7 @@ define('pgadmin.node.table', [
         // Clear Table's cache as column's type is dependent on two node
         // 1) Type node 2) Domain node
         this.clear_cache.apply(this, null);
-      }
+      },
     });
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.js
index bb5a5927..fbe7659e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.js
@@ -1,10 +1,10 @@
 define('pgadmin.node.trigger', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
   'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'backform', 'pgadmin.alertifyjs',
-  'pgadmin.browser.collection'
+  'pgadmin.browser.collection',
 ], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify) {
 
-  var CustomSwitchControl = Backform.CustomSwitchControl = Backform.SwitchControl.extend({
+  Backform.CustomSwitchControl = Backform.SwitchControl.extend({
     template: _.template([
       '<label class="<%=Backform.controlLabelClassName%> custom_switch_label_class"><%=label%></label>',
       '<div class="<%=Backform.controlsClassName%> custom_switch_control_class">',
@@ -18,21 +18,21 @@ define('pgadmin.node.trigger', [
       '</div>',
       '<% if (helpMessage && helpMessage.length) { %>',
       '  <span class="<%=Backform.helpMessageClassName%>"><%=helpMessage%></span>',
-      '<% } %>'
-    ].join("\n")),
-    className: 'pgadmin-control-group form-group col-xs-6'
+      '<% } %>',
+    ].join('\n')),
+    className: 'pgadmin-control-group form-group col-xs-6',
   });
 
   if (!pgBrowser.Nodes['coll-trigger']) {
-    var triggers = pgAdmin.Browser.Nodes['coll-trigger'] =
+    pgAdmin.Browser.Nodes['coll-trigger'] =
       pgAdmin.Browser.Collection.extend({
         node: 'trigger',
         label: gettext('Triggers'),
         type: 'coll-trigger',
         getTreeNodeHierarchy: pgBrowser.tableChildTreeNodeHierarchy,
-        columns: ['name', 'description']
+        columns: ['name', 'description'],
       });
-  };
+  }
 
   if (!pgBrowser.Nodes['trigger']) {
     pgAdmin.Browser.Nodes['trigger'] = pgBrowser.Node.extend({
@@ -50,7 +50,7 @@ define('pgadmin.node.trigger', [
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -59,42 +59,42 @@ define('pgadmin.node.trigger', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Trigger...'),
           icon: 'wcTabIcon icon-trigger', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_trigger', node: 'trigger', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Trigger...'),
           icon: 'wcTabIcon icon-trigger', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_trigger_onTable', node: 'table', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Trigger...'),
           icon: 'wcTabIcon icon-trigger', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_trigger_onPartition', node: 'partition', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Trigger...'),
           icon: 'wcTabIcon icon-trigger', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'enable_trigger', node: 'trigger', module: this,
           applies: ['object', 'context'], callback: 'enable_trigger',
           category: 'connect', priority: 3, label: gettext('Enable trigger'),
-          icon: 'fa fa-check', enable : 'canCreate_with_trigger_enable'
+          icon: 'fa fa-check', enable : 'canCreate_with_trigger_enable',
         },{
           name: 'disable_trigger', node: 'trigger', module: this,
           applies: ['object', 'context'], callback: 'disable_trigger',
           category: 'drop', priority: 3, label: gettext('Disable trigger'),
-          icon: 'fa fa-times', enable : 'canCreate_with_trigger_disable'
+          icon: 'fa fa-times', enable : 'canCreate_with_trigger_disable',
         },{
           name: 'create_trigger_onView', node: 'view', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Trigger...'),
           icon: 'wcTabIcon icon-trigger', data: {action: 'create', check: true},
-          enable: 'canCreate'
-        }
+          enable: 'canCreate',
+        },
         ]);
       },
       callbacks: {
@@ -114,7 +114,7 @@ define('pgadmin.node.trigger', [
             url: obj.generate_url(i, 'enable' , d, true),
             type:'PUT',
             data: {'enable' : true},
-            dataType: "json",
+            dataType: 'json',
             success: function(res) {
               if (res.success == 1) {
                 alertify.success(res.info);
@@ -130,16 +130,18 @@ define('pgadmin.node.trigger', [
                 }, 10);
               }
             },
-            error: function(xhr, status, error) {
+            error: function(xhr) {
               try {
                 var err = $.parseJSON(xhr.responseText);
                 if (err.success == 0) {
                   alertify.error(err.errormsg);
                 }
-              } catch (e) {}
+              } catch (e) {
+                console.warn(e.stack || e);
+              }
               t.unload(i);
-            }
-          })
+            },
+          });
         },
         /* Disable trigger */
         disable_trigger: function(args) {
@@ -157,7 +159,7 @@ define('pgadmin.node.trigger', [
             url: obj.generate_url(i, 'enable' , d, true),
             type:'PUT',
             data: {'enable' : false},
-            dataType: "json",
+            dataType: 'json',
             success: function(res) {
               if (res.success == 1) {
                 alertify.success(res.info);
@@ -173,17 +175,19 @@ define('pgadmin.node.trigger', [
                 }, 10);
               }
             },
-            error: function(xhr, status, error) {
+            error: function(xhr) {
               try {
                 var err = $.parseJSON(xhr.responseText);
                 if (err.success == 0) {
                   alertify.error(err.errormsg);
                 }
-              } catch (e) {}
+              } catch (e) {
+                console.warn(e.stack || e);
+              }
               t.unload(i);
-            }
-          })
-        }
+            },
+          });
+        },
       },
       canDrop: pgBrowser.Nodes['schema'].canChildDrop,
       canDropCascade: pgBrowser.Nodes['schema'].canChildDrop,
@@ -191,18 +195,18 @@ define('pgadmin.node.trigger', [
         defaults: {
           name: undefined,
           is_row_trigger: true,
-          fires: 'BEFORE'
+          fires: 'BEFORE',
         },
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text', disabled: 'inSchema'
+          type: 'text', disabled: 'inSchema',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'int', disabled: true, mode: ['properties']
+          type: 'int', disabled: true, mode: ['properties'],
         },{
           id: 'is_enable_trigger', label: gettext('Trigger enabled?'),
           type: 'switch', disabled: 'inSchema', mode: ['edit', 'properties'],
-          group: gettext('Definition')
+          group: gettext('Definition'),
         },{
           id: 'is_row_trigger', label: gettext('Row trigger?'),
           type: 'switch', group: gettext('Definition'),
@@ -211,10 +215,10 @@ define('pgadmin.node.trigger', [
           disabled: function(m) {
             // Disabled if table is a partitioned table.
             if (_.has(m, 'node_info') && _.has(m.node_info, 'table') &&
-                _.has(m.node_info.table, 'is_partitioned') && m.node_info.table.is_partitioned)
+              _.has(m.node_info.table, 'is_partitioned') && m.node_info.table.is_partitioned)
             {
               setTimeout(function(){
-                  m.set('is_row_trigger', false);
+                m.set('is_row_trigger', false);
               },10);
 
               return true;
@@ -224,44 +228,44 @@ define('pgadmin.node.trigger', [
             // automatically set to True and becomes disable
             var is_constraint_trigger = m.get('is_constraint_trigger');
             if(!m.inSchemaWithModelCheck.apply(this, [m])) {
-                if(!_.isUndefined(is_constraint_trigger) &&
+              if(!_.isUndefined(is_constraint_trigger) &&
                 is_constraint_trigger === true) {
-                // change it's model value
-                    setTimeout(function() { m.set('is_row_trigger', true) }, 10);
-                    return true;
-                } else {
-                    return false;
-                }
-            } else {
-                // Check if it is row trigger then enabled it.
-                var is_row_trigger = m.get('is_row_trigger');
-                if (!_.isUndefined(is_row_trigger) && m.node_info['server']['server_type'] == 'ppas') {
-                  return false;
-                }
-                // Disable it
+                  // change it's model value
+                setTimeout(function() { m.set('is_row_trigger', true); }, 10);
                 return true;
+              } else {
+                return false;
+              }
+            } else {
+              // Check if it is row trigger then enabled it.
+              var is_row_trigger = m.get('is_row_trigger');
+              if (!_.isUndefined(is_row_trigger) && m.node_info['server']['server_type'] == 'ppas') {
+                return false;
+              }
+              // Disable it
+              return true;
             }
-          }
+          },
         },{
           id: 'is_constraint_trigger', label: gettext('Constraint trigger?'),
-          type: 'switch', disabled: 'inSchemaWithModelCheck',
+          type: 'switch',
           mode: ['create','edit', 'properties'],
           group: gettext('Definition'),
           disabled: function(m) {
             // Disabled if table is a partitioned table.
             if ((_.has(m, 'node_info') && _.has(m.node_info, 'table') &&
-                _.has(m.node_info.table, 'is_partitioned') && m.node_info.table.is_partitioned) ||
-                 _.indexOf(Object.keys(m.node_info), 'view') != -1)
-            {
+              _.has(m.node_info.table, 'is_partitioned') &&
+                m.node_info.table.is_partitioned) ||
+                _.indexOf(Object.keys(m.node_info), 'view') != -1) {
               setTimeout(function(){
-                  m.set('is_constraint_trigger', false);
+                m.set('is_constraint_trigger', false);
               },10);
 
               return true;
             }
 
             return m.inSchemaWithModelCheck.apply(this, [m]);
-          }
+          },
         },{
           id: 'tgdeferrable', label: gettext('Deferrable?'),
           type: 'switch', group: gettext('Definition'),
@@ -271,21 +275,21 @@ define('pgadmin.node.trigger', [
             // If constraint trigger is set to True then only enable it
             var is_constraint_trigger = m.get('is_constraint_trigger');
             if(!m.inSchemaWithModelCheck.apply(this, [m])) {
-                if(!_.isUndefined(is_constraint_trigger) &&
+              if(!_.isUndefined(is_constraint_trigger) &&
                 is_constraint_trigger === true) {
-                    return false;
-                } else {
-                    // If value is already set then reset it to false
-                    if(m.get('tgdeferrable')) {
-                      setTimeout(function() { m.set('tgdeferrable', false) }, 10);
-                    }
-                    return true;
+                return false;
+              } else {
+                  // If value is already set then reset it to false
+                if(m.get('tgdeferrable')) {
+                  setTimeout(function() { m.set('tgdeferrable', false); }, 10);
                 }
-            } else {
-                // Disable it
                 return true;
+              }
+            } else {
+              // Disable it
+              return true;
             }
-          }
+          },
         },{
           id: 'tginitdeferred', label: gettext('Deferred?'),
           type: 'switch', group: gettext('Definition'),
@@ -295,28 +299,28 @@ define('pgadmin.node.trigger', [
             // If Deferrable is set to True then only enable it
             var tgdeferrable = m.get('tgdeferrable');
             if(!m.inSchemaWithModelCheck.apply(this, [m])) {
-                if(!_.isUndefined(tgdeferrable) &&
+              if(!_.isUndefined(tgdeferrable) &&
                 tgdeferrable) {
-                    return false;
-                } else {
-                    // If value is already set then reset it to false
-                    if(m.get('tginitdeferred')) {
-                      setTimeout(function() { m.set('tginitdeferred', false) }, 10);
-                    }
-                    // If constraint trigger is set then do not disable
-                    return m.get('is_constraint_trigger') ? false : true;
+                return false;
+              } else {
+                  // If value is already set then reset it to false
+                if(m.get('tginitdeferred')) {
+                  setTimeout(function() { m.set('tginitdeferred', false); }, 10);
                 }
+                  // If constraint trigger is set then do not disable
+                return m.get('is_constraint_trigger') ? false : true;
+              }
             } else {
-                // Disable it
-                return true;
+              // Disable it
+              return true;
             }
-          }
+          },
         },{
           id: 'tfunction', label: gettext('Trigger Function'),
           type: 'text', disabled: 'inSchemaWithModelCheck',
           mode: ['create','edit', 'properties'], group: gettext('Definition'),
           control: 'node-ajax-options', url: 'get_triggerfunctions',
-          cache_node: 'trigger_function'
+          cache_node: 'trigger_function',
         },{
           id: 'tgargs', label: gettext('Arguments'), cell: 'string',
           group: gettext('Definition'),
@@ -325,190 +329,189 @@ define('pgadmin.node.trigger', [
             // We will disable it when EDB PPAS and trigger function is
             // set to Inline EDB-SPL
             var tfunction = m.get('tfunction'),
-                server_type = m.node_info['server']['server_type'];
+              server_type = m.node_info['server']['server_type'];
             if(!m.inSchemaWithModelCheck.apply(this, [m])) {
-                if(server_type === 'ppas' &&
-                    !_.isUndefined(tfunction) &&
-                tfunction === 'Inline EDB-SPL') {
+              if(server_type === 'ppas' &&
+                !_.isUndefined(tfunction) &&
+                  tfunction === 'Inline EDB-SPL') {
                     // Disable and clear its value
-                    m.set('tgargs', undefined)
-                    return true;
-                } else {
-                    return false;
-                }
-            } else {
-                // Disable it
+                m.set('tgargs', undefined);
                 return true;
+              } else {
+                return false;
+              }
+            } else {
+              // Disable it
+              return true;
             }
-          }
+          },
         },{
-        id: 'fires', label: gettext('Fires'), deps: ['is_constraint_trigger'],
-        mode: ['create','edit', 'properties'], group: gettext('Events'),
-        options: function(control) {
+          id: 'fires', label: gettext('Fires'), deps: ['is_constraint_trigger'],
+          mode: ['create','edit', 'properties'], group: gettext('Events'),
+          options: function(control) {
             var table_options = [
-                {label: "BEFORE", value: "BEFORE"},
-                {label: "AFTER", value: "AFTER"}],
-                view_options = [
-                {label: "BEFORE", value: "BEFORE"},
-                {label: "AFTER", value: "AFTER"},
-                {label: "INSTEAD OF", value: "INSTEAD OF"}];
+              {label: 'BEFORE', value: 'BEFORE'},
+              {label: 'AFTER', value: 'AFTER'}],
+              view_options = [
+                {label: 'BEFORE', value: 'BEFORE'},
+                {label: 'AFTER', value: 'AFTER'},
+                {label: 'INSTEAD OF', value: 'INSTEAD OF'}];
             // If we are under table then show table specific options
             if(_.indexOf(Object.keys(control.model.node_info), 'table') != -1) {
-                return table_options;
+              return table_options;
             } else {
-                return view_options;
+              return view_options;
             }
-        },
-        // If create mode then by default open composite type
-        control: 'select2', select2: { allowClear: false, width: "100%" },
-        disabled: function(m) {
-        // If contraint trigger is set to True then only enable it
-        var is_constraint_trigger = m.get('is_constraint_trigger');
-        if(!m.inSchemaWithModelCheck.apply(this, [m])) {
-            if(!_.isUndefined(is_constraint_trigger) &&
-            is_constraint_trigger === true) {
-                setTimeout(function() { m.set('fires', 'AFTER') }, 10);
+          },
+          // If create mode then by default open composite type
+          control: 'select2', select2: { allowClear: false, width: '100%' },
+          disabled: function(m) {
+            // If contraint trigger is set to True then only enable it
+            var is_constraint_trigger = m.get('is_constraint_trigger');
+            if(!m.inSchemaWithModelCheck.apply(this, [m])) {
+              if(!_.isUndefined(is_constraint_trigger) &&
+                is_constraint_trigger === true) {
+                setTimeout(function() { m.set('fires', 'AFTER'); }, 10);
                 return true;
+              } else {
+                return false;
+              }
             } else {
+              // Check if it is row trigger then enabled it.
+              var fires_ = m.get('fires');
+              if (!_.isUndefined(fires_) && m.node_info['server']['server_type'] == 'ppas') {
                 return false;
+              }
+              // Disable it
+              return true;
             }
-        } else {
-            // Check if it is row trigger then enabled it.
-            var fires_ = m.get('fires');
-            if (!_.isUndefined(fires_) && m.node_info['server']['server_type'] == 'ppas') {
-              return false;
-            }
-            // Disable it
-            return true;
-        }
-       }
-      },{
-        type: 'nested', control: 'fieldset', mode: ['create','edit', 'properties'],
-        label: gettext('Events'), group: gettext('Events'),
-        schema:[{
+          },
+        },{
+          type: 'nested', control: 'fieldset', mode: ['create','edit', 'properties'],
+          label: gettext('Events'), group: gettext('Events'),
+          schema:[{
             id: 'evnt_insert', label: gettext('INSERT'),
             type: 'switch', mode: ['create','edit', 'properties'],
             group: gettext('Events'),
             control: Backform.CustomSwitchControl,
             disabled: function(m) {
-                var evn_insert = m.get('evnt_insert');
-                if (!_.isUndefined(evn_insert) && m.node_info['server']['server_type'] == 'ppas')
-                  return false;
-                return m.inSchemaWithModelCheck.apply(this, [m]);
-            }
-        },{
+              var evn_insert = m.get('evnt_insert');
+              if (!_.isUndefined(evn_insert) && m.node_info['server']['server_type'] == 'ppas')
+                return false;
+              return m.inSchemaWithModelCheck.apply(this, [m]);
+            },
+          },{
             id: 'evnt_update', label: gettext('UPDATE'),
             type: 'switch', mode: ['create','edit', 'properties'],
             group: gettext('Events'),
             control: Backform.CustomSwitchControl,
             disabled: function(m) {
-                var evn_update = m.get('evnt_update');
-                if (!_.isUndefined(evn_update) && m.node_info['server']['server_type'] == 'ppas')
-                  return false;
-                return m.inSchemaWithModelCheck.apply(this, [m]);
-            }
-        },{
+              var evn_update = m.get('evnt_update');
+              if (!_.isUndefined(evn_update) && m.node_info['server']['server_type'] == 'ppas')
+                return false;
+              return m.inSchemaWithModelCheck.apply(this, [m]);
+            },
+          },{
             id: 'evnt_delete', label: gettext('DELETE'),
             type: 'switch', mode: ['create','edit', 'properties'],
             group: gettext('Events'),
             control: Backform.CustomSwitchControl,
             disabled: function(m) {
-                var evn_delete = m.get('evnt_delete');
-                if (!_.isUndefined(evn_delete) && m.node_info['server']['server_type'] == 'ppas')
-                  return false;
-                return m.inSchemaWithModelCheck.apply(this, [m]);
-            }
-        },{
+              var evn_delete = m.get('evnt_delete');
+              if (!_.isUndefined(evn_delete) && m.node_info['server']['server_type'] == 'ppas')
+                return false;
+              return m.inSchemaWithModelCheck.apply(this, [m]);
+            },
+          },{
             id: 'evnt_truncate', label: gettext('TRUNCATE'),
             type: 'switch', group: gettext('Events'),
             control: Backform.CustomSwitchControl,
             disabled: function(m) {
-            var is_constraint_trigger = m.get('is_constraint_trigger'),
+              var is_constraint_trigger = m.get('is_constraint_trigger'),
                 is_row_trigger = m.get('is_row_trigger'),
                 server_type = m.node_info['server']['server_type'];
-            if(!m.inSchemaWithModelCheck.apply(this, [m])) {
+              if(!m.inSchemaWithModelCheck.apply(this, [m])) {
                 // We will enabale truncate only for EDB PPAS
                 // and both triggers row & constarint are set to false
                 if(server_type === 'ppas' &&
-                    !_.isUndefined(is_constraint_trigger) &&
+                  !_.isUndefined(is_constraint_trigger) &&
                     !_.isUndefined(is_row_trigger) &&
-                is_constraint_trigger === false &&
+                    is_constraint_trigger === false &&
                     is_row_trigger === false) {
-                    return false;
+                  return false;
                 } else {
-                    return true;
+                  return true;
                 }
-            } else {
+              } else {
                 // Disable it
                 return true;
-            }
-        }
-        }]
+              }
+            },
+          }],
         },{
-            id: 'whenclause', label: gettext('When'),
-            type: 'text', disabled: 'inSchemaWithModelCheck',
-            mode: ['create', 'edit', 'properties'],
-            control: 'sql-field', visible: true, group: gettext('Events')
+          id: 'whenclause', label: gettext('When'),
+          type: 'text', disabled: 'inSchemaWithModelCheck',
+          mode: ['create', 'edit', 'properties'],
+          control: 'sql-field', visible: true, group: gettext('Events'),
         },{
-            id: 'columns', label: gettext('Columns'), url: 'nodes',
-            control: 'node-list-by-name', cache_node: 'column', type: 'array',
-            select2: {'multiple': true},
-            deps: ['evnt_update'], node: 'column', group: gettext('Events'),
-            disabled: function(m) {
-                if(this.node_info &&  'catalog' in this.node_info) {
-                    return true;
-                }
-                //Disable in edit mode
-                if (!m.isNew()) {
-                    return true;
-                }
-                // Enable column only if update event is set true
-                var isUpdate = m.get('evnt_update');
-                if(!_.isUndefined(isUpdate) && isUpdate) {
-                    return false;
-                }
-             return true;
+          id: 'columns', label: gettext('Columns'), url: 'nodes',
+          control: 'node-list-by-name', cache_node: 'column', type: 'array',
+          select2: {'multiple': true},
+          deps: ['evnt_update'], node: 'column', group: gettext('Events'),
+          disabled: function(m) {
+            if(this.node_info &&  'catalog' in this.node_info) {
+              return true;
             }
+            //Disable in edit mode
+            if (!m.isNew()) {
+              return true;
+            }
+            // Enable column only if update event is set true
+            var isUpdate = m.get('evnt_update');
+            if(!_.isUndefined(isUpdate) && isUpdate) {
+              return false;
+            }
+            return true;
+          },
         },{
-            id: 'tgoldtable', label: gettext('Old table'),
-            type: 'text', group: gettext('Transition'),
-            cell: 'string', mode: ['create', 'edit', 'properties'],
-            deps: ['fires', 'is_constraint_trigger', 'evnt_insert', 'evnt_update', 'evnt_delete', 'columns'],
-            disabled: 'disableTransition'
+          id: 'tgoldtable', label: gettext('Old table'),
+          type: 'text', group: gettext('Transition'),
+          cell: 'string', mode: ['create', 'edit', 'properties'],
+          deps: ['fires', 'is_constraint_trigger', 'evnt_insert', 'evnt_update', 'evnt_delete', 'columns'],
+          disabled: 'disableTransition',
         },{
-            id: 'tgnewtable', label: gettext('New table'),
-            type: 'text', group: gettext('Transition'),
-            cell: 'string', mode: ['create', 'edit', 'properties'],
-            deps: ['fires', 'is_constraint_trigger', 'evnt_insert', 'evnt_update', 'evnt_delete', 'columns'],
-            disabled: 'disableTransition'
+          id: 'tgnewtable', label: gettext('New table'),
+          type: 'text', group: gettext('Transition'),
+          cell: 'string', mode: ['create', 'edit', 'properties'],
+          deps: ['fires', 'is_constraint_trigger', 'evnt_insert', 'evnt_update', 'evnt_delete', 'columns'],
+          disabled: 'disableTransition',
         },{
-            id: 'prosrc', label: gettext('Code'), group: gettext('Code'),
-            type: 'text', mode: ['create', 'edit'], deps: ['tfunction'],
-            control: 'sql-field', visible: true,
-            disabled: function(m) {
-                // We will enable it only when EDB PPAS and trigger function is
-                // set to Inline EDB-SPL
-                var tfunction = m.get('tfunction'),
-                    server_type = m.node_info['server']['server_type'];
+          id: 'prosrc', label: gettext('Code'), group: gettext('Code'),
+          type: 'text', mode: ['create', 'edit'], deps: ['tfunction'],
+          control: 'sql-field', visible: true,
+          disabled: function(m) {
+            // We will enable it only when EDB PPAS and trigger function is
+            // set to Inline EDB-SPL
+            var tfunction = m.get('tfunction'),
+              server_type = m.node_info['server']['server_type'];
 
-                if(server_type === 'ppas' &&
-                    !_.isUndefined(tfunction) &&
-                    tfunction === 'Inline EDB-SPL')
-                  return false;
-                else
-                  return true;
-            }
+            if(server_type === 'ppas' &&
+              !_.isUndefined(tfunction) &&
+                tfunction === 'Inline EDB-SPL')
+              return false;
+            else
+              return true;
+          },
         },{
           id: 'is_sys_trigger', label: gettext('System trigger?'), cell: 'string',
-          type: 'switch', disabled: 'inSchemaWithModelCheck', mode: ['properties']
+          type: 'switch', disabled: 'inSchemaWithModelCheck', mode: ['properties'],
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
           type: 'multiline', mode: ['properties', 'create', 'edit'],
-          disabled: 'inSchema'
-    }],
+          disabled: 'inSchema',
+        }],
         validate: function(keys) {
-          var err = {},
-              msg = undefined;
+          var msg;
           this.errorModel.clear();
 
           // If nothing to validate
@@ -517,13 +520,13 @@ define('pgadmin.node.trigger', [
           }
 
           if(_.isUndefined(this.get('name'))
-              || String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
+            || String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
             msg = gettext('Name cannot be empty.');
             this.errorModel.set('name', msg);
             return msg;
-            }
+          }
           if(_.isUndefined(this.get('tfunction'))
-              || String(this.get('tfunction')).replace(/^\s+|\s+$/g, '') == '') {
+            || String(this.get('tfunction')).replace(/^\s+|\s+$/g, '') == '') {
             msg = gettext('Trigger function cannot be empty.');
             this.errorModel.set('tfunction', msg);
             return msg;
@@ -532,17 +535,17 @@ define('pgadmin.node.trigger', [
           if(!this.get('evnt_truncate') && !this.get('evnt_delete') &&
             !this.get('evnt_update') && !this.get('evnt_insert')) {
             msg = gettext('Specify at least one event.');
-            this.errorModel.set('evnt_truncate', " ");
-            this.errorModel.set('evnt_delete', " ");
-            this.errorModel.set('evnt_update', " ");
+            this.errorModel.set('evnt_truncate', ' ');
+            this.errorModel.set('evnt_delete', ' ');
+            this.errorModel.set('evnt_update', ' ');
             this.errorModel.set('evnt_insert', msg);
             return msg;
           }
 
           if(!_.isUndefined(this.get('tfunction')) &&
             this.get('tfunction') === 'Inline EDB-SPL' &&
-            (_.isUndefined(this.get('prosrc'))
-              || String(this.get('prosrc')).replace(/^\s+|\s+$/g, '') == ''))
+              (_.isUndefined(this.get('prosrc'))
+                || String(this.get('prosrc')).replace(/^\s+|\s+$/g, '') == ''))
           {
             msg = gettext('Trigger code cannot be empty.');
             this.errorModel.set('prosrc', msg);
@@ -583,23 +586,23 @@ define('pgadmin.node.trigger', [
               } else {
                 return true;
               }
-           }
+            }
           }
           return true;
         },
         // Disable/Enable Transition tables
         disableTransition: function(m) {
           var flag = true,
-              evnt = null,
-              name = this.name,
-              evnt_count = 0;
+            evnt = null,
+            name = this.name,
+            evnt_count = 0;
 
           // Disable transition tables for view trigger and PG version < 100000
           if(_.indexOf(Object.keys(m.node_info), 'table') == -1 ||
-           m.node_info.server.version < 100000) return true;
+            m.node_info.server.version < 100000) return true;
 
-          if (name == "tgoldtable") evnt = 'evnt_delete';
-          else if (name == "tgnewtable") evnt = 'evnt_insert';
+          if (name == 'tgoldtable') evnt = 'evnt_delete';
+          else if (name == 'tgnewtable') evnt = 'evnt_insert';
 
           if(m.get('evnt_insert')) evnt_count++;
           if(m.get('evnt_update')) evnt_count++;
@@ -615,9 +618,9 @@ define('pgadmin.node.trigger', [
           // Disable Old transition table if both UPDATE and DELETE events are disabled
           // Disable New transition table if both UPDATE and INSERT events are disabled
           if(!m.get('is_constraint_trigger') && m.get('fires') == 'AFTER' &&
-           (m.get('evnt_update') || m.get(evnt)) && evnt_count == 1) {
-             if (m.get('evnt_update') && (_.size(m.get('columns')) >= 1 && m.get('columns')[0] != "")) flag = true;
-             else flag = false;
+            (m.get('evnt_update') || m.get(evnt)) && evnt_count == 1) {
+            if (m.get('evnt_update') && (_.size(m.get('columns')) >= 1 && m.get('columns')[0] != '')) flag = true;
+            else flag = false;
           }
 
           flag && setTimeout(function() {
@@ -627,30 +630,30 @@ define('pgadmin.node.trigger', [
           },10);
 
           return flag;
-        }
+        },
       }),
       // Below function will enable right click menu for creating column
       canCreate: function(itemData, item, data) {
-          // If check is false then , we will allow create menu
-          if (data && data.check == false)
-            return true;
+        // If check is false then , we will allow create menu
+        if (data && data.check == false)
+          return true;
 
-          var t = pgBrowser.tree, i = item, d = itemData, parents = [];
-          // To iterate over tree to check parent node
-          while (i) {
-            // If it is schema then allow user to c reate table
-            if (_.indexOf(['schema'], d._type) > -1)
-              return true;
-            parents.push(d._type);
-            i = t.hasParent(i) ? t.parent(i) : null;
-            d = i ? t.itemData(i) : null;
-          }
-          // If node is under catalog then do not allow 'create' menu
-          if (_.indexOf(parents, 'catalog') > -1) {
-            return false;
-          } else {
+        var t = pgBrowser.tree, i = item, d = itemData, parents = [];
+        // To iterate over tree to check parent node
+        while (i) {
+          // If it is schema then allow user to c reate table
+          if (_.indexOf(['schema'], d._type) > -1)
             return true;
-          }
+          parents.push(d._type);
+          i = t.hasParent(i) ? t.parent(i) : null;
+          d = i ? t.itemData(i) : null;
+        }
+        // If node is under catalog then do not allow 'create' menu
+        if (_.indexOf(parents, 'catalog') > -1) {
+          return false;
+        } else {
+          return true;
+        }
       },
       // Check to whether trigger is disable ?
       canCreate_with_trigger_enable: function(itemData, item, data) {
@@ -673,9 +676,9 @@ define('pgadmin.node.trigger', [
             return false;
           }
         }
-      }
-  });
- }
+      },
+    });
+  }
 
   return pgBrowser.Nodes['trigger'];
 });
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.js
index 5c168cd7..c1c24861 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.js
@@ -1,67 +1,67 @@
 define('pgadmin.node.type', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify', 'backgrid',
-  'pgadmin.backgrid', 'pgadmin.browser.collection'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, Backgrid) {
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
+  'pgadmin.backgrid', 'pgadmin.browser.collection',
+], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, Backgrid) {
 
   if (!pgBrowser.Nodes['coll-type']) {
-    var databases = pgBrowser.Nodes['coll-type'] =
+    pgBrowser.Nodes['coll-type'] =
       pgBrowser.Collection.extend({
         node: 'type',
         label: gettext('Types'),
         type: 'coll-type',
-        columns: ['name', 'typeowner', 'description']
+        columns: ['name', 'typeowner', 'description'],
       });
-  };
+  }
 
   // Integer Cell for Columns Length and Precision
   var IntegerDepCell = Backgrid.IntegerCell.extend({
-      initialize: function() {
-        Backgrid.NumberCell.prototype.initialize.apply(this, arguments);
-        Backgrid.Extension.DependentCell.prototype.initialize.apply(this, arguments);
-      },
-      dependentChanged: function () {
-        this.$el.empty();
-        var model = this.model;
-        var column = this.column;
-        var editable = this.column.get("editable");
-
-        var is_editable = _.isFunction(editable) ? !!editable.apply(column, [model]) : !!editable;
-        if (is_editable){ this.$el.addClass("editable"); }
-        else { this.$el.removeClass("editable"); }
-
-        this.delegateEvents();
-        return this;
-      },
-      remove: Backgrid.Extension.DependentCell.prototype.remove
-    });
+    initialize: function() {
+      Backgrid.NumberCell.prototype.initialize.apply(this, arguments);
+      Backgrid.Extension.DependentCell.prototype.initialize.apply(this, arguments);
+    },
+    dependentChanged: function () {
+      this.$el.empty();
+      var model = this.model;
+      var column = this.column;
+      var editable = this.column.get('editable');
+
+      var is_editable = _.isFunction(editable) ? !!editable.apply(column, [model]) : !!editable;
+      if (is_editable){ this.$el.addClass('editable'); }
+      else { this.$el.removeClass('editable'); }
+
+      this.delegateEvents();
+      return this;
+    },
+    remove: Backgrid.Extension.DependentCell.prototype.remove,
+  });
 
   // Node-Ajax-Cell with Deps
   var NodeAjaxOptionsDepsCell = Backgrid.Extension.NodeAjaxOptionsCell.extend({
-      initialize: function() {
-        Backgrid.Extension.NodeAjaxOptionsCell.prototype.initialize.apply(this, arguments);
-        Backgrid.Extension.DependentCell.prototype.initialize.apply(this, arguments);
-      },
-      dependentChanged: function () {
-        var model = this.model,
-          column = this.column,
-          editable = this.column.get("editable"),
-          input = this.$el.find('select').first();
-
-        var is_editable = _.isFunction(editable) ? !!editable.apply(column, [model]) : !!editable;
-        if (is_editable) {
-           this.$el.addClass("editable");
-           input.prop('disabled', false);
-         } else {
-           this.$el.removeClass("editable");
-           input.prop('disabled', true);
-         }
-
-        this.delegateEvents();
-        return this;
-      },
-      remove: Backgrid.Extension.DependentCell.prototype.remove
-    });
+    initialize: function() {
+      Backgrid.Extension.NodeAjaxOptionsCell.prototype.initialize.apply(this, arguments);
+      Backgrid.Extension.DependentCell.prototype.initialize.apply(this, arguments);
+    },
+    dependentChanged: function () {
+      var model = this.model,
+        column = this.column,
+        editable = this.column.get('editable'),
+        input = this.$el.find('select').first();
+
+      var is_editable = _.isFunction(editable) ? !!editable.apply(column, [model]) : !!editable;
+      if (is_editable) {
+        this.$el.addClass('editable');
+        input.prop('disabled', false);
+      } else {
+        this.$el.removeClass('editable');
+        input.prop('disabled', true);
+      }
+
+      this.delegateEvents();
+      return this;
+    },
+    remove: Backgrid.Extension.DependentCell.prototype.remove,
+  });
 
   // Composite type model declaration
   var CompositeModel = Backform.CompositeModel = pgBrowser.Node.Model.extend({
@@ -82,7 +82,7 @@ define('pgadmin.node.type', [
     subtypes: undefined,
     schema: [{
       id: 'member_name', label: gettext('Member Name'),
-      type: 'text',  disabled: false, editable: true
+      type: 'text',  disabled: false, editable: true,
     },{
       id: 'type', label: gettext('Type'), control: 'node-ajax-options',
       type: 'text', url: 'get_types', disabled: false, node: 'type',
@@ -91,7 +91,7 @@ define('pgadmin.node.type', [
       transform: function(d, control){
         control.model.type_options =  d;
         return d;
-      }
+      },
     },{
       // Note: There are ambiguities in the PG catalogs and docs between
       // precision and scale. In the UI, we try to follow the docs as
@@ -106,22 +106,22 @@ define('pgadmin.node.type', [
           _.each(m.type_options, function(o) {
             // if type from selected from combobox matches in options
             if ( of_type == o.value ) {
-                // if length is allowed for selected type
-                if(o.length)
-                {
-                  // set the values in model
-                  m.set('is_tlength', true, {silent: true});
-                  m.set('min_val', o.min_val, {silent: true});
-                  m.set('max_val', o.max_val, {silent: true});
-                } else {
-                  // set the values in model
-                  m.set('is_tlength', false, {silent: true});
-                }
+              // if length is allowed for selected type
+              if(o.length)
+              {
+                // set the values in model
+                m.set('is_tlength', true, {silent: true});
+                m.set('min_val', o.min_val, {silent: true});
+                m.set('max_val', o.max_val, {silent: true});
+              } else {
+                // set the values in model
+                m.set('is_tlength', false, {silent: true});
+              }
             }
           });
         }
         return m.get('is_tlength');
-      }
+      },
     },{
       // Note: There are ambiguities in the PG catalogs and docs between
       // precision and scale. In the UI, we try to follow the docs as
@@ -136,69 +136,68 @@ define('pgadmin.node.type', [
           _.each(m.type_options, function(o) {
             // if type from selected from combobox matches in options
             if ( of_type == o.value ) {
-                // if precession is allowed for selected type
-                if(o.precision)
-                {
-                  // set the values in model
-                  m.set('is_precision', true, {silent: true});
-                  m.set('min_val', o.min_val, {silent: true});
-                  m.set('max_val', o.max_val, {silent: true});
-                } else {
-                  // set the values in model
-                  m.set('is_precision', false, {silent: true});
-                }
+              // if precession is allowed for selected type
+              if(o.precision)
+              {
+                // set the values in model
+                m.set('is_precision', true, {silent: true});
+                m.set('min_val', o.min_val, {silent: true});
+                m.set('max_val', o.max_val, {silent: true});
+              } else {
+                // set the values in model
+                m.set('is_precision', false, {silent: true});
+              }
             }
           });
         }
         return m.get('is_precision');
-      }
+      },
     },{
       id: 'collation', label: gettext('Collation'),
       cell: NodeAjaxOptionsDepsCell, deps: ['type'],
       select2: {allowClear: false},
       control: 'node-ajax-options', editable: function(m) {
-         var of_type = m.get('type'),
-           flag = false;
-         if(m.type_options) {
+        var of_type = m.get('type'),
+          flag = false;
+        if(m.type_options) {
           _.each(m.type_options, function(o) {
             if ( of_type == o.value ) {
-                if(o.is_collatable)
-                {
-                  flag = true;
-                }
+              if(o.is_collatable)
+              {
+                flag = true;
+              }
             }
           });
-         }
-
-         if (flag) {
-           setTimeout(function(){
-             m.set('collspcname', "", {silent: true});
-           }, 10);
-         }
-         return flag;
+        }
+
+        if (flag) {
+          setTimeout(function(){
+            m.set('collspcname', '', {silent: true});
+          }, 10);
+        }
+        return flag;
       },
-      type: 'text', disabled: false, url: 'get_collations', node: 'type'
+      type: 'text', disabled: false, url: 'get_collations', node: 'type',
     }],
     validate: function() {
-      var err = {},
-          errmsg = null,
-          changedAttrs = this.sessAttrs;
+      var errmsg = null;
+
       // Clearing previous errors first.
       this.errorModel.clear();
       // Validation for member name
       if ( _.isUndefined(this.get('member_name')) ||
         _.isNull(this.get('member_name')) ||
-        String(this.get('member_name')).replace(/^\s+|\s+$/g, '') == '') {
-          errmsg = gettext('Please specify the value for member name.');
-          this.errorModel.set('member_name', errmsg)
-          return errmsg;
+          String(this.get('member_name')).replace(/^\s+|\s+$/g, '') == '') {
+        errmsg = gettext('Please specify the value for member name.');
+        this.errorModel.set('member_name', errmsg);
+        return errmsg;
       }
       else if ( _.isUndefined(this.get('type')) ||
         _.isNull(this.get('type')) ||
-        String(this.get('type')).replace(/^\s+|\s+$/g, '') == '') {
-          errmsg = gettext('Please specify the type.');
-          this.errorModel.set('type', errmsg)
-          return errmsg;
+          String(this.get('type')).replace(/^\s+|\s+$/g, '') == '') {
+        errmsg = gettext('Please specify the type.');
+        this.errorModel.set('type', errmsg);
+        return errmsg;
       }
       // Validation for Length/precision field (see comments above if confused about the naming!)
       else if (this.get('is_tlength')
@@ -207,9 +206,9 @@ define('pgadmin.node.type', [
           errmsg = gettext('Length/precision should not be less than %(value)s', {value: this.get('min_val')});
         if (this.get('tlength') > this.get('max_val') )
           errmsg = gettext('Length/precision should not be greater than %(value)s', {value: this.get('max_val')});
-        // If we have any error set then throw it to user
+          // If we have any error set then throw it to user
         if(errmsg) {
-          this.errorModel.set('tlength', errmsg)
+          this.errorModel.set('tlength', errmsg);
           return errmsg;
         }
       }
@@ -220,14 +219,14 @@ define('pgadmin.node.type', [
           errmsg = gettext('Scale should not be less than %(value)s', {value: this.get('min_val')});
         if (this.get('precision') > this.get('max_val'))
           errmsg = gettext('Scale should not be greater than %(value)s', {value: this.get('max_val')});
-        // If we have any error set then throw it to user
+          // If we have any error set then throw it to user
         if(errmsg) {
-          this.errorModel.set('precision', errmsg)
+          this.errorModel.set('precision', errmsg);
           return errmsg;
         }
       }
       return null;
-    }
+    },
   });
 
   var EnumModel = Backform.EnumModel = pgBrowser.Node.Model.extend({
@@ -238,11 +237,11 @@ define('pgadmin.node.type', [
       id: 'label', label: gettext('Label'),type: 'text', disabled: false,
       cellHeaderClasses: 'width_percent_99', editable: function(m) {
         return _.isUndefined(m.get('label'));
-      }
+      },
     }],
     validate: function() {
       return null;
-    }
+    },
   });
 
   if (!pgBrowser.Nodes['type']) {
@@ -259,7 +258,7 @@ define('pgadmin.node.type', [
       Init: function() {
         /* Avoid multiple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -268,20 +267,20 @@ define('pgadmin.node.type', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Type...'),
           icon: 'wcTabIcon icon-type', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_type', node: 'type', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Type...'),
           icon: 'wcTabIcon icon-type', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_type', node: 'schema', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Type...'),
           icon: 'wcTabIcon icon-type', data: {action: 'create', check: false},
-          enable: 'canCreate'
-        }
+          enable: 'canCreate',
+        },
         ]);
 
       },
@@ -293,17 +292,17 @@ define('pgadmin.node.type', [
           name: undefined,
           oid: undefined,
           is_sys_type: false,
-          typtype: undefined
-       },
+          typtype: undefined,
+        },
 
         // Default values!
         initialize: function(attrs, args) {
           if (_.size(attrs) === 0) {
             var userInfo = pgBrowser.serverInfo[args.node_info.server._id].user,
-                schemaInfo = args.node_info.schema;
+              schemaInfo = args.node_info.schema;
 
             this.set({
-              'typeowner': userInfo.name, 'schema': schemaInfo._label
+              'typeowner': userInfo.name, 'schema': schemaInfo._label,
             }, {silent: true});
           }
           pgBrowser.Node.Model.prototype.initialize.apply(this, arguments);
@@ -312,15 +311,15 @@ define('pgadmin.node.type', [
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
           type: 'text', mode: ['properties', 'create', 'edit'],
-          disabled: 'schemaCheck'
+          disabled: 'schemaCheck',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text' , mode: ['properties'], disabled: true
+          type: 'text' , mode: ['properties'], disabled: true,
         },{
           id: 'typeowner', label: gettext('Owner'), cell: 'string',
           control: 'node-list-by-name',
           type: 'text', mode: ['properties', 'create', 'edit'], node: 'role',
-          disabled: 'inSchema', select2: {allowClear: false}
+          disabled: 'inSchema', select2: {allowClear: false},
         },{
           id: 'schema', label: gettext('Schema'), cell: 'string',
           type: 'text', mode: ['create', 'edit'], node: 'schema',
@@ -332,22 +331,21 @@ define('pgadmin.node.type', [
             }
             return true;
           }, cache_node: 'database', cache_level: 'database',
-          control: 'node-list-by-name', select2: {allowClear: false}
+          control: 'node-list-by-name', select2: {allowClear: false},
         },{
           id: 'typtype', label: gettext('Type'),
           mode: ['create','edit'], disabled: 'inSchemaWithModelCheck',
           group: gettext('Definition'),
-          select2: { width: "50%", allowClear: false },
-          options: function(obj) {
-              return [
-                {label: "Composite", value: "c"},
-                {label: "Enumeration", value: "e"},
-                {label: "External", value: "b"},
-                {label: "Range", value: "r"},
-                {label: "Shell", value: "p"}
-              ]
-           },
-          disabled: 'inSchemaWithModelCheck',
+          select2: { width: '50%', allowClear: false },
+          options: function() {
+            return [
+              {label: 'Composite', value: 'c'},
+              {label: 'Enumeration', value: 'e'},
+              {label: 'External', value: 'b'},
+              {label: 'Range', value: 'r'},
+              {label: 'Shell', value: 'p'},
+            ];
+          },
           // If create mode then by default open composite type
           control: Backform.Select2Control.extend({
             render: function(){
@@ -357,8 +355,8 @@ define('pgadmin.node.type', [
                 this.model.set({'typtype': 'c'});
               }
               return this;
-            }
-          })
+            },
+          }),
         },{
           id: 'composite', label: gettext('Composite Type'),
           model: CompositeModel, editable: true, type: 'collection',
@@ -367,25 +365,25 @@ define('pgadmin.node.type', [
           canAdd: true, canEdit: false, canDelete: true, disabled: 'inSchema',
           deps: ['typtype'],
           visible: function(m) {
-           return m.get('typtype') === 'c';
-          }
+            return m.get('typtype') === 'c';
+          },
         },{
           id: 'enum', label: gettext('Enumeration Type'),
           model: EnumModel, editable: true, type: 'collection',
           group: gettext('Definition'), mode: ['edit', 'create'],
           canAdd: true, canEdit: false, canDelete: function(m) {
-              // We will disable it if it's in 'edit' mode
-              if (m.isNew()) {
-                  return true;
-              } else {
-                  return false;
+            // We will disable it if it's in 'edit' mode
+            if (m.isNew()) {
+              return true;
+            } else {
+              return false;
             }
           },
           disabled: 'inSchema', deps: ['typtype'],
           control: 'unique-col-collection', uniqueCol : ['label'],
           visible: function(m) {
-           return m.get('typtype') === 'e';
-          }
+            return m.get('typtype') === 'e';
+          },
         },{
           // We will disable range type control in edit mode
           type: 'nested', control: 'plain-fieldset', group: gettext('Definition'),
@@ -396,150 +394,150 @@ define('pgadmin.node.type', [
           schema:[{
             id: 'typname', label: gettext('Subtype'), cell: 'string',
             control: 'node-ajax-options',
-            select2: { allowClear: true, placeholder: "", width: "100%" },
+            select2: { allowClear: true, placeholder: '', width: '100%' },
             url: 'get_stypes', type: 'text', mode: ['properties', 'create', 'edit'],
             group: gettext('Range Type'), disabled: 'inSchemaWithModelCheck',
             transform: function(d, self){
               self.model.subtypes =  d;
               return d;
-            }
+            },
           },{
-              id: 'opcname', label: gettext('Subtype operator class'), cell: 'string',
-              mode: ['properties', 'create', 'edit'], group: gettext('Range Type'),
-              disabled: 'inSchemaWithModelCheck', deps: ['typname'],
-              control: 'select', options: function() {
-                var l_typname = this.model.get('typname'),
-                  self = this,
-                  result = [];
-                if(!_.isUndefined(l_typname) && l_typname != '')
-                {
-                  var node = this.field.get('schema_node'),
+            id: 'opcname', label: gettext('Subtype operator class'), cell: 'string',
+            mode: ['properties', 'create', 'edit'], group: gettext('Range Type'),
+            disabled: 'inSchemaWithModelCheck', deps: ['typname'],
+            control: 'select', options: function() {
+              var l_typname = this.model.get('typname'),
+                self = this,
+                result = [];
+              if(!_.isUndefined(l_typname) && l_typname != '')
+              {
+                var node = this.field.get('schema_node'),
                   _url = node.generate_url.apply(
                     node, [
-                            null, 'get_subopclass', this.field.get('node_data'), false,
-                            this.field.get('node_info')
+                      null, 'get_subopclass', this.field.get('node_data'), false,
+                      this.field.get('node_info'),
                     ]);
-                  $.ajax({
-                    async: false,
-                    url: _url,
-                    cache: false,
-                    data: {'typname' : l_typname},
-                    success: function(res) {
-                      result = res.data;
-                    },
-                    error: function() {
-                      self.model.trigger('pgadmin:view:fetch:error', self.model, self.field);
-                    }
-                    });
-                  //
-                }
-                return result;
+                $.ajax({
+                  async: false,
+                  url: _url,
+                  cache: false,
+                  data: {'typname' : l_typname},
+                  success: function(res) {
+                    result = res.data;
+                  },
+                  error: function() {
+                    self.model.trigger('pgadmin:view:fetch:error', self.model, self.field);
+                  },
+                });
+                //
+              }
+              return result;
+            },
+          },{
+            id: 'collname', label: gettext('Collation'), cell: 'string',
+            type: 'text', mode: ['properties', 'create', 'edit'],
+            group: gettext('Range Type'),
+            deps: ['typname'], control: 'node-ajax-options', url: 'get_collations',
+            select2: { allowClear: true, placeholder: '', width: '100%' },
+            disabled: function(m) {
+              if(this.node_info &&  'catalog' in this.node_info)
+              {
+                return true;
               }
-            },{
-              id: 'collname', label: gettext('Collation'), cell: 'string',
-              type: 'text', mode: ['properties', 'create', 'edit'],
-              group: gettext('Range Type'),
-              deps: ['typname'], control: 'node-ajax-options', url: 'get_collations',
-              select2: { allowClear: true, placeholder: "", width: "100%" },
-              disabled: function(m) {
-                if(this.node_info &&  'catalog' in this.node_info)
-                {
-                  return true;
-                }
 
-                // Disbale in edit mode
-                if (!m.isNew()) {
-                  return true;
-                }
+              // Disbale in edit mode
+              if (!m.isNew()) {
+                return true;
+              }
 
-                // To check if collation is allowed?
-                var of_subtype = m.get('typname'),
-                  is_collate = undefined;
-                if(!_.isUndefined(of_subtype)) {
-                  // iterating over all the types
-                  _.each(m.subtypes, function(s) {
-                    // if subtype from selected from combobox matches
-                    if ( of_subtype === s.label ) {
-                        // if collation is allowed for selected subtype
-                        // then enable it else disable it
-                        is_collate = s.is_collate;
-                    }
-                  });
-                }
-                // If is_collate is true then do not disable
-                return is_collate ? false : true;
+              // To check if collation is allowed?
+              var of_subtype = m.get('typname'),
+                is_collate = undefined;
+              if(!_.isUndefined(of_subtype)) {
+                // iterating over all the types
+                _.each(m.subtypes, function(s) {
+                  // if subtype from selected from combobox matches
+                  if ( of_subtype === s.label ) {
+                    // if collation is allowed for selected subtype
+                    // then enable it else disable it
+                    is_collate = s.is_collate;
+                  }
+                });
               }
-            },{
-              id: 'rngcanonical', label: gettext('Canonical function'), cell: 'string',
-              type: 'text', mode: ['properties', 'create', 'edit'],
-              group: gettext('Range Type'),
-              disabled: 'inSchemaWithModelCheck', deps: ['name', 'typname'],
-              control: 'select', options: function() {
-                var name = this.model.get('name'),
-                 self = this,
-                 result = [];
-
-                if(!_.isUndefined(name) && name != '')
-                {
-                  var node = this.field.get('schema_node'),
+              // If is_collate is true then do not disable
+              return is_collate ? false : true;
+            },
+          },{
+            id: 'rngcanonical', label: gettext('Canonical function'), cell: 'string',
+            type: 'text', mode: ['properties', 'create', 'edit'],
+            group: gettext('Range Type'),
+            disabled: 'inSchemaWithModelCheck', deps: ['name', 'typname'],
+            control: 'select', options: function() {
+              var name = this.model.get('name'),
+                self = this,
+                result = [];
+
+              if(!_.isUndefined(name) && name != '')
+              {
+                var node = this.field.get('schema_node'),
                   _url = node.generate_url.apply(
                     node, [
-                            null, 'get_canonical', this.field.get('node_data'), false,
-                            this.field.get('node_info')
+                      null, 'get_canonical', this.field.get('node_data'), false,
+                      this.field.get('node_info'),
                     ]);
-                  $.ajax({
-                    async: false,
-                    url: _url,
-                    cache: false,
-                    data: {"name" : name},
-                    success: function(res) {
-                      result = res.data;
-                    },
-                    error: function() {
-                      self.model.trigger('pgadmin:view:fetch:error',
+                $.ajax({
+                  async: false,
+                  url: _url,
+                  cache: false,
+                  data: {'name' : name},
+                  success: function(res) {
+                    result = res.data;
+                  },
+                  error: function() {
+                    self.model.trigger('pgadmin:view:fetch:error',
                       self.model, self.field);
-                    }
-                    });
-                }
+                  },
+                });
+              }
               return result;
-            }
-            },{
-              id: 'rngsubdiff', label: gettext('Subtype diff function'), cell: 'string',
-              type: 'text', mode: ['properties', 'create', 'edit'],
-              group: gettext('Range Type'),
-              disabled: 'inSchemaWithModelCheck', deps: ['opcname'],
-              control: 'select', options: function() {
-                var l_typname = this.model.get('typname'),
-                  l_opcname = this.model.get('opcname'),
-                  self = this,
-                  result = [];
-
-                if(!_.isUndefined(l_typname) && l_typname != '' &&
+            },
+          },{
+            id: 'rngsubdiff', label: gettext('Subtype diff function'), cell: 'string',
+            type: 'text', mode: ['properties', 'create', 'edit'],
+            group: gettext('Range Type'),
+            disabled: 'inSchemaWithModelCheck', deps: ['opcname'],
+            control: 'select', options: function() {
+              var l_typname = this.model.get('typname'),
+                l_opcname = this.model.get('opcname'),
+                self = this,
+                result = [];
+
+              if(!_.isUndefined(l_typname) && l_typname != '' &&
                 !_.isUndefined(l_opcname) && l_opcname != '') {
-                  var node = this.field.get('schema_node'),
+                var node = this.field.get('schema_node'),
                   _url = node.generate_url.apply(
-                    node, [
-                            null, 'get_stypediff',
-                            this.field.get('node_data'), false,
-                            this.field.get('node_info')
-                    ]);
-                  $.ajax({
-                    async: false,
-                    url: _url,
-                    cache: false,
-                    data: {'typname' : l_typname, 'opcname': l_opcname},
-                    success: function(res) {
-                      result = res.data;
-                    },
-                    error: function() {
-                      self.model.trigger('pgadmin:view:fetch:error',
-                      self.model, self.field);
-                    }
-                    });
-                }
+                      node, [
+                        null, 'get_stypediff',
+                        this.field.get('node_data'), false,
+                        this.field.get('node_info'),
+                      ]);
+                $.ajax({
+                  async: false,
+                  url: _url,
+                  cache: false,
+                  data: {'typname' : l_typname, 'opcname': l_opcname},
+                  success: function(res) {
+                    result = res.data;
+                  },
+                  error: function() {
+                    self.model.trigger('pgadmin:view:fetch:error',
+                        self.model, self.field);
+                  },
+                });
+              }
               return result;
-            }
-          }]
+            },
+          }],
         },{
           type: 'nested', control: 'tab', group: gettext('Definition'),
           label: gettext('External Type'), deps: ['typtype'],
@@ -554,7 +552,7 @@ define('pgadmin.node.type', [
             disabled: 'inSchemaWithModelCheck',
             control: 'node-ajax-options', url: 'get_external_functions',
             transform: 'external_func_combo',
-            select2: { allowClear: true, placeholder: "", width: "100%" }
+            select2: { allowClear: true, placeholder: '', width: '100%' },
           },{
             id: 'typoutput', label: gettext('Output function'),
             cell: 'string',
@@ -563,7 +561,7 @@ define('pgadmin.node.type', [
             disabled: 'inSchemaWithModelCheck'
             ,control: 'node-ajax-options', url: 'get_external_functions',
             transform: 'external_func_combo',
-            select2: { allowClear: true, placeholder: "", width: "100%" }
+            select2: { allowClear: true, placeholder: '', width: '100%' },
           },{
             id: 'typreceive', label: gettext('Receive function'),
             cell: 'string', type: 'text', group: gettext('Optional-1'),
@@ -571,7 +569,7 @@ define('pgadmin.node.type', [
             disabled: 'inSchemaWithModelCheck'
             ,control: 'node-ajax-options', url: 'get_external_functions',
             transform: 'external_func_combo',
-            select2: { allowClear: true, placeholder: "", width: "100%" }
+            select2: { allowClear: true, placeholder: '', width: '100%' },
           },{
             id: 'typsend', label: gettext('Send function'),
             cell: 'string', group: gettext('Optional-1'),
@@ -579,56 +577,56 @@ define('pgadmin.node.type', [
             disabled: 'inSchemaWithModelCheck'
             ,control: 'node-ajax-options', url: 'get_external_functions',
             transform: 'external_func_combo',
-            select2: { allowClear: true, placeholder: "", width: "100%" }
+            select2: { allowClear: true, placeholder: '', width: '100%' },
           },{
             id: 'typmodin', label: gettext('Typmod in function'),
             cell: 'string', type: 'text',
             mode: ['properties', 'create', 'edit'], group: gettext('Optional-1'),
             disabled: 'inSchemaWithModelCheck',
             control: 'node-ajax-options', url: 'get_external_functions',
-            select2: { allowClear: true, placeholder: "", width: "100%" },
+            select2: { allowClear: true, placeholder: '', width: '100%' },
             transform: function(d) {
-              var result = [{label :"", value : ""}];
+              var result = [{label :'', value : ''}];
               _.each(d, function(item) {
-              // if type from selected from combobox matches in options
-              if ( item.cbtype === 'typmodin' || item.cbtype === 'all') {
-                result.push(item);
-              }
-             });
-             return result;
-            }
+                // if type from selected from combobox matches in options
+                if ( item.cbtype === 'typmodin' || item.cbtype === 'all') {
+                  result.push(item);
+                }
+              });
+              return result;
+            },
           },{
             id: 'typmodout', label: gettext('Typmod out function'),
             cell: 'string', group: gettext('Optional-1'),
             type: 'text', mode: ['properties', 'create', 'edit'],
             disabled: 'inSchemaWithModelCheck',
             control: 'node-ajax-options', url: 'get_external_functions',
-            select2: { allowClear: true, placeholder: "", width: "100%" },
+            select2: { allowClear: true, placeholder: '', width: '100%' },
             transform: function(d) {
-              var result = [{label :"", value : ""}];
+              var result = [{label :'', value : ''}];
               _.each(d, function(item) {
-              // if type from selected from combobox matches in options
-              if ( item.cbtype === 'typmodout' || item.cbtype === 'all') {
-                result.push(item);
-              }
-             });
-             return result;
-            }
+                // if type from selected from combobox matches in options
+                if ( item.cbtype === 'typmodout' || item.cbtype === 'all') {
+                  result.push(item);
+                }
+              });
+              return result;
+            },
           },{
             id: 'typlen', label: gettext('Internal length'),
             cell: 'integer', group: gettext('Optional-1'),
             type: 'int', mode: ['properties', 'create', 'edit'],
-            disabled: 'inSchemaWithModelCheck'
+            disabled: 'inSchemaWithModelCheck',
           },{
             id: 'variable', label: gettext('Variable?'), cell: 'switch',
             group: gettext('Optional-1'), type: 'switch',
             mode: ['create','edit'],
-            disabled: 'inSchemaWithModelCheck'
+            disabled: 'inSchemaWithModelCheck',
           },{
             id: 'typdefault', label: gettext('Default?'),
             cell: 'string', group: gettext('Optional-1'),
             type: 'text', mode: ['properties', 'create','edit'],
-            disabled: 'inSchemaWithModelCheck'
+            disabled: 'inSchemaWithModelCheck',
           },{
             id: 'typanalyze', label: gettext('Analyze function'),
             cell: 'string', group: gettext('Optional-1'),
@@ -636,70 +634,70 @@ define('pgadmin.node.type', [
             disabled: 'inSchemaWithModelCheck'
             ,control: 'node-ajax-options', url: 'get_external_functions',
             transform: 'external_func_combo',
-            select2: { allowClear: true, placeholder: "", width: "100%" }
+            select2: { allowClear: true, placeholder: '', width: '100%' },
           },{
             id: 'typcategory', label: gettext('Category type'),
             cell: 'string', group: gettext('Optional-1'),
             type: 'text', mode: ['properties', 'create','edit'],
             disabled: 'inSchemaWithModelCheck', control: 'select2',
-            select2: { allowClear: true, placeholder: "", width: "100%" },
+            select2: { allowClear: true, placeholder: '', width: '100%' },
             options: [
-              {label :"", value : ""},
-              {label :"Array types", value : "A"},
-              {label :"Boolean types", value : "B"},
-              {label :"Composite types", value : "C"},
-              {label :"Date/time types", value : "D"},
-              {label :"Enum types", value : "E"},
-              {label :"Geometric types", value : "G"},
-              {label :"Network address types", value : "I"},
-              {label :"Numeric types", value : "N"},
-              {label :"Pseudo-types", value : "P"},
-              {label :"String types", value : "S"},
-              {label :"Timespan types", value : "T"},
-              {label :"User-defined types", value : "U"},
-              {label :"Bit-string types", value : "V"},
-              {label :"unknown type", value : "X"}
-            ]
+              {label :'', value : ''},
+              {label :'Array types', value : 'A'},
+              {label :'Boolean types', value : 'B'},
+              {label :'Composite types', value : 'C'},
+              {label :'Date/time types', value : 'D'},
+              {label :'Enum types', value : 'E'},
+              {label :'Geometric types', value : 'G'},
+              {label :'Network address types', value : 'I'},
+              {label :'Numeric types', value : 'N'},
+              {label :'Pseudo-types', value : 'P'},
+              {label :'String types', value : 'S'},
+              {label :'Timespan types', value : 'T'},
+              {label :'User-defined types', value : 'U'},
+              {label :'Bit-string types', value : 'V'},
+              {label :'unknown type', value : 'X'},
+            ],
           },{
             id: 'typispreferred', label: gettext('Preferred?'), cell: 'switch',
             type: 'switch', mode: ['properties', 'create','edit'],
             disabled: 'inSchemaWithModelCheck',
-            group: gettext('Optional-1')
+            group: gettext('Optional-1'),
           },{
             id: 'element', label: gettext('Element type'), cell: 'string',
             control: 'node-ajax-options', group: gettext('Optional-2'),
             type: 'text', mode: ['properties', 'create', 'edit'],
-            disabled: 'inSchemaWithModelCheck', url: 'get_types'
+            disabled: 'inSchemaWithModelCheck', url: 'get_types',
           },{
             id: 'typdelim', label: gettext('Delimiter'), cell: 'string',
             type: 'text', mode: ['properties', 'create', 'edit'],
-            group: gettext('Optional-2'), disabled: 'inSchemaWithModelCheck'
+            group: gettext('Optional-2'), disabled: 'inSchemaWithModelCheck',
           },{
             id: 'typalign', label: gettext('Alignment type'),
             cell: 'string', group: gettext('Optional-2'),
             type: 'text', mode: ['properties', 'create', 'edit'],
             disabled: 'inSchemaWithModelCheck', control: 'select2',
-            select2: { allowClear: true, placeholder: "", width: "100%" },
+            select2: { allowClear: true, placeholder: '', width: '100%' },
             options: [
-              {label :"", value : ""},
-              {label: "char", value: "c"},
-              {label: "int2", value: "s"},
-              {label: "int4", value: "i"},
-              {label: "double", value: "d"},
-            ]
+              {label :'', value : ''},
+              {label: 'char', value: 'c'},
+              {label: 'int2', value: 's'},
+              {label: 'int4', value: 'i'},
+              {label: 'double', value: 'd'},
+            ],
           },{
             id: 'typstorage', label: gettext('Storage type'),
             type: 'text', mode: ['properties', 'create', 'edit'],
             group: gettext('Optional-2'), cell: 'string',
             disabled: 'inSchemaWithModelCheck', control: 'select2',
-            select2: { allowClear: true, placeholder: "", width: "100%" },
+            select2: { allowClear: true, placeholder: '', width: '100%' },
             options: [
-              {label :"", value : ""},
-              {label: "PLAIN", value: "p"},
-              {label: "EXTERNAL", value: "e"},
-              {label: "MAIN", value: "m"},
-              {label: "EXTENDED", value: "x"},
-             ]
+              {label :'', value : ''},
+              {label: 'PLAIN', value: 'p'},
+              {label: 'EXTERNAL', value: 'e'},
+              {label: 'MAIN', value: 'm'},
+              {label: 'EXTENDED', value: 'x'},
+            ],
           },{
             id: 'typbyval', label: gettext('Passed by value?'),
             cell: 'switch',
@@ -709,17 +707,17 @@ define('pgadmin.node.type', [
             id: 'is_collatable', label: gettext('Collatable?'),
             cell: 'switch',  min_version: 90100, group: gettext('Optional-2'),
             type: 'switch', mode: ['properties', 'create', 'edit'],
-            disabled: 'inSchemaWithModelCheck'
-          // End of extension tab
-        }]
+            disabled: 'inSchemaWithModelCheck',
+            // End of extension tab
+          }],
         },{
           id: 'alias', label: gettext('Alias'), cell: 'string',
           type: 'text', mode: ['properties'],
-          disabled: 'inSchema'
+          disabled: 'inSchema',
         }, pgBrowser.SecurityGroupSchema,{
           id: 'type_acl', label: gettext('Privileges'), cell: 'string',
           type: 'text', mode: ['properties'], group: 'security',
-          disabled: 'inSchema'
+          disabled: 'inSchema',
         },{
           id: 'member_list', label: gettext('Members'), cell: 'string',
           type: 'text', mode: ['properties'], group: gettext('Definition'),
@@ -728,7 +726,7 @@ define('pgadmin.node.type', [
               return true;
             }
             return false;
-          }
+          },
         },{
           id: 'enum_list', label: gettext('Labels'), cell: 'string',
           type: 'text', mode: ['properties'], group: gettext('Definition'),
@@ -737,20 +735,20 @@ define('pgadmin.node.type', [
               return true;
             }
             return false;
-          }
+          },
         },{
           id: 'is_sys_type', label: gettext('System type?'), cell: 'switch',
           type: 'switch', mode: ['properties'],
-          disabled: 'inSchema'
+          disabled: 'inSchema',
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
           type: 'multiline', mode: ['properties', 'create', 'edit'],
-          disabled: 'inSchema'
+          disabled: 'inSchema',
         },{
           id: 'typacl', label: gettext('Privileges'), type: 'collection',
           group: 'security', control: 'unique-col-collection',
           model: pgBrowser.Node.PrivilegeRoleModel.extend({
-            privileges: ['U']
+            privileges: ['U'],
           }),
           mode: ['edit', 'create'], canDelete: true,
           uniqueCol : ['grantee'], deps: ['typtype'],
@@ -758,12 +756,12 @@ define('pgadmin.node.type', [
             // Do not allow to add when shell type is selected
             // Clear acl & security label collections as well
             if (m.get('typtype') === 'p') {
-                var acl = m.get('typacl');
-                  if(acl.length > 0)
-                    acl.reset();
+              var acl = m.get('typacl');
+              if(acl.length > 0)
+                acl.reset();
             }
             return !(m.get('typtype') === 'p');
-          }
+          },
         },{
           id: 'seclabels', label: gettext('Security Labels'),
           model: pgBrowser.SecLabelModel, editable: false, type: 'collection',
@@ -774,24 +772,23 @@ define('pgadmin.node.type', [
             // Do not allow to add when shell type is selected
             // Clear acl & security label collections as well
             if (m.get('typtype') === 'p') {
-                var secLabs = m.get('seclabels');
-                  if(secLabs.length > 0)
-                    secLabs.reset();
+              var secLabs = m.get('seclabels');
+              if(secLabs.length > 0)
+                secLabs.reset();
             }
             return !(m.get('typtype') === 'p');
-          }
+          },
         }],
         validate: function() {
-        // Validation code for required fields
-          var changedAttrs = this.sessAttrs,
-              msg = undefined;
+          // Validation code for required fields
+          var msg;
 
           this.errorModel.clear();
 
           if (
             _.isUndefined(this.get('name')) ||
-            _.isNull(this.get('name')) ||
-            String(this.get('name')).replace(/^\s+|\s+$/g, '') == ''
+              _.isNull(this.get('name')) ||
+              String(this.get('name')).replace(/^\s+|\s+$/g, '') == ''
           ) {
             msg = gettext('Name cannot be empty.');
             this.errorModel.set('name', msg);
@@ -800,8 +797,8 @@ define('pgadmin.node.type', [
 
           if (
             _.isUndefined(this.get('schema')) ||
-            _.isNull(this.get('schema')) ||
-            String(this.get('schema')).replace(/^\s+|\s+$/g, '') == ''
+              _.isNull(this.get('schema')) ||
+              String(this.get('schema')).replace(/^\s+|\s+$/g, '') == ''
           ) {
             msg = gettext('Schema cannot be empty.');
             this.errorModel.set('schema', msg);
@@ -810,8 +807,8 @@ define('pgadmin.node.type', [
 
           if (
             _.isUndefined(this.get('typtype')) ||
-            _.isNull(this.get('typtype')) ||
-            String(this.get('typtype')).replace(/^\s+|\s+$/g, '') == ''
+              _.isNull(this.get('typtype')) ||
+              String(this.get('typtype')).replace(/^\s+|\s+$/g, '') == ''
           ) {
             msg = gettext('Type cannot be empty.');
             this.errorModel.set('typtype', msg);
@@ -820,37 +817,37 @@ define('pgadmin.node.type', [
 
           // For Range
           if(this.get('typtype') == 'r') {
-              if (
-                _.isUndefined(this.get('typname')) ||
+            if (
+              _.isUndefined(this.get('typname')) ||
                 _.isNull(this.get('typname')) ||
                 String(this.get('typname')).replace(/^\s+|\s+$/g, '') == ''
-              ) {
-                msg = gettext('Subtype name cannot be empty.');
-                this.errorModel.set('typname', msg);
-                return msg;
-              }
+            ) {
+              msg = gettext('Subtype name cannot be empty.');
+              this.errorModel.set('typname', msg);
+              return msg;
+            }
           }
 
           // For External
           if(this.get('typtype') == 'b') {
-              if (
-                _.isUndefined(this.get('typinput')) ||
+            if (
+              _.isUndefined(this.get('typinput')) ||
                 _.isNull(this.get('typinput')) ||
                 String(this.get('typinput')).replace(/^\s+|\s+$/g, '') == ''
-              ) {
-                msg = gettext('Input function cannot be empty.');
-                this.errorModel.set('typinput', msg);
-                return msg;
-              }
-              if (
-                _.isUndefined(this.get('typoutput')) ||
+            ) {
+              msg = gettext('Input function cannot be empty.');
+              this.errorModel.set('typinput', msg);
+              return msg;
+            }
+            if (
+              _.isUndefined(this.get('typoutput')) ||
                 _.isNull(this.get('typoutput')) ||
                 String(this.get('typoutput')).replace(/^\s+|\s+$/g, '') == ''
-              ) {
-                msg = gettext('Output function cannot be empty.');
-                this.errorModel.set('typoutput', msg);
-                return msg;
-              }
+            ) {
+              msg = gettext('Output function cannot be empty.');
+              this.errorModel.set('typoutput', msg);
+              return msg;
+            }
           }
 
           return null;
@@ -904,45 +901,45 @@ define('pgadmin.node.type', [
         },
         // Function will help us to fill combobox
         external_func_combo: function(d) {
-           var result = [];
-           _.each(d, function(item) {
-             // if type from selected from combobox matches in options
-             if ( item.cbtype == 'all' ) {
-               result.push(item);
-             }
-           });
-           return result;
-        }
+          var result = [];
+          _.each(d, function(item) {
+            // if type from selected from combobox matches in options
+            if ( item.cbtype == 'all' ) {
+              result.push(item);
+            }
+          });
+          return result;
+        },
       }),
       canCreate: function(itemData, item, data) {
-          //If check is false then , we will allow create menu
-          if (data && data.check == false)
-            return true;
+        //If check is false then , we will allow create menu
+        if (data && data.check == false)
+          return true;
 
-          var t = pgBrowser.tree, i = item, d = itemData;
-          // To iterate over tree to check parent node
-          while (i) {
-            // If it is schema then allow user to create table
-            if (_.indexOf(['schema'], d._type) > -1)
-              return true;
+        var t = pgBrowser.tree, i = item, d = itemData;
+        // To iterate over tree to check parent node
+        while (i) {
+          // If it is schema then allow user to create table
+          if (_.indexOf(['schema'], d._type) > -1)
+            return true;
 
-            if ('coll-type' == d._type) {
-              //Check if we are not child of catalog
-              var prev_i = t.hasParent(i) ? t.parent(i) : null,
+          if ('coll-type' == d._type) {
+            //Check if we are not child of catalog
+            var prev_i = t.hasParent(i) ? t.parent(i) : null,
               prev_d = prev_i ? t.itemData(prev_i) : null;
-              if( prev_d._type == 'catalog') {
-                return false;
-              } else {
-                return true;
-              }
+            if( prev_d._type == 'catalog') {
+              return false;
+            } else {
+              return true;
             }
-            i = t.hasParent(i) ? t.parent(i) : null;
-            d = i ? t.itemData(i) : null;
           }
-          // by default we do not want to allow create menu
-          return true;
-      }
-  });
+          i = t.hasParent(i) ? t.parent(i) : null;
+          d = i ? t.itemData(i) : null;
+        }
+        // by default we do not want to allow create menu
+        return true;
+      },
+    });
   }
   return pgBrowser.Nodes['type'];
 });
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js
index 95df7875..795bbfcf 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js
@@ -1,8 +1,8 @@
 define('pgadmin.node.mview', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.alertifyjs', 'pgadmin.browser', 'codemirror',
-  'pgadmin.browser.server.privilege'
-], function(gettext, url_for, $, _, S, pgAdmin, alertify, pgBrowser, CodeMirror) {
+  'sources/pgadmin', 'pgadmin.alertifyjs', 'pgadmin.browser',
+  'pgadmin.backform', 'pgadmin.browser.server.privilege',
+], function(gettext, url_for, $, _, pgAdmin, Alertify, pgBrowser, Backform) {
 
   /**
     Create and add a view collection into nodes
@@ -12,12 +12,12 @@ define('pgadmin.node.mview', [
       display under under properties.
    */
   if (!pgBrowser.Nodes['coll-mview']) {
-    var mviews= pgBrowser.Nodes['coll-mview'] =
+    pgBrowser.Nodes['coll-mview'] =
       pgBrowser.Collection.extend({
         node: 'mview',
         label: gettext('Materialized Views'),
         type: 'coll-mview',
-        columns: ['name', 'owner']
+        columns: ['name', 'owner'],
       });
   }
 
@@ -68,7 +68,7 @@ define('pgadmin.node.mview', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 1, icon: 'wcTabIcon icon-mview',
           data: {action: 'create', check: true}, enable: 'canCreate',
-          label: gettext('Materialized View...')
+          label: gettext('Materialized View...'),
         },{
           name: 'create_mview', node: 'mview', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
@@ -80,32 +80,32 @@ define('pgadmin.node.mview', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 18, icon: 'wcTabIcon icon-mview',
           data: {action: 'create', check: false}, enable: 'canCreate',
-          label: gettext('Materialized View...')
+          label: gettext('Materialized View...'),
         },{
           name: 'refresh_mview_data', node: 'mview', module: this,
           priority: 1, callback: 'refresh_mview', category: 'refresh_mview',
           applies: ['object', 'context'], label: gettext('With data'),
-          data: {concurrent: false, with_data: true}, icon: 'fa fa-recycle'
+          data: {concurrent: false, with_data: true}, icon: 'fa fa-recycle',
         },{
           name: 'refresh_mview_nodata', node: 'mview',
           callback: 'refresh_mview', priority: 2, module: this,
           category: 'refresh_mview', applies: ['object', 'context'],
           label: gettext('With no data'), data: {
-            concurrent: false, with_data: false
-          }, icon: 'fa fa-refresh'
+            concurrent: false, with_data: false,
+          }, icon: 'fa fa-refresh',
         },{
           name: 'refresh_mview_concurrent', node: 'mview', module: this,
           category: 'refresh_mview', enable: 'is_version_supported',
           data: {concurrent: true, with_data: true}, priority: 3,
           applies: ['object', 'context'], callback: 'refresh_mview',
-          label: gettext('With data (concurrently)'), icon: 'fa fa-recycle'
+          label: gettext('With data (concurrently)'), icon: 'fa fa-recycle',
         },{
           name: 'refresh_mview_concurrent_nodata', node: 'mview', module: this,
           category: 'refresh_mview', enable: 'is_version_supported',
           data: {concurrent: true, with_data: false}, priority: 4,
           applies: ['object', 'context'], callback: 'refresh_mview',
           label: gettext('With no data (concurrently)'),
-          icon: 'fa fa-refresh'
+          icon: 'fa fa-refresh',
         }]);
       },
 
@@ -117,10 +117,9 @@ define('pgadmin.node.mview', [
         initialize: function(attrs, args) {
           if (_.size(attrs) === 0) {
             // Set Selected Schema and Current User
-            var schemaLabel = args.node_info.schema._label || 'public',
-                userInfo = pgBrowser.serverInfo[args.node_info.server._id].user;
+            var userInfo = pgBrowser.serverInfo[args.node_info.server._id].user;
             this.set({
-              'schema': 'public', 'owner': userInfo.name
+              'schema': 'public', 'owner': userInfo.name,
             }, {silent: true});
           }
           pgBrowser.Node.Model.prototype.initialize.apply(this, arguments);
@@ -128,36 +127,36 @@ define('pgadmin.node.mview', [
         defaults: {
           spcname: undefined,
           toast_autovacuum_enabled: false,
-          autovacuum_enabled: false
+          autovacuum_enabled: false,
         },
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text', disabled: 'inSchema'
+          type: 'text', disabled: 'inSchema',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text', disabled: true, mode: ['properties']
+          type: 'text', disabled: true, mode: ['properties'],
         },{
           id: 'owner', label: gettext('Owner'), cell: 'string',
           control: 'node-list-by-name', select2: { allowClear: false },
-          node: 'role', disabled: 'inSchema'
+          node: 'role', disabled: 'inSchema',
         },{
           id: 'schema', label: gettext('Schema'), cell: 'string', first_empty: false,
           control: 'node-list-by-name', type: 'text', cache_level: 'database',
           node: 'schema', mode: ['create', 'edit'], cache_node: 'database',
-          disabled: 'inSchema', select2: { allowClear: false }
+          disabled: 'inSchema', select2: { allowClear: false },
         },{
           id: 'system_view', label: gettext('System view?'), cell: 'string',
           type: 'switch', disabled: true, mode: ['properties'],
         }, pgBrowser.SecurityGroupSchema, {
           id: 'acl', label: gettext('Privileges'),
-          mode: ['properties'], type: 'text', group: gettext('Security')
+          mode: ['properties'], type: 'text', group: gettext('Security'),
         },{
           id: 'comment', label: gettext('Comment'), cell: 'string',
-          type: 'multiline'
+          type: 'multiline',
         },{
           id: 'definition', label:'', cell: 'string',
           type: 'text', mode: ['create', 'edit'], group: gettext('Definition'),
-          control: Backform.SqlFieldControl, extraClasses:['sql_field_width_full']
+          control: Backform.SqlFieldControl, extraClasses:['sql_field_width_full'],
         },{
           id: 'with_data', label: gettext('With Data'),
           group: gettext('Storage'), mode: ['edit', 'create'],
@@ -167,33 +166,33 @@ define('pgadmin.node.mview', [
           type: 'text', group: gettext('Storage'), first_empty: false,
           control: 'node-list-by-name', node: 'tablespace', select2: { allowClear: false },
           filter: function(m) {
-            if (m.label == "pg_global") return false;
+            if (m.label == 'pg_global') return false;
             else return true;
-          }
+          },
         },{
           id: 'fillfactor', label: gettext('Fill Factor'),
           group: gettext('Storage'), mode: ['edit', 'create'],
-          type: 'int'
+          type: 'int',
         },{
           type: 'nested', control: 'tab', id: 'materialization',
           label: gettext('Parameter'), mode: ['edit', 'create'],
           group: gettext('Parameter'),
-          schema: Backform.VacuumSettingsSchema
+          schema: Backform.VacuumSettingsSchema,
         },{
           // Add Privilege Control
           id: 'datacl', label: gettext('Privileges'), type: 'collection',
           model: pgBrowser.Node.PrivilegeRoleModel.extend({
-            privileges: ['a', 'r', 'w', 'd', 'D', 'x', 't']
+            privileges: ['a', 'r', 'w', 'd', 'D', 'x', 't'],
           }), uniqueCol : ['grantee'], editable: false,
-          group: "security", canAdd: true, canDelete: true,
-          mode: ['edit', 'create'], control: 'unique-col-collection'
+          group: 'security', canAdd: true, canDelete: true,
+          mode: ['edit', 'create'], control: 'unique-col-collection',
         },{
         // Add Security Labels Control
           id: 'seclabels', label: gettext('Security Labels'),
           model: pgBrowser.SecLabelModel, editable: false, type: 'collection',
-          canEdit: false, group: "security", canDelete: true,
+          canEdit: false, group: 'security', canDelete: true,
           mode: ['edit', 'create'], canAdd: true,
-          control: 'unique-col-collection', uniqueCol : ['provider']
+          control: 'unique-col-collection', uniqueCol : ['provider'],
         }],
         validate: function(keys) {
 
@@ -204,7 +203,7 @@ define('pgadmin.node.mview', [
             field_def = this.get('definition');
           if (_.indexOf(keys, 'autovacuum_enabled') != -1 ||
               _.indexOf(keys, 'toast_autovacuum_enabled') != -1 )
-              return null;
+            return null;
 
           if (_.isUndefined(field_name) || _.isNull(field_name) ||
             String(field_name).replace(/^\s+|\s+$/g, '') == '') {
@@ -233,7 +232,7 @@ define('pgadmin.node.mview', [
             return true;
           }
           return false;
-        }
+        },
 
       }),
 
@@ -275,27 +274,27 @@ define('pgadmin.node.mview', [
         return true;
       },
       refresh_mview: function(args) {
-          var input = args || {},
-              obj = this,
-              t = pgBrowser.tree,
-              i = input.item || t.selected(),
-              d = i && i.length == 1 ? t.itemData(i) : undefined;
+        var input = args || {},
+          obj = this,
+          t = pgBrowser.tree,
+          i = input.item || t.selected(),
+          d = i && i.length == 1 ? t.itemData(i) : undefined;
 
-          if (!d)
-            return false;
+        if (!d)
+          return false;
 
         // Make ajax call to refresh mview data
         $.ajax({
           url: obj.generate_url(i, 'refresh_data' , d, true),
           type: 'PUT',
           data: {'concurrent': args.concurrent, 'with_data': args.with_data},
-          dataType: "json",
+          dataType: 'json',
           success: function(res) {
             if (res.success == 1) {
-              alertify.success(gettext('View refreshed successfully'));
+              Alertify.success(gettext('View refreshed successfully'));
             }
             else {
-              alertify.alert(
+              Alertify.alert(
                 gettext('Error refreshing view'),
                   res.data.result
               );
@@ -303,22 +302,22 @@ define('pgadmin.node.mview', [
           },
           error: function(e) {
             var errmsg = $.parseJSON(e.responseText);
-            alertify.alert(gettext('Error refreshing view'), errmsg.errormsg);
-          }
+            Alertify.alert(gettext('Error refreshing view'), errmsg.errormsg);
+          },
         });
 
       },
-      is_version_supported: function(data, item, args) {
+      is_version_supported: function(data, item) {
         var t = pgAdmin.Browser.tree,
-            i = item || t.selected(),
-            d = data || (i && i.length == 1 ? t.itemData(i): undefined),
-            node = this || (d && pgAdmin.Browser.Nodes[d._type]),
-            info = node.getTreeNodeHierarchy.apply(node, [i]),
-            version = info.server.version;
+          i = item || t.selected(),
+          d = data || (i && i.length == 1 ? t.itemData(i): undefined),
+          node = this || (d && pgAdmin.Browser.Nodes[d._type]),
+          info = node.getTreeNodeHierarchy.apply(node, [i]),
+          version = info.server.version;
 
         // disable refresh concurrently if server version is 9.3
         return (version >= 90400);
-      }
+      },
     });
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/view.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/view.js
index 245aea92..5755a509 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/view.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/view.js
@@ -1,9 +1,9 @@
 define('pgadmin.node.view', [
   'sources/gettext',
-  'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'sources/pgadmin',
-  'pgadmin.browser', 'codemirror', 'pgadmin.browser.server.privilege',
-  'pgadmin.node.rule'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, CodeMirror) {
+  'sources/url_for', 'jquery', 'underscore', 'sources/pgadmin',
+  'pgadmin.browser', 'pgadmin.backform', 'pgadmin.browser.server.privilege',
+  'pgadmin.node.rule',
+], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform) {
 
   /**
     Create and add a view collection into nodes
@@ -13,12 +13,12 @@ define('pgadmin.node.view', [
       display under under properties.
    */
   if (!pgBrowser.Nodes['coll-view']) {
-    var views= pgBrowser.Nodes['coll-view'] =
+    pgBrowser.Nodes['coll-view'] =
       pgBrowser.Collection.extend({
         node: 'view',
         label: gettext('Views'),
         type: 'coll-view',
-        columns: ["name", "owner"]
+        columns: ['name', 'owner'],
       });
   }
 
@@ -55,78 +55,78 @@ define('pgadmin.node.view', [
 
         this.initialized = true;
 
-        /**
+          /**
           Add "create view" menu option into context and object menu
           for the following nodes:
           coll-view, view and schema.
           @property {data} - Allow create view option on schema node or
           system view nodes.
-         */
+          */
         pgBrowser.add_menus([{
           name: 'create_view_on_coll', node: 'coll-view', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 1, label: gettext('View...'),
           icon: 'wcTabIcon icon-view', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_view', node: 'view', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 1, label: gettext('View...'),
           icon: 'wcTabIcon icon-view', data: {action: 'create', check: true},
-          enable: 'canCreate'
+          enable: 'canCreate',
         },{
           name: 'create_view', node: 'schema', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 17, label: gettext('View...'),
           icon: 'wcTabIcon icon-view', data: {action: 'create', check: false},
-          enable: 'canCreate'
-        }
+          enable: 'canCreate',
+        },
         ]);
       },
 
       /**
         Define model for the view node and specify the
         properties of the model in schema.
-       */
+        */
       model: pgBrowser.Node.Model.extend({
         initialize: function(attrs, args) {
           if (_.size(attrs) === 0) {
             // Set Selected Schema and, Current User
             var schemaLabel = args.node_info.schema._label || 'public',
-                userInfo = pgBrowser.serverInfo[args.node_info.server._id].user;
+              userInfo = pgBrowser.serverInfo[args.node_info.server._id].user;
             this.set({
-              'schema': schemaLabel, 'owner': userInfo.name
+              'schema': schemaLabel, 'owner': userInfo.name,
             }, {silent: true});
           }
           pgBrowser.Node.Model.prototype.initialize.apply(this, arguments);
         },
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text', disabled: 'notInSchema'
+          type: 'text', disabled: 'notInSchema',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text', disabled: true, mode: ['properties']
+          type: 'text', disabled: true, mode: ['properties'],
         },{
           id: 'owner', label: gettext('Owner'), cell: 'string', control: 'node-list-by-name',
-          node: 'role', disabled: 'notInSchema', select2: { allowClear: false }
+          node: 'role', disabled: 'notInSchema', select2: { allowClear: false },
         },{
           id: 'schema', label: gettext('Schema'), cell: 'string', first_empty: false,
           control: 'node-list-by-name', type: 'text', cache_level: 'database',
           node: 'schema', disabled: 'notInSchema', mode: ['create', 'edit'],
-          select2: { allowClear: false }, cache_node: 'database'
+          select2: { allowClear: false }, cache_node: 'database',
         },{
           id: 'system_view', label: gettext('System view?'), cell: 'string',
-          type: 'switch', disabled: true, mode: ['properties']
+          type: 'switch', disabled: true, mode: ['properties'],
         },{
           id: 'acl', label: gettext('Privileges'),
-          mode: ['properties'], type: 'text', group: gettext('Security')
+          mode: ['properties'], type: 'text', group: gettext('Security'),
         },{
           id: 'comment', label: gettext('Comment'), cell: 'string',
-          type: 'multiline', disabled: 'notInSchema'
+          type: 'multiline', disabled: 'notInSchema',
         },{
           id: 'security_barrier', label: gettext('Security barrier'),
           type: 'switch', min_version: '90200', group: gettext('Definition'),
-          disabled: 'notInSchema'
+          disabled: 'notInSchema',
         },{
           id: 'check_option', label: gettext('Check options'),
           control: 'select2', group: gettext('Definition'), type: 'text',
@@ -136,32 +136,32 @@ define('pgadmin.node.view', [
             allowClear: false,
           }, disabled: 'notInSchema',
           options:[{
-            label: gettext("No"), value: "no"
+            label: gettext('No'), value: 'no',
           },{
-            label: gettext("Local"), value: "local"
+            label: gettext('Local'), value: 'local',
           },{
-            label: gettext("Cascaded"), value: "cascaded"
-          }]
+            label: gettext('Cascaded'), value: 'cascaded',
+          }],
         },{
           id: 'definition', label: gettext('Definition'), cell: 'string',
           type: 'text', mode: ['create', 'edit'], group: gettext('Definition'),
           control: Backform.SqlFieldControl,
-          disabled: 'notInSchema'
+          disabled: 'notInSchema',
         }, pgBrowser.SecurityGroupSchema, {
           // Add Privilege Control
           id: 'datacl', label: gettext('Privileges'), type: 'collection',
           model: pgBrowser.Node.PrivilegeRoleModel.extend({
-            privileges: ['a', 'r', 'w', 'd', 'D', 'x', 't']
+            privileges: ['a', 'r', 'w', 'd', 'D', 'x', 't'],
           }), uniqueCol : ['grantee'], editable: false, group: 'security',
           mode: ['edit', 'create'], canAdd: true, canDelete: true,
-          control: 'unique-col-collection', disabled: 'notInSchema'
+          control: 'unique-col-collection', disabled: 'notInSchema',
         },{
           // Add Security Labels Control
           id: 'seclabels', label: gettext('Security labels'),
           model: pgBrowser.SecLabelModel, editable: false, type: 'collection',
           canEdit: false, group: 'security', canDelete: true,
           mode: ['edit', 'create'], canAdd: true, disabled: 'notInSchema',
-          control: 'unique-col-collection', uniqueCol : ['provider']
+          control: 'unique-col-collection', uniqueCol : ['provider'],
         }],
         validate: function() {
           // Triggers specific error messages for fields
@@ -195,13 +195,13 @@ define('pgadmin.node.view', [
             return true;
           }
           return false;
-        }
+        },
       }),
 
       /**
         Show or hide create view menu option on parent node
         and hide for system view in catalogs.
-       */
+        */
       canCreate: function(itemData, item, data) {
 
         // If check is false then, we will allow create menu
@@ -235,8 +235,8 @@ define('pgadmin.node.view', [
         // by default we do not want to allow create menu
         return true;
 
-      }
-  });
+      },
+    });
   }
 
   return pgBrowser.Nodes['view'];
diff --git a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js
index 4c6c764d..4d5d5140 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js
@@ -1,21 +1,21 @@
 define('pgadmin.node.database', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser.utils', 'pgadmin.alertifyjs',
-  'pgadmin.browser.collection', 'pgadmin.browser.server.privilege',
-  'pgadmin.browser.server.variable'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify) {
+  'underscore.string', 'sources/pgadmin', 'pgadmin.browser.utils',
+  'pgadmin.alertifyjs', 'pgadmin.backform', 'pgadmin.browser.collection',
+  'pgadmin.browser.server.privilege', 'pgadmin.browser.server.variable',
+], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify, Backform) {
 
   if (!pgBrowser.Nodes['coll-database']) {
-    var databases = pgBrowser.Nodes['coll-database'] =
+    pgBrowser.Nodes['coll-database'] =
       pgBrowser.Collection.extend({
         node: 'database',
         label: gettext('Databases'),
         type: 'coll-database',
         columns: ['name', 'datowner', 'comments'],
         hasStatistics: true,
-        statsPrettifyFields: ['Size', 'Size of temporary files']
+        statsPrettifyFields: ['Size', 'Size of temporary files'],
       });
-  };
+  }
 
   if (!pgBrowser.Nodes['database']) {
     pgBrowser.Nodes['database'] = pgBrowser.Node.extend({
@@ -38,7 +38,7 @@ define('pgadmin.node.database', [
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -47,29 +47,29 @@ define('pgadmin.node.database', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Database...'),
           icon: 'wcTabIcon pg-icon-database', data: {action: 'create'},
-          enable: 'can_create_database'
+          enable: 'can_create_database',
         },{
           name: 'create_database_on_coll', node: 'coll-database', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Database...'),
           icon: 'wcTabIcon pg-icon-database', data: {action: 'create'},
-          enable: 'can_create_database'
+          enable: 'can_create_database',
         },{
           name: 'create_database', node: 'database', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Database...'),
           icon: 'wcTabIcon pg-icon-database', data: {action: 'create'},
-          enable: 'can_create_database'
+          enable: 'can_create_database',
         },{
           name: 'connect_database', node: 'database', module: this,
           applies: ['object', 'context'], callback: 'connect_database',
           category: 'connect', priority: 4, label: gettext('Connect Database...'),
-          icon: 'fa fa-link', enable : 'is_not_connected'
+          icon: 'fa fa-link', enable : 'is_not_connected',
         },{
           name: 'disconnect_database', node: 'database', module: this,
           applies: ['object', 'context'], callback: 'disconnect_database',
           category: 'drop', priority: 5, label: gettext('Disconnect Database...'),
-          icon: 'fa fa-chain-broken', enable : 'is_connected'
+          icon: 'fa fa-chain-broken', enable : 'is_connected',
         }]);
 
         _.bindAll(this, 'connection_lost');
@@ -79,7 +79,7 @@ define('pgadmin.node.database', [
       },
       can_create_database: function(node, item) {
         var treeData = this.getTreeNodeHierarchy(item),
-            server = treeData['server'];
+          server = treeData['server'];
 
         return server.connected && server.user.can_create_db;
       },
@@ -90,16 +90,13 @@ define('pgadmin.node.database', [
         return (node && node.connected == true && node.canDisconn == true);
       },
       is_conn_allow: function(node) {
-        return (node && node.allowConn == true)
+        return (node && node.allowConn == true);
       },
       connection_lost: function(i, resp, server_connected) {
         if (pgBrowser.tree) {
           var t = pgBrowser.tree,
-              info = i && this.getTreeNodeHierarchy(i),
-              s = null,
-              d = i && t.itemData(i),
-              self = this,
-              _i = i;
+            d = i && t.itemData(i),
+            self = this;
 
           while (d && d._type != 'database') {
             i = t.parent(i);
@@ -112,21 +109,21 @@ define('pgadmin.node.database', [
               d.is_connecting = true;
 
               var disconnect = function(_i, _d) {
-                    if (_d._id == this._id) {
-                      d.is_connecting = false;
-                      pgBrowser.Events.off(
-                        'pgadmin:database:connect:cancelled', disconnect
-                      );
-                      _i = _i && t.parent(_i);
-                      _d = _i && t.itemData(_i);
-                      if (_i && _d) {
-                        pgBrowser.Events.trigger(
-                          'pgadmin:server:disconnect',
-                          {item: _i, data: _d}, false
-                        );
-                      }
-                    }
-                  };
+                if (_d._id == this._id) {
+                  d.is_connecting = false;
+                  pgBrowser.Events.off(
+                    'pgadmin:database:connect:cancelled', disconnect
+                  );
+                  _i = _i && t.parent(_i);
+                  _d = _i && t.itemData(_i);
+                  if (_i && _d) {
+                    pgBrowser.Events.trigger(
+                      'pgadmin:server:disconnect',
+                      {item: _i, data: _d}, false
+                    );
+                  }
+                }
+              };
 
               pgBrowser.Events.on(
                 'pgadmin:database:connect:cancelled', disconnect
@@ -157,13 +154,13 @@ define('pgadmin.node.database', [
       callbacks: {
         /* Connect the database */
         connect_database: function(args){
-          var input = args || {};
-          obj = this,
-          t = pgBrowser.tree,
-          i = input.item || t.selected(),
-          d = i && i.length == 1 ? t.itemData(i) : undefined;
+          var input = args || {},
+            obj = this,
+            t = pgBrowser.tree,
+            i = input.item || t.selected(),
+            d = i && i.length == 1 ? t.itemData(i) : undefined;
 
-          if (!d || d.label == "template0")
+          if (!d || d.label == 'template0')
             return false;
 
           connect_to_database(obj, d, t, i, true);
@@ -183,7 +180,7 @@ define('pgadmin.node.database', [
           Alertify.confirm(
             gettext('Disconnect the database'),
             S(gettext('Are you sure you want to disconnect the database - %s?')).sprintf(d.label).value(),
-            function(evt) {
+            function() {
               var data = d;
               $.ajax({
                 url: obj.generate_url(i, 'connect', d, true),
@@ -199,38 +196,39 @@ define('pgadmin.node.database', [
                     t.unload(i);
                     t.setInode(i);
                     setTimeout(function() {
-                        t.select(prv_i);
+                      t.select(prv_i);
                     }, 10);
 
-                  }
-                  else {
+                  } else {
                     try {
                       Alertify.error(res.errormsg);
-                    } catch (e) {}
+                    } catch (e) {
+                      console.warn(e.stack || e);
+                    }
                     t.unload(i);
                   }
                 },
-                error: function(xhr, status, error) {
+                error: function(xhr) {
                   try {
                     var err = $.parseJSON(xhr.responseText);
                     if (err.success == 0) {
                       Alertify.error(err.errormsg);
                     }
-                  } catch (e) {}
+                  } catch (e) {
+                    console.warn(e.stack || e);
+                  }
                   t.unload(i);
-                }
+                },
               });
-          },
-          function(evt) {
-              return true;
-          });
+            },
+            function() { return true; });
 
           return false;
         },
 
         /* Connect the database (if not connected), before opening this node */
         beforeopen: function(item, data) {
-          if(!data || data._type != 'database' || data.label == "template0") {
+          if(!data || data._type != 'database' || data.label == 'template0') {
             return false;
           }
 
@@ -257,14 +255,13 @@ define('pgadmin.node.database', [
         },
 
         refresh: function(cmd, i) {
-          var self = this,
-              t = pgBrowser.tree,
-              item = i || t.selected(),
-              d = t.itemData(item);
+          var t = pgBrowser.tree,
+            item = i || t.selected(),
+            d = t.itemData(item);
 
           if (!d.allowConn) return;
           pgBrowser.Node.callbacks.refresh.apply(this, arguments);
-        }
+        },
       },
       model: pgBrowser.Node.Model.extend({
         defaults: {
@@ -286,7 +283,7 @@ define('pgadmin.node.database', [
           deffuncacl: [],
           defseqacl: [],
           is_template: false,
-          deftypeacl: []
+          deftypeacl: [],
         },
 
         // Default values!
@@ -302,37 +299,37 @@ define('pgadmin.node.database', [
 
         schema: [{
           id: 'name', label: gettext('Database'), cell: 'string',
-          editable: false, type: 'text'
+          editable: false, type: 'text',
         },{
           id: 'did', label: gettext('OID'), cell: 'string', mode: ['properties'],
-          editable: false, type: 'text'
+          editable: false, type: 'text',
         },{
           id: 'datowner', label: gettext('Owner'),
           editable: false, type: 'text', node: 'role',
-          control: Backform.NodeListByNameControl, select2: { allowClear: false }
+          control: Backform.NodeListByNameControl, select2: { allowClear: false },
         },{
           id: 'acl', label: gettext('Privileges'), type: 'text',
-          group: gettext('Security'), mode: ['properties'], disabled: true
+          group: gettext('Security'), mode: ['properties'], disabled: true,
         },{
           id: 'tblacl', label: gettext('Default TABLE privileges'), type: 'text',
-          group: gettext('Security'), mode: ['properties'], disabled: true
+          group: gettext('Security'), mode: ['properties'], disabled: true,
         },{
           id: 'seqacl', label: gettext('Default SEQUENCE privileges'), type: 'text',
-          group: gettext('Security'), mode: ['properties'], disabled: true
+          group: gettext('Security'), mode: ['properties'], disabled: true,
         },{
           id: 'funcacl', label: gettext('Default FUNCTION privileges'), type: 'text',
-          group: gettext('Security'), mode: ['properties'], disabled: true
+          group: gettext('Security'), mode: ['properties'], disabled: true,
         },{
           id: 'typeacl', label: gettext('Default TYPE privileges'), type: 'text',
-          group: gettext('Security'), mode: ['properties'], disabled: true, min_version: 90200
+          group: gettext('Security'), mode: ['properties'], disabled: true, min_version: 90200,
         },{
           id: 'comments', label: gettext('Comment'),
-          editable: false, type: 'multiline'
+          editable: false, type: 'multiline',
         },{
           id: 'encoding', label: gettext('Encoding'),
           editable: false, type: 'text', group: gettext('Definition'),
           disabled: function(m) { return !m.isNew(); }, url: 'get_encodings',
-          control: 'node-ajax-options', cache_level: 'server'
+          control: 'node-ajax-options', cache_level: 'server',
         },{
           id: 'template', label: gettext('Template'),
           editable: false, type: 'text', group: gettext('Definition'),
@@ -341,8 +338,8 @@ define('pgadmin.node.database', [
           select2: { allowClear: false }, mode: ['create'],
           transform: function(data, cell) {
             var res = [],
-                control = cell || this,
-                label = control.model.get('name');
+              control = cell || this,
+              label = control.model.get('name');
 
             if (!control.model.isNew()) {
               res.push({label: label, value: label});
@@ -351,34 +348,34 @@ define('pgadmin.node.database', [
               if (data && _.isArray(data)) {
                 _.each(data, function(d) {
                   res.push({label: d.label, value: d.label,
-                            image: 'pg-icon-database'});
-                })
+                    image: 'pg-icon-database'});
+                });
               }
             }
             return res;
-          }
+          },
         },{
           id: 'spcname', label: gettext('Tablespace'),
           editable: false, type: 'text', group: gettext('Definition'),
           control: 'node-list-by-name', node: 'tablespace',
           select2: { allowClear: false },
           filter: function(m) {
-            if (m.label == "pg_global") return false;
+            if (m.label == 'pg_global') return false;
             else return true;
-          }
+          },
         },{
           id: 'datcollate', label: gettext('Collation'),
           editable: false, type: 'text', group: gettext('Definition'),
           disabled: function(m) { return !m.isNew(); }, url: 'get_ctypes',
-          control: 'node-ajax-options', cache_level: 'server'
+          control: 'node-ajax-options', cache_level: 'server',
         },{
           id: 'datctype', label: gettext('Character type'),
           editable: false, type: 'text', group: gettext('Definition'),
           disabled: function(m) { return !m.isNew(); }, url: 'get_ctypes',
-          control: 'node-ajax-options', cache_level: 'server'
+          control: 'node-ajax-options', cache_level: 'server',
         },{
           id: 'datconnlimit', label: gettext('Connection limit'),
-          editable: false, type: 'int', group: gettext('Definition'), min: -1
+          editable: false, type: 'int', group: gettext('Definition'), min: -1,
         },{
           id: 'is_template', label: gettext('Template?'),
           editable: false, type: 'switch', group: gettext('Definition'),
@@ -386,8 +383,8 @@ define('pgadmin.node.database', [
           options: {
             'onText': gettext('Yes'), 'offText': gettext('No'),
             'onColor': 'success', 'offColor': 'primary',
-            'size': 'small'
-          }
+            'size': 'small',
+          },
         },{
           id: 'datallowconn', label: gettext('Allow connections?'),
           editable: false, type: 'switch', group: gettext('Definition'),
@@ -395,12 +392,12 @@ define('pgadmin.node.database', [
           options: {
             'onText': gettext('Yes'), 'offText': gettext('No'),
             'onColor': 'success', 'offColor': 'primary',
-            'size': 'small'
-          }
+            'size': 'small',
+          },
         },{
           id: 'datacl', label: gettext('Privileges'), type: 'collection',
           model: pgBrowser.Node.PrivilegeRoleModel.extend({
-            privileges: ['C', 'T', 'c']
+            privileges: ['C', 'T', 'c'],
           }), uniqueCol : ['grantee', 'grantor'], editable: false,
           group: gettext('Security'), mode: ['edit', 'create'],
           canAdd: true, canDelete: true, control: 'unique-col-collection',
@@ -409,7 +406,7 @@ define('pgadmin.node.database', [
           model: pgBrowser.Node.VariableModel.extend({keys:['name', 'role']}), editable: false,
           group: gettext('Parameters'), mode: ['edit', 'create'],
           canAdd: true, canEdit: false, canDelete: true, hasRole: true,
-          control: Backform.VariableCollectionControl, node: 'role'
+          control: Backform.VariableCollectionControl, node: 'role',
         },{
           id: 'seclabels', label: gettext('Security Labels'),
           model: pgBrowser.SecLabelModel,
@@ -417,43 +414,43 @@ define('pgadmin.node.database', [
           group: gettext('Security'), canDelete: true,
           mode: ['edit', 'create'], canAdd: true,
           control: 'unique-col-collection', uniqueCol : ['provider'],
-          min_version: 90200
+          min_version: 90200,
         },{
           type: 'nested', control: 'tab', group: gettext('Default Privileges'),
           mode: ['edit'],
           schema:[{
-              id: 'deftblacl', model: pgBrowser.Node.PrivilegeRoleModel.extend(
+            id: 'deftblacl', model: pgBrowser.Node.PrivilegeRoleModel.extend(
               {privileges: ['a', 'r', 'w', 'd', 'D', 'x', 't']}), label: gettext('Default Privileges: Tables'),
-              editable: false, type: 'collection', group: gettext('Tables'),
-              mode: ['edit', 'create'], control: 'unique-col-collection',
-              canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor']
-            },{
-              id: 'defseqacl', model: pgBrowser.Node.PrivilegeRoleModel.extend(
+            editable: false, type: 'collection', group: gettext('Tables'),
+            mode: ['edit', 'create'], control: 'unique-col-collection',
+            canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor'],
+          },{
+            id: 'defseqacl', model: pgBrowser.Node.PrivilegeRoleModel.extend(
               {privileges: ['r', 'w', 'U']}), label: gettext('Default Privileges: Sequences'),
-              editable: false, type: 'collection', group: gettext('Sequences'),
-              mode: ['edit', 'create'], control: 'unique-col-collection',
-              canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor']
-            },{
-              id: 'deffuncacl', model: pgBrowser.Node.PrivilegeRoleModel.extend(
+            editable: false, type: 'collection', group: gettext('Sequences'),
+            mode: ['edit', 'create'], control: 'unique-col-collection',
+            canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor'],
+          },{
+            id: 'deffuncacl', model: pgBrowser.Node.PrivilegeRoleModel.extend(
               {privileges: ['X']}), label: gettext('Default Privileges: Functions'),
-              editable: false, type: 'collection', group: gettext('Functions'),
-              mode: ['edit', 'create'], control: 'unique-col-collection',
-              canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor']
-            },{
-              id: 'deftypeacl', model: pgBrowser.Node.PrivilegeRoleModel.extend(
+            editable: false, type: 'collection', group: gettext('Functions'),
+            mode: ['edit', 'create'], control: 'unique-col-collection',
+            canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor'],
+          },{
+            id: 'deftypeacl', model: pgBrowser.Node.PrivilegeRoleModel.extend(
               {privileges: ['U']}),  label: gettext('Default Privileges: Types'),
-              editable: false, type: 'collection', group: 'deftypesacl_group',
-              mode: ['edit', 'create'], control: 'unique-col-collection',
-              canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor'],
-              min_version: 90200
-            },{
-              id: 'deftypesacl_group', type: 'group', label: gettext('Types'),
-              mode: ['edit', 'create'], min_version: 90200
-            }
-          ]
-        }
+            editable: false, type: 'collection', group: 'deftypesacl_group',
+            mode: ['edit', 'create'], control: 'unique-col-collection',
+            canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor'],
+            min_version: 90200,
+          },{
+            id: 'deftypesacl_group', type: 'group', label: gettext('Types'),
+            mode: ['edit', 'create'], min_version: 90200,
+          },
+          ],
+        },
         ],
-        validate: function(keys) {
+        validate: function() {
           var name = this.get('name');
           if (_.isUndefined(name) || _.isNull(name) ||
             String(name).replace(/^\s+|\s+$/g, '') == '') {
@@ -464,8 +461,8 @@ define('pgadmin.node.database', [
             this.errorModel.unset('name');
           }
           return null;
-        }
-      })
+        },
+      }),
     });
 
     pgBrowser.SecurityGroupSchema = {
@@ -479,15 +476,14 @@ define('pgadmin.node.database', [
           return 'catalog' in node_info ? false : true;
         }
         return true;
-      }
+      },
     };
 
-    function connect_to_database(obj, data, tree, item, interactive) {
-        connect(obj, data, tree, item)
-    }
-
-    function connect(obj, data, tree, item, _wasConnected) {
-      var wasConnected = _wasConnected || data.connected,
+    var connect_to_database = function(obj, data, tree, item) {
+        connect(obj, data, tree, item);
+      },
+      connect = function (obj, data, tree, item, _wasConnected) {
+        var wasConnected = _wasConnected || data.connected,
           onFailure = function(
             xhr, status, error, _model, _data, _tree, _item, _status
           ) {
@@ -539,7 +535,7 @@ define('pgadmin.node.database', [
               }
             }
           },
-          onCancel = function(_tree, _item, _data, _status) {
+          onCancel = function(_tree, _item, _data) {
             _data.is_connecting = false;
             var server = _tree.parent(_item);
             _tree.unload(_item);
@@ -553,18 +549,18 @@ define('pgadmin.node.database', [
             _tree.select(server);
           };
 
-      $.post(
-        obj.generate_url(item, "connect", data, true)
-      ).done(function(res) {
-        if (res.success == 1) {
-          return onSuccess(res, obj, data, tree, item, wasConnected);
-        }
-      }).fail(function(xhr, status, error) {
-        return onFailure(
-          xhr, status, error, obj, data, tree, item, wasConnected
-        );
-      });
-    }
+        $.post(
+          obj.generate_url(item, 'connect', data, true)
+        ).done(function(res) {
+          if (res.success == 1) {
+            return onSuccess(res, obj, data, tree, item, wasConnected);
+          }
+        }).fail(function(xhr, status, error) {
+          return onFailure(
+            xhr, status, error, obj, data, tree, item, wasConnected
+          );
+        });
+      };
   }
 
   return pgBrowser.Nodes['coll-database'];
diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/schedules/static/js/pga_schedule.js b/web/pgadmin/browser/server_groups/servers/pgagent/schedules/static/js/pga_schedule.js
index 58943022..6972dca0 100644
--- a/web/pgadmin/browser/server_groups/servers/pgagent/schedules/static/js/pga_schedule.js
+++ b/web/pgadmin/browser/server_groups/servers/pgagent/schedules/static/js/pga_schedule.js
@@ -1,8 +1,11 @@
 define('pgadmin.node.pga_schedule', [
-    'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-    'underscore.string', 'sources/pgadmin', 'moment', 'pgadmin.browser', 'alertify',
-    'backform', 'pgadmin.backform'
-], function(gettext, url_for, $, _, S, pgAdmin, moment, pgBrowser, Alertify, Backform) {
+  'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
+  'underscore.string', 'sources/pgadmin', 'moment', 'pgadmin.browser', 'alertify',
+  'pgadmin.backform', 'pgadmin.backgrid',
+], function(
+  gettext, url_for, $, _, S, pgAdmin, moment, pgBrowser, Alertify, Backform,
+  Backgrid
+) {
 
   if (!pgBrowser.Nodes['coll-pga_schedule']) {
     pgBrowser.Nodes['coll-pga_schedule'] =
@@ -11,7 +14,7 @@ define('pgadmin.node.pga_schedule', [
         label: gettext('Schedules'),
         type: 'coll-pga_schedule',
         columns: ['jscid', 'jscname', 'jscenabled'],
-        hasStatistics: false
+        hasStatistics: false,
       });
   }
 
@@ -20,7 +23,7 @@ define('pgadmin.node.pga_schedule', [
     var weekdays = [
         gettext('Sunday'), gettext('Monday'), gettext('Tuesday'),
         gettext('Wednesday'), gettext('Thursday'), gettext('Friday'),
-        gettext('Saturday')
+        gettext('Saturday'),
       ],
       monthdays = [
         gettext('1st'), gettext('2nd'), gettext('3rd'),
@@ -33,13 +36,13 @@ define('pgadmin.node.pga_schedule', [
         gettext('22nd'), gettext('23rd'), gettext('24th'),
         gettext('25th'), gettext('26th'), gettext('27th'),
         gettext('28th'), gettext('29th'), gettext('30th'),
-        gettext('31st'), gettext('Last day')
+        gettext('31st'), gettext('Last day'),
       ],
       months = [
         gettext('January'), gettext('February'), gettext('March'),
         gettext('April'), gettext('May'), gettext('June'),
         gettext('July'), gettext('August'), gettext('September'),
-        gettext('October'), gettext('November'), gettext('December')
+        gettext('October'), gettext('November'), gettext('December'),
       ],
       hours = [
         gettext('00'), gettext('01'), gettext('02'), gettext('03'),
@@ -47,7 +50,7 @@ define('pgadmin.node.pga_schedule', [
         gettext('08'), gettext('09'), gettext('10'), gettext('11'),
         gettext('12'), gettext('13'), gettext('14'), gettext('15'),
         gettext('16'), gettext('17'), gettext('18'), gettext('19'),
-        gettext('20'), gettext('21'), gettext('22'), gettext('23')
+        gettext('20'), gettext('21'), gettext('22'), gettext('23'),
       ],
       minutes = [
         gettext('00'), gettext('01'), gettext('02'), gettext('03'),
@@ -64,21 +67,21 @@ define('pgadmin.node.pga_schedule', [
         gettext('44'), gettext('45'), gettext('46'), gettext('47'),
         gettext('48'), gettext('49'), gettext('50'), gettext('51'),
         gettext('52'), gettext('53'), gettext('54'), gettext('55'),
-        gettext('56'), gettext('57'), gettext('58'), gettext('59')
+        gettext('56'), gettext('57'), gettext('58'), gettext('59'),
       ],
       AnyDatetimeCell = Backgrid.Extension.MomentCell.extend({
         editor: Backgrid.Extension.DatetimePickerEditor,
         render: function() {
           this.$el.empty();
           var model = this.model;
-          this.$el.text(this.formatter.fromRaw(model.get(this.column.get("name")), model) || gettext('<any>'));
+          this.$el.text(this.formatter.fromRaw(model.get(this.column.get('name')), model) || gettext('<any>'));
           this.delegateEvents();
 
           return this;
-        }
+        },
       }),
       DatetimeCell = Backgrid.Extension.MomentCell.extend({
-        editor: Backgrid.Extension.DatetimePickerEditor
+        editor: Backgrid.Extension.DatetimePickerEditor,
       }),
       BooleanArrayFormatter = function(selector, indexes) {
         var self = this;
@@ -101,7 +104,7 @@ define('pgadmin.node.pga_schedule', [
           }
 
           return self.indexes ? resIdx : res.join(', ');
-        }
+        };
         this.toRaw = function(d) {
           if (!self.indexes)
             return d;
@@ -111,14 +114,14 @@ define('pgadmin.node.pga_schedule', [
             res.push(_.indexOf(d, String(i + 1)) != -1);
           }
           return res;
-        }
+        };
 
         return self;
       },
       BooleanArrayOptions = function(ctrl) {
         var selector = ctrl.field.get('selector'),
-            val = ctrl.model.get(ctrl.field.get('name')),
-            res = [];
+          val = ctrl.model.get(ctrl.field.get('name')),
+          res = [];
 
         if (selector) {
           res = _.map(
@@ -133,7 +136,7 @@ define('pgadmin.node.pga_schedule', [
         defaults: {
           jexid: undefined,
           jexdate: null,
-          jextime: null
+          jextime: null,
         },
         idAttribute: 'jexid',
         schema: [{
@@ -141,20 +144,20 @@ define('pgadmin.node.pga_schedule', [
           editable: true, placeholder: gettext('<any>'),
           cell: AnyDatetimeCell, options: {format: 'YYYY-MM-DD'},
           displayFormat: 'YYYY-MM-DD', modelFormat: 'YYYY-MM-DD',
-          cellHeaderClasses:'width_percent_50', allowEmpty: true
+          cellHeaderClasses:'width_percent_50', allowEmpty: true,
         },{
           id: 'jextime', type: 'text', placeholder: gettext('<any>'),
           label: gettext('Time'), editable: true, cell: AnyDatetimeCell,
           options: {format: 'HH:mm'}, displayFormat: 'HH:mm',
           modelFormat: 'HH:mm:ss', displayInUTC: false, allowEmpty: true,
-          cellHeaderClasses:'width_percent_50', modalInUTC: false
+          cellHeaderClasses:'width_percent_50', modalInUTC: false,
         }],
         validate: function() {
           var self = this, exceptions = this.collection,
-              dates = {}, errMsg, hasExceptionErr = false,
-              d = (this.get('jexdate') || '<any>'),
-              t = this.get('jextime') || '<any>',
-              id = this.get('jexid') || this.cid;
+            errMsg, hasExceptionErr = false,
+            d = (this.get('jexdate') || '<any>'),
+            t = this.get('jextime') || '<any>',
+            id = this.get('jexid') || this.cid;
 
           self.errorModel.unset('jscdate');
           if (d == t && d == '<any>') {
@@ -169,17 +172,17 @@ define('pgadmin.node.pga_schedule', [
 
             if (
               d == (ex.get('jexdate') || '<any>') &&
-              t == (ex.get('jextime') || '<any>')
+                t == (ex.get('jextime') || '<any>')
             ) {
               errMsg = gettext('Please specify unique set of exceptions.');
               if (ex.errorModel.get('jscdate') != errMsg)
-                  self.errorModel.set('jscdate', errMsg);
+                self.errorModel.set('jscdate', errMsg);
               hasExceptionErr = true;
             }
           });
 
           return errMsg;
-        }
+        },
       });
 
     pgBrowser.Nodes['pga_schedule'] = pgBrowser.Node.extend({
@@ -189,15 +192,13 @@ define('pgadmin.node.pga_schedule', [
       hasSQL: true,
       hasDepends: false,
       hasStatistics: false,
-      canDrop: function(node) {
-        return true;
-      },
+      canDrop: true,
       label: gettext('Schedule'),
       node_image: 'icon-pga_schedule',
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -205,17 +206,17 @@ define('pgadmin.node.pga_schedule', [
           name: 'create_pga_schedule_on_job', node: 'pga_job', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Schedule...'),
-          icon: 'wcTabIcon icon-pga_schedule', data: {action: 'create'}
+          icon: 'wcTabIcon icon-pga_schedule', data: {action: 'create'},
         },{
           name: 'create_pga_schedule_on_coll', node: 'coll-pga_schedule', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Schedule...'),
-          icon: 'wcTabIcon icon-pga_schedule', data: {action: 'create'}
+          icon: 'wcTabIcon icon-pga_schedule', data: {action: 'create'},
         },{
           name: 'create_pga_schedule', node: 'pga_schedule', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Schedule...'),
-          icon: 'wcTabIcon icon-pga_schedule', data: {action: 'create'}
+          icon: 'wcTabIcon icon-pga_schedule', data: {action: 'create'},
         }]);
       },
       model: pgBrowser.Node.Model.extend({
@@ -232,7 +233,7 @@ define('pgadmin.node.pga_schedule', [
           jscmonths: _.map(months, function() { return false; }),
           jschours: _.map(hours, function() { return false; }),
           jscminutes: _.map(minutes, function() { return false; }),
-          jscexceptions: []
+          jscexceptions: [],
         },
         idAttribute: 'jscid',
         parse: function(d) {
@@ -243,7 +244,7 @@ define('pgadmin.node.pga_schedule', [
               d.jscexceptions.push({
                 'jexid': d.jexid[idx],
                 'jexdate': d.jexdate[idx],
-                'jextime': d.jextime[idx]
+                'jextime': d.jextime[idx],
               });
             }
           }
@@ -255,15 +256,15 @@ define('pgadmin.node.pga_schedule', [
         },
         schema: [{
           id: 'jscid', label: gettext('ID'), type: 'int',
-          cellHeaderClasses: 'width_percent_5', mode: ['properties']
+          cellHeaderClasses: 'width_percent_5', mode: ['properties'],
         },{
           id: 'jscname', label: gettext('Name'), type: 'text',
           cellHeaderClasses: 'width_percent_45',
-          disabled: function() { return false; }
+          disabled: function() { return false; },
         },{
           id: 'jscenabled', label: gettext('Enabled?'), type: 'switch',
           disabled: function() { return false; },
-          cellHeaderClasses: 'width_percent_5'
+          cellHeaderClasses: 'width_percent_5',
         },{
           id: 'jscstart', label: gettext('Start'), type: 'text',
           control: 'datetimepicker', cell: DatetimeCell,
@@ -271,42 +272,42 @@ define('pgadmin.node.pga_schedule', [
           displayFormat: 'YYYY-MM-DD HH:mm:ss Z',
           modelFormat: 'YYYY-MM-DD HH:mm:ss Z', options: {
             format: 'YYYY-MM-DD HH:mm:ss Z',
-            minDate: moment().add(0, 'm')
-          }, cellHeaderClasses: 'width_percent_25'
+            minDate: moment().add(0, 'm'),
+          }, cellHeaderClasses: 'width_percent_25',
         },{
           id: 'jscend', label: gettext('End'), type: 'text',
           control: 'datetimepicker', cell: DatetimeCell,
           disabled: function() { return false; }, displayInUTC: false,
           displayFormat: 'YYYY-MM-DD HH:mm:ss Z', options: {
             format: 'YYYY-MM-DD HH:mm:ss Z', useCurrent: false,
-            minDate: moment().add(0, 'm')
+            minDate: moment().add(0, 'm'),
           }, cellHeaderClasses: 'width_percent_25',
-          modelFormat: 'YYYY-MM-DD HH:mm:ss Z'
+          modelFormat: 'YYYY-MM-DD HH:mm:ss Z',
         },{
           id: 'jscweekdays', label: gettext('Week days'), type: 'text',
           control: Backform.Control.extend({
-            formatter: new BooleanArrayFormatter(weekdays, false)
-          }), mode: ['properties']
+            formatter: new BooleanArrayFormatter(weekdays, false),
+          }), mode: ['properties'],
         },{
           id: 'jscmonthdays', label: gettext('Month days'), type: 'text',
           control: Backform.Control.extend({
-            formatter: new BooleanArrayFormatter(monthdays, false)
-          }), mode: ['properties']
+            formatter: new BooleanArrayFormatter(monthdays, false),
+          }), mode: ['properties'],
         },{
           id: 'jscmonths', label: gettext('Months'), type: 'text',
           control: Backform.Control.extend({
-            formatter: new BooleanArrayFormatter(months, false)
-          }), mode: ['properties']
+            formatter: new BooleanArrayFormatter(months, false),
+          }), mode: ['properties'],
         },{
           id: 'jschours', label: gettext('Hours'), type: 'text',
           control: Backform.Control.extend({
-            formatter: new BooleanArrayFormatter(hours, false)
-          }), mode: ['properties']
+            formatter: new BooleanArrayFormatter(hours, false),
+          }), mode: ['properties'],
         },{
           id: 'jscminutes', label: gettext('Minutes'), type: 'text',
           control: Backform.Control.extend({
-            formatter: new BooleanArrayFormatter(minutes, false)
-          }), mode: ['properties']
+            formatter: new BooleanArrayFormatter(minutes, false),
+          }), mode: ['properties'],
         },{
           id: 'jscexceptions', label: gettext('Exceptions'), type: 'text',
           control: Backform.Control.extend({
@@ -321,17 +322,17 @@ define('pgadmin.node.pga_schedule', [
                 for (; idx < rawData.length; idx++) {
                   d = rawData[idx];
                   if (idx)
-                      res += ', ';
+                    res += ', ';
                   res += '[' + String((d.jexdate || '') + ' ' + (d.jextime || '')).replace(/^\s+|\s+$/g, '') + ']';
                 }
 
                 return res;
-              }
-              this.toRaw = function(data) { return data; }
+              };
+              this.toRaw = function(data) { return data; };
 
               return this;
-            }
-          }), mode: ['properties']
+            },
+          }), mode: ['properties'],
         },{
           type: 'nested', label: gettext('Days'), group: gettext('Repeat'),
           mode: ['create', 'edit'],
@@ -343,13 +344,13 @@ define('pgadmin.node.pga_schedule', [
 
               this.$el.prepend(
                 '<div class="set-group pg-el-xs-12 ' +
-                Backform.helpMessageClassName + '">' +
-                gettext('Schedules are specified using a <b>cron-style</b> format.<br/><ul><li>For each selected time or date element, the schedule will execute.<br/>e.g. To execute at 5 minutes past every hour, simply select ‘05’ in the Minutes list box.<br/></li><li>Values from more than one field may be specified in order to further control the schedule.<br/>e.g. To execute at 12:05 and 14:05 every Monday and Thursday, you would click minute 05, hours 12 and 14, and weekdays Monday and Thursday.</li><li>For additional flexibility, the Month Days check list includes an extra Last Day option. This matches the last day of the month, whether it happens to be the 28th, 29th, 30th or 31st.</li></ul>') +
-                '</div>'
+                  Backform.helpMessageClassName + '">' +
+                  gettext('Schedules are specified using a <b>cron-style</b> format.<br/><ul><li>For each selected time or date element, the schedule will execute.<br/>e.g. To execute at 5 minutes past every hour, simply select ‘05’ in the Minutes list box.<br/></li><li>Values from more than one field may be specified in order to further control the schedule.<br/>e.g. To execute at 12:05 and 14:05 every Monday and Thursday, you would click minute 05, hours 12 and 14, and weekdays Monday and Thursday.</li><li>For additional flexibility, the Month Days check list includes an extra Last Day option. This matches the last day of the month, whether it happens to be the 28th, 29th, 30th or 31st.</li></ul>') +
+                  '</div>'
               );
 
               return res;
-            }
+            },
           }),
           schema:[{
             id: 'jscweekdays', label: gettext('Week Days'), cell: 'select2',
@@ -362,11 +363,11 @@ define('pgadmin.node.pga_schedule', [
               width: 'style',
               dropdownAdapter: $.fn.select2.amd.require(
                 'select2/selectAllAdapter'
-              )
+              ),
             },
             selector: weekdays,
             formatter: new BooleanArrayFormatter(weekdays, true),
-            options: BooleanArrayOptions
+            options: BooleanArrayOptions,
           },{
             id: 'jscmonthdays', label: gettext('Month Days'), cell: 'select2',
             group: gettext('Days'), control: 'select2',
@@ -378,10 +379,10 @@ define('pgadmin.node.pga_schedule', [
               width: 'style',
               dropdownAdapter: $.fn.select2.amd.require(
                 'select2/selectAllAdapter'
-              )
+              ),
             },
             formatter: new BooleanArrayFormatter(monthdays, true),
-            selector: monthdays, options: BooleanArrayOptions
+            selector: monthdays, options: BooleanArrayOptions,
           },{
             id: 'jscmonths', label: gettext('Months'), cell: 'select2',
             group: gettext('Days'), control: 'select2',
@@ -393,11 +394,11 @@ define('pgadmin.node.pga_schedule', [
               width: 'style',
               dropdownAdapter: $.fn.select2.amd.require(
                 'select2/selectAllAdapter'
-              )
+              ),
             },
             formatter: new BooleanArrayFormatter(months, true),
-            selector: months, options: BooleanArrayOptions
-          }]
+            selector: months, options: BooleanArrayOptions,
+          }],
         },{
           type: 'nested', control: 'fieldset', label: gettext('Times'),
           group: gettext('Repeat'), mode: ['create', 'edit'],
@@ -412,10 +413,10 @@ define('pgadmin.node.pga_schedule', [
               width: 'style',
               dropdownAdapter: $.fn.select2.amd.require(
                 'select2/selectAllAdapter'
-              )
+              ),
             },
             formatter: new BooleanArrayFormatter(hours, true),
-            selector: hours, options: BooleanArrayOptions
+            selector: hours, options: BooleanArrayOptions,
           },{
             id: 'jscminutes', label: gettext('Minutes'), cell: 'select2',
             group: gettext('Times'), control: 'select2',
@@ -427,26 +428,26 @@ define('pgadmin.node.pga_schedule', [
               width: 'style',
               dropdownAdapter: $.fn.select2.amd.require(
                 'select2/selectAllAdapter'
-              )
+              ),
             },
             formatter: new BooleanArrayFormatter(minutes, true),
-            selector: minutes, options: BooleanArrayOptions
-          }]
+            selector: minutes, options: BooleanArrayOptions,
+          }],
         },{
           id: 'jscexceptions', type: 'collection', mode: ['edit', 'create'],
-          label: "", canEdit: false, model: ExceptionModel, canAdd: true,
+          label: '', canEdit: false, model: ExceptionModel, canAdd: true,
           group: gettext('Exceptions'), canDelete: true,
-          cols: ['jexdate', 'jextime'], control: 'sub-node-collection'
+          cols: ['jexdate', 'jextime'], control: 'sub-node-collection',
         },{
-          id: 'jscdesc', label: gettext('Comment'), type: 'multiline'
+          id: 'jscdesc', label: gettext('Comment'), type: 'multiline',
         }],
-        validate: function(keys) {
+        validate: function() {
           var val = this.get('jscname'),
-              errMsg = null;
+            errMsg = null, msg;
 
           if (_.isUndefined(val) || _.isNull(val) ||
             String(val).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Name cannot be empty.');
+            msg = gettext('Name cannot be empty.');
             this.errorModel.set('jscname', msg);
             errMsg = msg;
           } else {
@@ -456,7 +457,7 @@ define('pgadmin.node.pga_schedule', [
           val = this.get('jscstart');
           if (_.isUndefined(val) || _.isNull(val) ||
             String(val).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Please enter the start time.');
+            msg = gettext('Please enter the start time.');
             this.errorModel.set('jscstart', msg);
             errMsg = errMsg || msg;
           } else {
@@ -466,7 +467,7 @@ define('pgadmin.node.pga_schedule', [
           val = this.get('jscend');
           if (_.isUndefined(val) || _.isNull(val) ||
             String(val).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Please enter the end time.');
+            msg = gettext('Please enter the end time.');
             this.errorModel.set('jscend', msg);
             errMsg = errMsg || msg;
           } else {
@@ -476,21 +477,22 @@ define('pgadmin.node.pga_schedule', [
           // End time must be greater than Start time
           if(!errMsg) {
             var start_time = this.get('jscstart'),
-              end_time = this.get('jscend'), elapsed_time,
+              end_time = this.get('jscend'),
               start_time_js =  start_time.split(' '),
               end_time_js =  end_time.split(' ');
-              start_time_js = moment(start_time_js[0] + ' ' + start_time_js[1]);
-              end_time_js = moment(end_time_js[0] + ' ' + end_time_js[1]);
 
-              if(end_time_js.isBefore(start_time_js)) {
-                errMsg = gettext('Start time must be less than end time');
-                this.errorModel.set('jscstart', errMsg);
-              }
+            start_time_js = moment(start_time_js[0] + ' ' + start_time_js[1]);
+            end_time_js = moment(end_time_js[0] + ' ' + end_time_js[1]);
+
+            if(end_time_js.isBefore(start_time_js)) {
+              errMsg = gettext('Start time must be less than end time');
+              this.errorModel.set('jscstart', errMsg);
+            }
           }
 
           return errMsg;
-        }
-      })
+        },
+      }),
     });
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.js b/web/pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.js
index e11e6ab9..1a1cfb15 100644
--- a/web/pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.js
+++ b/web/pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.js
@@ -1,19 +1,19 @@
 define('pgadmin.node.pga_job', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
   'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
-  'pgadmin.node.pga_jobstep', 'pgadmin.node.pga_schedule'
+  'pgadmin.node.pga_jobstep', 'pgadmin.node.pga_schedule',
 ], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
 
   if (!pgBrowser.Nodes['coll-pga_job']) {
-    var pga_jobs = pgBrowser.Nodes['coll-pga_job'] =
+    pgBrowser.Nodes['coll-pga_job'] =
       pgBrowser.Collection.extend({
         node: 'pga_job',
         label: gettext('pga_jobs'),
         type: 'coll-pga_job',
         columns: ['jobid', 'jobname', 'jobenabled', 'jlgstatus', 'jobnextrun', 'joblastrun', 'jobdesc'],
-        hasStatistics: false
+        hasStatistics: false,
       });
-  };
+  }
 
   if (!pgBrowser.Nodes['pga_job']) {
     pgBrowser.Nodes['pga_job'] = pgBrowser.Node.extend({
@@ -26,9 +26,7 @@ define('pgadmin.node.pga_job', [
       hasCollectiveStatistics: true,
       width: '80%',
       height: '80%',
-      canDrop: function(node) {
-        return true;
-      },
+      canDrop: true,
       label: gettext('pgAgent Job'),
       node_image: function() {
         return 'icon-pga_job';
@@ -36,7 +34,7 @@ define('pgadmin.node.pga_job', [
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -44,17 +42,17 @@ define('pgadmin.node.pga_job', [
           name: 'create_pga_job_on_coll', node: 'coll-pga_job', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('pgAgent Job...'),
-          icon: 'wcTabIcon icon-pga_job', data: {action: 'create'}
+          icon: 'wcTabIcon icon-pga_job', data: {action: 'create'},
         },{
           name: 'create_pga_job', node: 'pga_job', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('pgAgent Job...'),
-          icon: 'wcTabIcon icon-pga_job', data: {action: 'create'}
+          icon: 'wcTabIcon icon-pga_job', data: {action: 'create'},
         }, {
           name: 'run_now_pga_job', node: 'pga_job', module: this,
           applies: ['object', 'context'], callback: 'run_pga_job_now',
           priority: 4, label: gettext('Run now'), data: {action: 'create'},
-          icon: 'fa fa-play-circle'
+          icon: 'fa fa-play-circle',
         }]);
       },
       model: pgBrowser.Node.Model.extend({
@@ -72,80 +70,80 @@ define('pgadmin.node.pga_job', [
           jobrunningat: undefined,
           jobdesc: '',
           jsteps: [],
-          jschedules: []
+          jschedules: [],
         },
         idAttribute: 'jobid',
         parse: function() {
           var d = pgBrowser.Node.Model.prototype.parse.apply(this, arguments);
 
           if (d) {
-            d.jobrunningat = d.jaghostagent || gettext("Not running currently.");
-            d.jlgstatus = d.jlgstatus || gettext("Unknown");
+            d.jobrunningat = d.jaghostagent || gettext('Not running currently.');
+            d.jlgstatus = d.jlgstatus || gettext('Unknown');
           }
           return d;
         },
         schema: [{
           id: 'jobname', label: gettext('Name'), type: 'text',
-          cellHeaderClasses: 'width_percent_30'
+          cellHeaderClasses: 'width_percent_30',
         },{
           id: 'jobid', label: gettext('ID'), mode: ['properties'],
-          type: 'int'
+          type: 'int',
         },{
           id: 'jobenabled', label: gettext('Enabled?'), type: 'switch',
-          cellHeaderClasses: 'width_percent_5'
+          cellHeaderClasses: 'width_percent_5',
         },{
           id: 'jobclass', label: gettext('Job class'), type: 'text',
-          mode: ['properties']
+          mode: ['properties'],
         },{
           id: 'jobjclid', label: gettext('Job class'), type: 'int',
           control: 'node-ajax-options', url: 'classes', url_with_id: false,
           cache_node: 'server', mode: ['create', 'edit'],
           select2: {allowClear: false},
-          helpMessage: gettext('Please select a class to categorize the job. This option will not affect the way the job runs.')
+          helpMessage: gettext('Please select a class to categorize the job. This option will not affect the way the job runs.'),
         },{
           id: 'jobhostagent', label: gettext('Host agent'), type: 'text',
           mode: ['edit', 'create'],
-          helpMessage: gettext('Enter the hostname of a machine running pgAgent if you wish to ensure only that machine will run this job. Leave blank if any host may run the job.')
+          helpMessage: gettext('Enter the hostname of a machine running pgAgent if you wish to ensure only that machine will run this job. Leave blank if any host may run the job.'),
         },{
           id: 'jobhostagent', label: gettext('Host agent'), type: 'text',
-          mode: ['properties']
+          mode: ['properties'],
         },{
           id: 'jobcreated', type: 'text', mode: ['properties'],
-          label: gettext('Created')
+          label: gettext('Created'),
         },{
           id: 'jobchanged', type: 'text', mode: ['properties'],
-          label: gettext('Changed')
+          label: gettext('Changed'),
         },{
           id: 'jobnextrun', type: 'text', mode: ['properties'],
-          label: gettext('Next run'), cellHeaderClasses: 'width_percent_20'
+          label: gettext('Next run'), cellHeaderClasses: 'width_percent_20',
         },{
           id: 'joblastrun', type: 'text', mode: ['properties'],
-          label: gettext('Last run'), cellHeaderClasses: 'width_percent_20'
+          label: gettext('Last run'), cellHeaderClasses: 'width_percent_20',
         },{
           id: 'jlgstatus', type: 'text', label: gettext('Last result'),
-          cellHeaderClasses: 'width_percent_5', mode: ['properties']
+          cellHeaderClasses: 'width_percent_5', mode: ['properties'],
         },{
           id: 'jobrunningat', type: 'text', mode: ['properties'],
-          label: gettext('Running at')
+          label: gettext('Running at'),
         },{
           id: 'jobdesc', label: gettext('Comment'), type: 'multiline',
-          cellHeaderClasses: 'width_percent_15'
+          cellHeaderClasses: 'width_percent_15',
         },{
           id: 'jsteps', label: '', group: gettext('Steps'),
           type: 'collection', mode: ['edit', 'create'],
           model: pgBrowser.Nodes['pga_jobstep'].model, canEdit: true,
           control: 'sub-node-collection', canAdd: true, canDelete: true,
           columns: [
-            'jstname', 'jstenabled', 'jstkind', 'jstconntype', 'jstonerror'
-          ]
+            'jstname', 'jstenabled', 'jstkind', 'jstconntype', 'jstonerror',
+          ],
         },{
           id: 'jschedules', label: '', group: gettext('Schedules'),
           type: 'collection', mode: ['edit', 'create'],
           control: 'sub-node-collection', canAdd: true, canDelete: true,
           canEdit: true, model: pgBrowser.Nodes['pga_schedule'].model,
-          columns: ['jscname', 'jscenabled', 'jscstart', 'jscend']
+          columns: ['jscname', 'jscenabled', 'jscstart', 'jscend'],
         }],
-        validate: function(keys) {
+        validate: function() {
           var name = this.get('jobname');
           if (_.isUndefined(name) || _.isNull(name) ||
             String(name).replace(/^\s+|\s+$/g, '') == '') {
@@ -156,7 +154,7 @@ define('pgadmin.node.pga_job', [
             this.errorModel.unset('jobname');
           }
           return null;
-        }
+        },
       }),
       /* Run pgagent job now */
       run_pga_job_now: function(args) {
@@ -172,15 +170,15 @@ define('pgadmin.node.pga_job', [
         $.ajax({
           url: obj.generate_url(i, 'run_now', d, true),
           method:'PUT',
-          success: function(res) {
-            // 'pgagent.pga_job' table updated with current time
-            // to run the job now.
-            t.unload(i);
-          },
-          error: function(xhr, status, error) {
-	          var error_msg = "Unable to run pgagent job.";
+          // 'pgagent.pga_job' table updated with current time to run the job
+          // now.
+          success: function() { t.unload(i); },
+          error: function(xhr) {
+            var error_msg = gettext('Unable to run pgagent job.');
             if (xhr.readyState == 0) {
-              alertify.error(gettext('Not connected to the server or the connection to the server has been closed.'));
+              alertify.error(
+                gettext('Not connected to the server or the connection to the server has been closed.')
+              );
             }
             else {
               if (_.isUndefined(xhr.responseText)) {
@@ -194,7 +192,7 @@ define('pgadmin.node.pga_job', [
               }
             }
             t.unload(i);
-          }
+          },
         });
 
         return false;
diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js b/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js
index 72515a40..0dd3f605 100644
--- a/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js
+++ b/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js
@@ -1,7 +1,7 @@
 define('pgadmin.node.pga_jobstep', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
   'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify', 'backform',
-  'backgrid', 'pgadmin.backform', 'pgadmin.backgrid'
+  'backgrid', 'pgadmin.backform', 'pgadmin.backgrid',
 ], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify, Backform, Backgrid) {
 
   if (!pgBrowser.Nodes['coll-pga_jobstep']) {
@@ -12,9 +12,9 @@ define('pgadmin.node.pga_jobstep', [
         type: 'coll-pga_jobstep',
         columns: [
           'jstid', 'jstname', 'jstenabled', 'jstkind', 'jstconntype',
-          'jstonerror'
+          'jstonerror',
         ],
-        hasStatistics: false
+        hasStatistics: false,
       });
   }
 
@@ -26,18 +26,18 @@ define('pgadmin.node.pga_jobstep', [
     },
     dependentChanged: function dependentChanged() {
       var model = this.model,
-          column = this.column,
-          editable = this.column.get("editable"),
-          input = this.$el.find('input[type=checkbox]').first(),
-          self_name = column.get('name'),
-          is_editable;
+        column = this.column,
+        editable = this.column.get('editable'),
+        input = this.$el.find('input[type=checkbox]').first(),
+        self_name = column.get('name'),
+        is_editable;
 
       is_editable = _.isFunction(editable) ? !!editable.apply(column, [model]) : !!editable;
       if (is_editable) {
-        this.$el.addClass("editable");
+        this.$el.addClass('editable');
         input.bootstrapSwitch('disabled', false);
       } else {
-        this.$el.removeClass("editable");
+        this.$el.removeClass('editable');
         input.bootstrapSwitch('disabled', true);
         // Set self value into model
         setTimeout(function () {
@@ -49,7 +49,7 @@ define('pgadmin.node.pga_jobstep', [
       this.delegateEvents();
       return this;
     },
-    remove: Backgrid.Extension.DependentCell.prototype.remove
+    remove: Backgrid.Extension.DependentCell.prototype.remove,
   });
 
   if (!pgBrowser.Nodes['pga_jobstep']) {
@@ -63,9 +63,7 @@ define('pgadmin.node.pga_jobstep', [
       hasCollectiveStatistics: true,
       width: '70%',
       height: '80%',
-      canDrop: function(node) {
-        return true;
-      },
+      canDrop: true,
       label: gettext('Step'),
       node_image: function() {
         return 'icon-pga_jobstep';
@@ -73,7 +71,7 @@ define('pgadmin.node.pga_jobstep', [
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -81,17 +79,17 @@ define('pgadmin.node.pga_jobstep', [
           name: 'create_pga_jobstep_on_job', node: 'pga_job', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Job Step...'),
-          data: {'action': 'create'}, icon: 'wcTabIcon icon-pga_jobstep'
+          data: {'action': 'create'}, icon: 'wcTabIcon icon-pga_jobstep',
         },{
           name: 'create_pga_jobstep_on_coll', node: 'coll-pga_jobstep', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Job Step...'),
-          data: {'action': 'create'}, icon: 'wcTabIcon icon-pga_jobstep'
+          data: {'action': 'create'}, icon: 'wcTabIcon icon-pga_jobstep',
         },{
           name: 'create_pga_jobstep', node: 'pga_jobstep', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Job Step...'),
-          data: {'action': 'create'}, icon: 'wcTabIcon icon-pga_jobstep'
+          data: {'action': 'create'}, icon: 'wcTabIcon icon-pga_jobstep',
         }]);
       },
       model: pgBrowser.Node.Model.extend({
@@ -107,7 +105,7 @@ define('pgadmin.node.pga_jobstep', [
           jstconnstr: null,
           jstdbname: null,
           jstonerror: 'f',
-          jstnextrun: ''
+          jstnextrun: '',
         },
         initialize: function() {
           pgBrowser.Node.Model.prototype.initialize.apply(this, arguments);
@@ -125,29 +123,28 @@ define('pgadmin.node.pga_jobstep', [
         idAttribute: 'jstid',
         schema: [{
           id: 'jstid', label: gettext('ID'), type: 'int',
-          cellHeaderClasses: 'width_percent_5', mode: ['properties']
+          cellHeaderClasses: 'width_percent_5', mode: ['properties'],
         },{
           id: 'jstname', label: gettext('Name'), type: 'text',
-          disabled: function(m) { return false; },
-          cellHeaderClasses: 'width_percent_60'
+          disabled: false, cellHeaderClasses: 'width_percent_60',
         },{
           id: 'jstenabled', label: gettext('Enabled?'), type: 'switch',
-          disabled: function(m) { return false; }
+          disabled: function() { return false; },
         },{
           id: 'jstkind', label: gettext('Kind'), type: 'switch',
           options: {
             'onText': gettext('SQL'), 'offText': gettext('Batch'),
-            'onColor': 'primary', 'offColor': 'primary'
+            'onColor': 'primary', 'offColor': 'primary',
           }, control: Backform.SwitchControl,
-          disabled: function(m) { return false; }
+          disabled: function() { return false; },
         },{
           id: 'jstconntype', label: gettext('Connection type'),
           type: 'switch', deps: ['jstkind'], mode: ['properties'],
           disabled: function(m) { return !m.get('jstkind'); },
           options: {
             'onText': gettext('Local'), 'offText': gettext('Remote'),
-            'onColor': 'primary', 'offColor': 'primary'
-          }
+            'onColor': 'primary', 'offColor': 'primary',
+          },
         },{
           id: 'jstconntype', label: gettext('Connection type'),
           type: 'switch', deps: ['jstkind'], mode: ['create', 'edit'],
@@ -159,14 +156,14 @@ define('pgadmin.node.pga_jobstep', [
           },
           options: {
             'onText': gettext('Local'), 'offText': gettext('Remote'),
-            'onColor': 'primary', 'offColor': 'primary'
-          }, helpMessage: gettext('Select <b>Local</b> if the job step will execute on the local database server, or <b>Remote</b> to specify a remote database server.')
+            'onColor': 'primary', 'offColor': 'primary',
+          }, helpMessage: gettext('Select <b>Local</b> if the job step will execute on the local database server, or <b>Remote</b> to specify a remote database server.'),
         },{
           id: 'jstdbname', label: gettext('Database'), type: 'text',
-          mode: ['properties'], disabled: function(m) { return false; }
+          mode: ['properties'], disabled: function() { return false; },
         },{
           id: 'jstconnstr', type: 'text', mode: ['properties'],
-          label: gettext('Connection string')
+          label: gettext('Connection string'),
         },{
           id: 'jstdbname', label: gettext('Database'), type: 'text',
           control: 'node-list-by-name', node: 'database',
@@ -174,30 +171,30 @@ define('pgadmin.node.pga_jobstep', [
           disabled: function(m) {
             return !m.get('jstkind') || !m.get('jstconntype');
           }, deps: ['jstkind', 'jstconntype'], mode: ['create', 'edit'],
-          helpMessage: gettext('Please select the database on which the job step will run.')
+          helpMessage: gettext('Please select the database on which the job step will run.'),
         },{
           id: 'jstconnstr', label: gettext('Connection string'), type: 'text',
           deps: ['jstkind', 'jstconntype'], disabled: function(m) {
             return !m.get('jstkind') || m.get('jstconntype');
           }, helpMessage: S(
-            gettext("Please specify the connection string for the remote database server. Each parameter setting is in the form keyword = value. Spaces around the equal sign are optional. To write an empty value, or a value containing spaces, surround it with single quotes, e.g., keyword = 'a value'. Single quotes and backslashes within the value must be escaped with a backslash, i.e., \' and \\.<br>For more information, please see the documentation on %s")
+            gettext('Please specify the connection string for the remote database server. Each parameter setting is in the form keyword = value. Spaces around the equal sign are optional. To write an empty value, or a value containing spaces, surround it with single quotes, e.g., keyword = \'a value\'. Single quotes and backslashes within the value must be escaped with a backslash, i.e., \' and \\.<br>For more information, please see the documentation on %s')
           ).sprintf(
             '<a href="https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING" target="_blank">libpq connection strings</a>'
-          ).value(), mode: ['create', 'edit']
+          ).value(), mode: ['create', 'edit'],
         },{
           id: 'jstonerror', label: gettext('On error'), cell: 'select2',
           control: 'select2', options: [
-            {'label': gettext('Fail'), 'value': "f"},
-            {'label': gettext('Success'), 'value': "s"},
-            {'label': gettext('Ignore'), 'value': "i"}
-          ], select2: {allowClear: false}, disabled: function(m) {
+            {'label': gettext('Fail'), 'value': 'f'},
+            {'label': gettext('Success'), 'value': 's'},
+            {'label': gettext('Ignore'), 'value': 'i'},
+          ], select2: {allowClear: false}, disabled: function() {
             return false;
-          }
+          },
         },{
-          id: 'jstdesc', label: gettext('Comment'), type: 'multiline'
+          id: 'jstdesc', label: gettext('Comment'), type: 'multiline',
         },{
           id: 'jstcode', label: '', cell: 'string', deps: ['jstkind'],
-          type: 'text', control: 'sql-field', group: gettext('Code'),
+          type: 'text', group: gettext('Code'),
           control: Backform.SqlFieldControl.extend({
             render: function() {
               if (this.model.get('jstkind')) {
@@ -208,16 +205,16 @@ define('pgadmin.node.pga_jobstep', [
               return Backform.SqlFieldControl.prototype.render.apply(
                 this, arguments
               );
-            }
-          })
+            },
+          }),
         }],
-        validate: function(keys) {
+        validate: function() {
           var val = this.get('jstname'),
-              errMsg = null;
+            errMsg = null, msg;
 
           if (
             _.isUndefined(val) || _.isNull(val) ||
-            String(val).replace(/^\s+|\s+$/g, '') == ''
+              String(val).replace(/^\s+|\s+$/g, '') == ''
           ) {
             errMsg = gettext('Name cannot be empty.');
             this.errorModel.set('jstname', errMsg);
@@ -232,7 +229,7 @@ define('pgadmin.node.pga_jobstep', [
                 _.isUndefined(val) || _.isNull(val) ||
                   String(val).replace(/^\s+|\s+$/g, '') == ''
               ) {
-                var msg = gettext('Please select a database.');
+                msg = gettext('Please select a database.');
                 errMsg = errMsg || msg;
                 this.errorModel.set('jstdbname', msg);
               } else {
@@ -240,8 +237,7 @@ define('pgadmin.node.pga_jobstep', [
               }
             } else {
               this.errorModel.unset('jstdbname');
-              var msg,
-                r = /\s*\b(\w+)\s*=\s*('([^'\\]*(?:\\.[^'\\]*)*)'|[\w|\.]*)/g;
+              var r = /\s*\b(\w+)\s*=\s*('([^'\\]*(?:\\.[^'\\]*)*)'|[\w|\.]*)/g;
               val = this.get('jstconnstr');
               if (
                 _.isUndefined(val) || _.isNull(val) ||
@@ -252,18 +248,18 @@ define('pgadmin.node.pga_jobstep', [
                 msg = gettext('Please enter a valid connection string.');
               } else {
                 var m,
-                    params = {
-                      'host': true, 'hostaddr': true, 'port': true,
-                      'dbname': true, 'user': true, 'password': true,
-                      'connect_timeout': true, 'client_encoding': true,
-                      'application_name': true, 'options': true,
-                      'fallback_application_name': true, 'sslmode': true,
-                      'sslcert': true, 'sslkey': true, 'sslrootcert': true,
-                      'sslcrl': true, 'keepalives': true, 'service': true,
-                      'keepalives_idle': true, 'keepalives_interval': true,
-                      'keepalives_count': true, 'sslcompression': true,
-                      'requirepeer': true, 'krbsrvname': true, 'gsslib': true,
-                    };
+                  params = {
+                    'host': true, 'hostaddr': true, 'port': true,
+                    'dbname': true, 'user': true, 'password': true,
+                    'connect_timeout': true, 'client_encoding': true,
+                    'application_name': true, 'options': true,
+                    'fallback_application_name': true, 'sslmode': true,
+                    'sslcert': true, 'sslkey': true, 'sslrootcert': true,
+                    'sslcrl': true, 'keepalives': true, 'service': true,
+                    'keepalives_idle': true, 'keepalives_interval': true,
+                    'keepalives_count': true, 'sslcompression': true,
+                    'requirepeer': true, 'krbsrvname': true, 'gsslib': true,
+                  };
 
                 while((m = r.exec(val))) {
                   if (params[m[1]]) {
@@ -295,9 +291,9 @@ define('pgadmin.node.pga_jobstep', [
           val = this.get('jstcode');
           if (
             _.isUndefined(val) || _.isNull(val) ||
-            String(val).replace(/^\s+|\s+$/g, '') == ''
+              String(val).replace(/^\s+|\s+$/g, '') == ''
           ) {
-            var msg = gettext('Please specify code to execute.');
+            msg = gettext('Please specify code to execute.');
             errMsg = errMsg || msg;
             this.errorModel.set('jstcode', msg);
           } else {
@@ -305,8 +301,8 @@ define('pgadmin.node.pga_jobstep', [
           }
 
           return errMsg;
-        }
-      })
+        },
+      }),
     });
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/resource_groups/static/js/resource_group.js b/web/pgadmin/browser/server_groups/servers/resource_groups/static/js/resource_group.js
index 7d370351..4eac6e78 100644
--- a/web/pgadmin/browser/server_groups/servers/resource_groups/static/js/resource_group.js
+++ b/web/pgadmin/browser/server_groups/servers/resource_groups/static/js/resource_group.js
@@ -1,6 +1,6 @@
 define('pgadmin.node.resource_group', [
   'sources/gettext', 'sources/url_for', 'underscore', 'pgadmin.browser',
-  'pgadmin.browser.collection'
+  'pgadmin.browser.collection',
 ], function(gettext, url_for, _, pgBrowser) {
 
   // Extend the browser's collection class for resource group collection
@@ -10,8 +10,8 @@ define('pgadmin.node.resource_group', [
         node: 'resource_group',
         label: gettext('Resource Groups'),
         type: 'coll-resource_group',
-        columns: ['name', 'cpu_rate_limit', 'dirty_rate_limit']
-    });
+        columns: ['name', 'cpu_rate_limit', 'dirty_rate_limit'],
+      });
   }
 
   // Extend the browser's node class for resource group node
@@ -43,21 +43,21 @@ define('pgadmin.node.resource_group', [
            */
           enable: function(node, item) {
             var treeData = this.getTreeNodeHierarchy(item),
-                server = treeData['server'];
+              server = treeData['server'];
             return server.connected && node.server_type === 'ppas' &&
-                   node.version >= 90400;
-          }
+              node.version >= 90400;
+          },
         },{
           name: 'create_resource_group_on_coll', node: 'coll-resource_group', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Resource Group...'),
-          icon: 'wcTabIcon icon-resource_group', data: {action: 'create'}
+          icon: 'wcTabIcon icon-resource_group', data: {action: 'create'},
         },{
           name: 'create_resource_group', node: 'resource_group', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Resource Group...'),
-          icon: 'wcTabIcon icon-resource_group', data: {action: 'create'}
-        }
+          icon: 'wcTabIcon icon-resource_group', data: {action: 'create'},
+        },
         ]);
       },
 
@@ -66,7 +66,7 @@ define('pgadmin.node.resource_group', [
         defaults: {
           name: undefined,
           cpu_rate_limit: 0.0,
-          dirty_rate_limit: 0.0
+          dirty_rate_limit: 0.0,
         },
 
         // Defining schema for the resource group node
@@ -75,22 +75,23 @@ define('pgadmin.node.resource_group', [
           type: 'text',
         },{
           id: 'cpu_rate_limit', label: gettext('CPU rate limit (%%)'), cell: 'string',
-          type: 'numeric', min:0, max:16777216
+          type: 'numeric', min:0, max:16777216,
         },{
           id: 'dirty_rate_limit', label: gettext('Dirty rate limit (KB)'), cell: 'string',
-          type: 'numeric', min:0, max:16777216
+          type: 'numeric', min:0, max:16777216,
         }],
 
         /* validate function is used to validate the input given by
          * the user. In case of error, message will be displayed on
          * the GUI for the respective control.
          */
-        validate: function(keys) {
-          var msg, cpu_rate_limit, dirty_rate_limit, name,
-              name = this.get('name');
+        validate: function() {
+          var msg,
+            name = this.get('name');
+
           if (_.isUndefined(name) || _.isNull(name) ||
-              String(name).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Name cannot be empty.');
+            String(name).replace(/^\s+|\s+$/g, '') == '') {
+            msg = gettext('Name cannot be empty.');
             this.errorModel.set('name', msg);
             return msg;
           } else {
@@ -99,8 +100,8 @@ define('pgadmin.node.resource_group', [
 
           var cpu_rate_limit = this.get('cpu_rate_limit');
           if (_.isUndefined(cpu_rate_limit) || _.isNull(cpu_rate_limit) ||
-              String(cpu_rate_limit).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('CPU rate limit cannot be empty.');
+            String(cpu_rate_limit).replace(/^\s+|\s+$/g, '') == '') {
+            msg = gettext('CPU rate limit cannot be empty.');
             this.errorModel.set('cpu_rate_limit', msg);
             return msg;
           } else {
@@ -110,15 +111,15 @@ define('pgadmin.node.resource_group', [
           var dirty_rate_limit = this.get('dirty_rate_limit');
           if (_.isUndefined(dirty_rate_limit) || _.isNull(dirty_rate_limit) ||
             String(dirty_rate_limit).replace(/^\s+|\s+$/g, '') == '') {
-            var msg = gettext('Dirty rate limit cannot be empty.');
+            msg = gettext('Dirty rate limit cannot be empty.');
             this.errorModel.set('dirty_rate_limit', msg);
             return msg;
           } else {
             this.errorModel.unset('dirty_rate_limit');
           }
           return null;
-        }
-      })
+        },
+      }),
     });
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js b/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js
index 1e25c183..55fd4fe1 100644
--- a/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js
+++ b/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js
@@ -2,70 +2,66 @@ define('pgadmin.node.role', [
   'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
   'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
   'pgadmin.backform', 'select2', 'pgadmin.browser.collection',
-  'pgadmin.browser.node.ui', 'pgadmin.browser.server.variable'
+  'pgadmin.browser.node.ui', 'pgadmin.browser.server.variable',
 ], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, Backform) {
 
   if (!pgBrowser.Nodes['coll-role']) {
-    var role = pgAdmin.Browser.Nodes['coll-role'] =
+    pgAdmin.Browser.Nodes['coll-role'] =
       pgAdmin.Browser.Collection.extend({
         node: 'role',
         type: 'coll-role',
         columns: [
           'rolname', 'rolvaliduntil', 'rolconnlimit', 'rolcanlogin',
           'rolsuper', 'rolcreaterole', 'rolcreatedb', 'rolcatupdate',
-          'rolinherit', 'rolreplication'
-        ]
+          'rolinherit', 'rolreplication',
+        ],
       });
-  };
+  }
 
   var SecurityModel = pgAdmin.Browser.SecurityModel =
-        pgAdmin.Browser.SecurityModel || pgAdmin.Browser.Node.Model.extend({
-    defaults: {
-      provider: null,
-      label: null
-    },
-    schema: [{
-      id: 'provider', label: gettext('Provider'),
-      type: 'text', disabled: false,
-      cellHeaderClasses:'width_percent_50'
-    },{
-      id: 'label', label: gettext('Security Label'),
-      type: 'text', disabled: false,
-    }],
-    validate: function() {
-      var err = {},
-          errmsg = null,
-          data = this.toJSON();
-
-      if (_.isUndefined(data.provider) ||
-        _.isNull(data.provider) ||
-        String(data.provider).replace(/^\s+|\s+$/g, '') == '') {
-        var msg = gettext('Please specify the value for all the security providers.');
-
-        this.errorModel.set('provider', msg);
-        return msg;
-      } else {
-        this.errorModel.unset('provider');
-      }
-
-      if (_.isUndefined(data.label) ||
-        _.isNull(data.label) ||
-        String(data.label).replace(/^\s+|\s+$/g, '') == '') {
-        var msg = gettext('Please specify the value for all the security providers.') ;
+    pgAdmin.Browser.SecurityModel || pgAdmin.Browser.Node.Model.extend({
+      defaults: {
+        provider: null,
+        label: null,
+      },
+      schema: [{
+        id: 'provider', label: gettext('Provider'),
+        type: 'text', disabled: false,
+        cellHeaderClasses:'width_percent_50',
+      },{
+        id: 'label', label: gettext('Security Label'),
+        type: 'text', disabled: false,
+      }],
+      validate: function() {
+        var data = this.toJSON(), msg;
+
+        if (_.isUndefined(data.provider) ||
+          _.isNull(data.provider) ||
+            String(data.provider).replace(/^\s+|\s+$/g, '') == '') {
+          msg = gettext('Please specify the value for all the security providers.');
+          this.errorModel.set('provider', msg);
+          return msg;
+        } else {
+          this.errorModel.unset('provider');
+        }
 
-        this.errorModel.set('label', msg);
-        return msg;
-      } else {
-        this.errorModel.unset('label');
-      }
+        if (_.isUndefined(data.label) ||
+          _.isNull(data.label) ||
+            String(data.label).replace(/^\s+|\s+$/g, '') == '') {
+          msg = gettext('Please specify the value for all the security providers.') ;
+          this.errorModel.set('label', msg);
+          return msg;
+        } else {
+          this.errorModel.unset('label');
+        }
 
-      return null;
-    }
-  });
+        return null;
+      },
+    });
 
   var switchOptions = {
     'onText': gettext('Yes'), 'offText': gettext('No'),
-    'size': 'mini'
+    'size': 'mini',
   };
 
   var RoleCustomSwitchControl = Backform.SwitchControl.extend({
@@ -81,26 +77,24 @@ define('pgadmin.node.role', [
       '    <span class="<%=Backform.helpMessageClassName%>"><%=helpMessage%></span>',
       '  <% } %>',
       '</div>',
-    ].join("\n"))
+    ].join('\n')),
   });
 
   var RoleMembersControl = Backform.Control.extend({
     defaults: _.defaults(
-                {extraClasses: ['col-xs-12 col-sm-12 col-md-12']},
-                Backform.NodeListByNameControl.prototype.defaults
-                ),
+      {extraClasses: ['col-xs-12 col-sm-12 col-md-12']},
+      Backform.NodeListByNameControl.prototype.defaults
+    ),
     initialize: function() {
       Backform.NodeListByNameControl.prototype.initialize.apply(this, arguments);
     },
     formatter: {
-      fromRaw: function (rawData, model) {
+      fromRaw: function (rawData) {
         var res = _.isObject(rawData) ? rawData : JSON.parse(rawData);
 
         return _.pluck(res, 'role');
       },
-      toRaw: function (formattedData, model) {
-        return formattedData;
-      }
+      toRaw: function (formattedData) { return formattedData; },
     },
     template: _.template([
       '<label class="<%=Backform.controlLabelClassName%>"><%=label%></label>',
@@ -115,7 +109,7 @@ define('pgadmin.node.role', [
       '    <span class="<%=Backform.helpMessageClassName%>"><%=helpMessage%></span>',
       '  <% } %>',
       '</div>',
-      ].join("\n")),
+    ].join('\n')),
     selectionTemplate: _.template([
       '<span>',
       '  <span class="wcTabIcon <%= optimage %>"></span>',
@@ -123,13 +117,13 @@ define('pgadmin.node.role', [
       '  <% if (checkbox) { %>',
       '  <input type="checkbox" <%=disabled ? "disabled=\'disabled\'" : ""%>/>',
       '  <% } %>',
-      '</span>'
-    ].join("\n")),
-    events: {"change select": "onChange"},
+      '</span>',
+    ].join('\n')),
+    events: {'change select': 'onChange'},
     getValueFromDOM: function() {
       var res = [];
 
-      this.$el.find("select").find(':selected').each(function() {
+      this.$el.find('select').find(':selected').each(function() {
         res.push($(this).attr('value'));
       });
 
@@ -137,39 +131,41 @@ define('pgadmin.node.role', [
     },
     render: function() {
       var field = _.defaults(this.field.toJSON(), this.defaults),
-          attributes = this.model.toJSON(),
-          attrArr = field.name.split('.'),
-          name = attrArr.shift(),
-          path = attrArr.join('.'),
-          rawValue = this.keyPathAccessor(attributes[name], path),
-          data = _.extend(field, {
-            rawValue: rawValue,
-            value: this.formatter.fromRaw(rawValue, this.model),
-            attributes: attributes,
-            formatter: this.formatter
-          }),
-          evalF = function(f, d, m) {
-            return (_.isFunction(f) ? !!f.apply(d, [m]) : !!f);
-          },
-          evalASFunc = function(f, d, m) {
-             return (_.isFunction(f) ? f.apply(d, [m]) : f);
-          };
+        attributes = this.model.toJSON(),
+        attrArr = field.name.split('.'),
+        name = attrArr.shift(),
+        path = attrArr.join('.'),
+        rawValue = this.keyPathAccessor(attributes[name], path),
+        data = _.extend(field, {
+          rawValue: rawValue,
+          value: this.formatter.fromRaw(rawValue, this.model),
+          attributes: attributes,
+          formatter: this.formatter,
+        }),
+        evalF = function(f, d, m) {
+          return (_.isFunction(f) ? !!f.apply(d, [m]) : !!f);
+        },
+        evalASFunc = function(f, d, m) {
+          return (_.isFunction(f) ? f.apply(d, [m]) : f);
+        };
 
       // Evaluate the disabled, visible, and required option
       _.extend(data, {
         disabled: evalF(data.disabled, data, this.model),
         visible:  evalF(data.visible, data, this.model),
         required: evalF(data.required, data, this.model),
-        helpMessage: evalASFunc(data.helpMessage, data, this.model)
+        helpMessage: evalASFunc(data.helpMessage, data, this.model),
       });
       // Evaluation the options
       if (_.isFunction(data.options)) {
         try {
-          data.options = data.options.apply(this)
+          data.options = data.options.apply(this);
         } catch(e) {
           // Do nothing
-          data.options = []
-          this.model.trigger('pgadmin-view:transform:error', m, self.field, e);
+          data.options = [];
+          this.model.trigger(
+            'pgadmin-view:transform:error', this.model, this.field, e
+          );
         }
       }
 
@@ -183,66 +179,66 @@ define('pgadmin.node.role', [
       this.updateInvalid();
 
       var self = this,
-          collection = this.model.get(this.field.get('name')),
-          formatState = function(opt) {
-            if (!opt.id) {
-              return opt.text;
-            }
-
-            var optimage = $(opt.element).data('icon');
-
-            if(!optimage){
-              return opt.text;
-            } else {
-              var d = _.extend(
-                 {}, data, {
-                   'opttext': _.escape(opt.text),
-                   'optimage': optimage,
-                   'checkbox': false
-                 });
-              return $(self.selectionTemplate(d));
-            }
-          },
-          formatSelection = function (opt) {
-
-            if (!opt.id) {
-              return opt.text;
-            }
-
-            var optimage = $(opt.element).data('icon'),
-                grantUpdate = function(ev) {
+        collection = this.model.get(this.field.get('name')),
+        formatState = function(opt) {
+          if (!opt.id) {
+            return opt.text;
+          }
 
-                  _.each(collection.where({role: opt.id}), function(m) {
-                    m.set('admin', $(ev.target).is(":checked"));
-                  });
+          var optimage = $(opt.element).data('icon');
+
+          if(!optimage){
+            return opt.text;
+          } else {
+            var d = _.extend(
+              {}, data, {
+                'opttext': _.escape(opt.text),
+                'optimage': optimage,
+                'checkbox': false,
+              });
+            return $(self.selectionTemplate(d));
+          }
+        },
+        formatSelection = function (opt) {
 
-                  return false;
-                };
+          if (!opt.id) {
+            return opt.text;
+          }
 
-            if(!optimage){
-              return opt.text;
-            } else {
-              var d = _.extend(
-                 {}, data, {
-                   'opttext': _.escape(opt.text),
-                   'optimage': optimage,
-                   'checkbox': true
-                 }),
-                 j = $(self.selectionTemplate(d));
-
-              // Update the checkbox lazy
-              setTimeout(
-                function() {
-                  _.each(collection.where({role: opt.id}), function(m) {
-                    j.find('input').prop('checked', m.get('admin'));
-                  });
-                }, 200);
-
-              (j.find('input')).on('change', grantUpdate);
-
-              return j;
-            }
-          };
+          var optimage = $(opt.element).data('icon'),
+            grantUpdate = function(ev) {
+
+              _.each(collection.where({role: opt.id}), function(m) {
+                m.set('admin', $(ev.target).is(':checked'));
+              });
+
+              return false;
+            };
+
+          if(!optimage){
+            return opt.text;
+          } else {
+            var d = _.extend(
+              {}, data, {
+                'opttext': _.escape(opt.text),
+                'optimage': optimage,
+                'checkbox': true,
+              }),
+              j = $(self.selectionTemplate(d));
+
+            // Update the checkbox lazy
+            setTimeout(
+              function() {
+                _.each(collection.where({role: opt.id}), function(m) {
+                  j.find('input').prop('checked', m.get('admin'));
+                });
+              }, 200);
+
+            (j.find('input')).on('change', grantUpdate);
+
+            return j;
+          }
+        };
 
       this.$el.find('select').select2({
         templateResult: formatState,
@@ -250,34 +246,32 @@ define('pgadmin.node.role', [
         multiple: true,
         tags: true,
         allowClear: data.disabled ? false : true,
-        placeholder: data.disabled ? "" : gettext("Select members"),
-        width: 'style'
-      }).on("change", function(e) {
+        placeholder: data.disabled ? '' : gettext('Select members'),
+        width: 'style',
+      }).on('change', function(e) {
         $(e.target).find(':selected').each(function() {
         });
       });
 
       return this;
     },
-    onChange: function(e) {
+    onChange: function() {
       var model = this.model,
-          $el = $(e.target),
-          attrArr = this.field.get("name").split('.'),
-          name = attrArr.shift(),
-          path = attrArr.join('.'),
-          vals = this.getValueFromDOM(),
-          collection = model.get(name),
-          removed = [];
-
-      this.stopListening(this.model, "change:" + name, this.render);
-
-      /*
-       * Iterate through all the values, and find out how many are already
-       * present in the collection.
-       */
+        attrArr = this.field.get('name').split('.'),
+        name = attrArr.shift(),
+        vals = this.getValueFromDOM(),
+        collection = model.get(name),
+        removed = [];
+
+      this.stopListening(this.model, 'change:' + name, this.render);
+
+        /*
+         * Iterate through all the values, and find out how many are already
+         * present in the collection.
+         */
       collection.each(function(m) {
         var role = m.get('role'),
-            idx = _.indexOf(vals, role);
+          idx = _.indexOf(vals, role);
 
         if (idx > -1) {
           vals.splice(idx, 1);
@@ -286,26 +280,26 @@ define('pgadmin.node.role', [
         }
       });
 
-      /*
-       * Adding new values
-       */
+        /*
+         * Adding new values
+         */
       _.each(vals, function(v) {
         collection.add({role: v});
       });
 
-      /*
-       * Removing unwanted!
-       */
+        /*
+         * Removing unwanted!
+         */
       _.each(removed, function(v) {
         collection.remove(collection.where({role: v}));
       });
 
-      this.listenTo(this.model, "change:" + name, this.render);
-    }
+      this.listenTo(this.model, 'change:' + name, this.render);
+    },
   });
 
   if (!pgBrowser.Nodes['role']) {
-    var role = pgAdmin.Browser.Nodes['role'] = pgAdmin.Browser.Node.extend({
+    pgAdmin.Browser.Nodes['role'] = pgAdmin.Browser.Node.extend({
       parent_type: 'server',
       type: 'role',
       sqlAlterHelp: 'sql-alterrole.html',
@@ -316,16 +310,16 @@ define('pgadmin.node.role', [
       width: '550px',
       canDrop: function(node, item) {
         var treeData = this.getTreeNodeHierarchy(item),
-            server = treeData['server'];
-        /*
+          server = treeData['server'];
+          /*
         To Drop a role:
           1) If Role we are deleting is superuser then User must be superuser
           2) And for non-superuser roles User must have Create Role permission
-        */
+          */
 
         // Role you are trying to drop is Superuser ?
         if(node.is_superuser) {
-            return server.connected && server.user.is_superuser;
+          return server.connected && server.user.is_superuser;
         }
         // For non super users
         return server.connected && server.user.can_create_role;
@@ -336,7 +330,7 @@ define('pgadmin.node.role', [
       },
       node_image: function(r) {
         if (r == null || r == undefined)
-            return 'icon-role';
+          return 'icon-role';
         return (r.can_login ? 'icon-role' : 'icon-group');
       },
       title: function(d) {
@@ -351,7 +345,7 @@ define('pgadmin.node.role', [
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -360,24 +354,24 @@ define('pgadmin.node.role', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Login/Group Role...'),
           icon: 'wcTabIcon icon-role', data: {action: 'create'},
-          enable: 'can_create_role'
+          enable: 'can_create_role',
         },{
           name: 'create_role_on_roles', node: 'coll-role', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Login/Group Role...'),
           icon: 'wcTabIcon icon-role', data: {action: 'create'},
-          enable: 'can_create_role'
+          enable: 'can_create_role',
         },{
           name: 'create_role', node: 'role', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Login/Group Role...'),
           icon: 'wcTabIcon icon-role', data: {action: 'create'},
-          enable: 'can_create_role'
+          enable: 'can_create_role',
         }]);
       },
       can_create_role: function(node, item) {
         var treeData = this.getTreeNodeHierarchy(item),
-            server = treeData['server'];
+          server = treeData['server'];
 
         return server.connected && server.user.can_create_role;
       },
@@ -398,14 +392,14 @@ define('pgadmin.node.role', [
           rolmembership: [],
           rolvaliduntil: null,
           seclabels: [],
-          variables: []
+          variables: [],
         },
         schema: [{
           id: 'rolname', label: gettext('Name'), type: 'text',
-          disabled: 'readonly'
+          disabled: 'readonly',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string', mode: ['properties'],
-          editable: false, type: 'text', visible: true, disabled: true
+          editable: false, type: 'text', visible: true, disabled: true,
         },{
           id: 'rolpassword', label: gettext('Password'), type: 'password',
           group: gettext('Definition'), mode: ['edit', 'create'],
@@ -415,23 +409,23 @@ define('pgadmin.node.role', [
               var user = this.node_info.server.user;
 
               return (!(user.is_superuser || user.can_create_role) &&
-                  user.id != m.get('oid'));
+                user.id != m.get('oid'));
             }
             return false;
-          }
+          },
         },{
           id: 'rolvaliduntil', disabled: 'readonly', type: 'text',
           group: gettext('Definition'), label: gettext('Account expires'),
           mode: ['properties', 'edit', 'create'], control: 'datetimepicker',
-          deps: ['rolcanlogin'], options: {format: 'YYYY-MM-DD HH:mm:ss Z'}
+          deps: ['rolcanlogin'], options: {format: 'YYYY-MM-DD HH:mm:ss Z'},
         },{
           id: 'rolconnlimit',  type: 'int', group: gettext('Definition'),
           label: gettext('Connection limit'), cell: 'integer', min : -1,
-          mode: ['properties', 'edit', 'create'], disabled: 'readonly'
+          mode: ['properties', 'edit', 'create'], disabled: 'readonly',
         },{
           id: 'rolcanlogin', label: gettext('Can login?'), type: 'switch',
           group: gettext('Privileges'), options: switchOptions,
-          disabled: 'readonly', control: RoleCustomSwitchControl
+          disabled: 'readonly', control: RoleCustomSwitchControl,
         },{
           id: 'rolsuper', label: gettext('Superuser'), type: 'switch',
           group: gettext('Privileges'), options: switchOptions,
@@ -442,40 +436,40 @@ define('pgadmin.node.role', [
               this.model.set('rolcatupdate', this.model.get('rolsuper'));
               this.model.set('rolcreaterole', this.model.get('rolsuper'));
               this.model.set('rolcreatedb', this.model.get('rolsuper'));
-            }
+            },
           }),
-          disabled: 'readonly'
+          disabled: 'readonly',
         },{
           id: 'rolcreaterole', label: gettext('Create roles?'),
           group: gettext('Privileges'), type: 'switch',
           options: switchOptions, disabled: 'readonly',
-          control: RoleCustomSwitchControl
+          control: RoleCustomSwitchControl,
         },{
           id: 'description', label: gettext('Comments'), type: 'multiline',
           group: null, mode: ['properties', 'edit', 'create'],
-          options: switchOptions, disabled: 'readonly'
+          options: switchOptions, disabled: 'readonly',
         },{
           id: 'rolcreatedb', label: gettext('Create databases?'),
           group: gettext('Privileges'), type: 'switch',
           options: switchOptions, disabled: 'readonly',
-          control: RoleCustomSwitchControl
+          control: RoleCustomSwitchControl,
         },{
           id: 'rolcatupdate', label: gettext('Update catalog?'),
           type: 'switch', max_version: 90400, options: switchOptions,
           control: RoleCustomSwitchControl,
           group: gettext('Privileges'), disabled: function(m) {
             return (m.get('read_only') || (!m.get('rolsuper')));
-          }
+          },
         },{
           id: 'rolinherit', group: gettext('Privileges'),
           label: gettext('Inherit rights from the parent roles?'),
           type: 'switch', options: switchOptions, disabled: 'readonly',
-          control: RoleCustomSwitchControl
+          control: RoleCustomSwitchControl,
         },{
           id: 'rolreplication', group: gettext('Privileges'),
           label: gettext('Can initiate streaming replication and backups?'),
           type: 'switch', min_version: 90100, options: switchOptions,
-          disabled: 'readonly', control: RoleCustomSwitchControl
+          disabled: 'readonly', control: RoleCustomSwitchControl,
         },{
           id: 'rolmembership', label: gettext('Roles'),
           group: gettext('Membership'), type: 'collection',
@@ -486,11 +480,11 @@ define('pgadmin.node.role', [
             idAttribute: 'role',
             defaults: {
               role: undefined,
-              admin: false
+              admin: false,
             },
             validate: function() {
               return null;
-            }
+            },
           }),
           filter: function(d) {
             return this.model.isNew() || (this.model.get('rolname') != d.label);
@@ -501,20 +495,20 @@ define('pgadmin.node.role', [
             } else {
               return gettext('Roles shown with a check mark have the WITH ADMIN OPTION set.');
             }
-          }
+          },
         },{
           id: 'variables', label: gettext('Parameters'), type: 'collection',
           group: gettext('Parameters'), hasDatabase: true, url: 'variables',
           model: pgBrowser.Node.VariableModel.extend({keys:['name', 'database']}),
           control: 'variable-collection',
           mode: [ 'edit', 'create'], canAdd: true, canDelete: true,
-          url: "variables", disabled: 'readonly'
+          disabled: 'readonly',
         },{
           id: 'seclabels', label: gettext('Security Labels'),
           model: SecurityModel, editable: false, type: 'collection',
           group: gettext('Security'), mode: ['edit', 'create'],
           min_version: 90200, disabled: 'readonly', canAdd: true,
-          canEdit: false, canDelete: true, control: 'unique-col-collection'
+          canEdit: false, canDelete: true, control: 'unique-col-collection',
         }],
         readonly: function(m) {
           if (!m.has('read_only')) {
@@ -528,8 +522,8 @@ define('pgadmin.node.role', [
         validate: function()
         {
           var err = {},
-              errmsg,
-              seclabels = this.get('seclabels');
+            errmsg,
+            seclabels = this.get('seclabels');
 
           if (_.isUndefined(this.get('rolname')) || String(this.get('rolname')).replace(/^\s+|\s+$/g, '') == '') {
             err['name'] = gettext('Name cannot be empty.');
@@ -555,9 +549,9 @@ define('pgadmin.node.role', [
           }
 
           return null;
-        }
-      })
-    })
+        },
+      }),
+    });
   }
 
   return pgBrowser.Nodes['role'];
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/privilege.js b/web/pgadmin/browser/server_groups/servers/static/js/privilege.js
index 2bd94535..64557a09 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/privilege.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/privilege.js
@@ -1,7 +1,6 @@
 define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
-  'backgrid', 'alertify', 'pgadmin.browser.node', 'pgadmin.browser.node.ui'
-  ],
- function(gettext, _, $, Backbone, Backform, Backgrid, Alertify, pgNode) {
+  'backgrid', 'alertify', 'pgadmin.browser.node', 'pgadmin.browser.node.ui',
+], function(gettext, _, $, Backbone, Backform, Backgrid, Alertify, pgNode) {
   /**
    * Each Privilege, supporeted by an database object, will be represented
    * using this Model.
@@ -17,11 +16,11 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
     defaults: {
       privilege_type: undefined,
       privilege: false,
-      with_grant: false
+      with_grant: false,
     },
     validate: function() {
       return null;
-    }
+    },
   });
 
   /**
@@ -39,7 +38,7 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
     defaults: {
       grantee: undefined,
       grantor: undefined,
-      privileges: undefined
+      privileges: undefined,
     },
     keys: ['grantee', 'grantor'],
     /*
@@ -58,28 +57,28 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
         }
         return !(
           m.top && m.top.node_info &&
-          m.top.node_info.server.user.name == m.get('grantor')
+            m.top.node_info.server.user.name == m.get('grantor')
         );
       },
-      transform: function(data) {
+      transform: function() {
         var res =
           Backgrid.Extension.NodeListByNameCell.prototype.defaults.transform.apply(
             this, arguments
-            );
+          );
         res.unshift({label: 'PUBLIC', value: 'PUBLIC'});
         return res;
       },
       cell: Backgrid.Extension.NodeListByNameCell.extend({
         initialize: function(opts) {
           var self = this,
-              override_opts = true;
+            override_opts = true;
 
           // We would like to override the original options, because - we
           // should omit the existing role/user from the privilege cell.
           // Because - the column is shared among all the cell, we can only
           // override only once.
           if (opts && opts.column &&
-              opts.column instanceof Backbone.Model &&
+            opts.column instanceof Backbone.Model &&
               opts.column.get('options_cached')) {
             override_opts = false;
           }
@@ -89,8 +88,10 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
 
           // Let's override the options
           if (override_opts) {
-            var opts = self.column.get('options');
-            self.column.set('options', self.omit_selected_roles.bind(self, opts));
+            opts = self.column.get('options');
+            self.column.set(
+              'options', self.omit_selected_roles.bind(self, opts)
+            );
           }
 
           var rerender = function (m) {
@@ -108,32 +109,30 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
           // collection, because - we need to omit the newly selected roles
           // form the list. Also, the render will be automatically called for
           // the model represented by this cell, we will not do that again.
-          this.listenTo(self.model.collection, "change", rerender, this);
-          this.listenTo(self.model.collection, "remove", rerender, this);
+          this.listenTo(self.model.collection, 'change', rerender, this);
+          this.listenTo(self.model.collection, 'remove', rerender, this);
         },
         // Remove all the selected roles (though- not mine).
         omit_selected_roles: function(opts, cell) {
           var res = opts(cell),
-              selected = {},
-              model = cell.model,
-              cid = model.cid,
-              // We need to check node_info values in parent when object is nested.
-              // eg: column level privileges in table dialog
-              // In this case node_info will not be avilable to column node as
-              // it is not loaded yet
-              node_info = (_.has(model.top, 'node_info')
-                            && !_.isUndefined(model.top.node_info)) ?
-                              model.top.node_info :
-                              model.handler.top.node_info,
-              curr_user = node_info.server.user.name;
-
-          var idx = 0;
+            selected = {},
+            model = cell.model,
+            cid = model.cid,
+            // We need to check node_info values in parent when object is nested.
+            // eg: column level privileges in table dialog
+            // In this case node_info will not be avilable to column node as
+            // it is not loaded yet
+            node_info = (_.has(model.top, 'node_info')
+              && !_.isUndefined(model.top.node_info)) ?
+            model.top.node_info :
+            model.handler.top.node_info,
+            curr_user = node_info.server.user.name;
 
           model.collection.each(function(m) {
             var grantee = m.get('grantee');
 
             if (m.cid != cid && !_.isUndefined(grantee) &&
-                curr_user == m.get('grantor')) {
+              curr_user == m.get('grantor')) {
               selected[grantee] = m.cid;
             }
           });
@@ -143,23 +142,26 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
           });
 
           return res;
-        }
+        },
       }),
     },{
       id: 'privileges', label: gettext('Privileges'),
       type: 'collection', model: PrivilegeModel, group: null,
       cell: 'privilege', control: 'text', cellHeaderClasses: 'width_percent_40',
-      disabled : function(column, collection) {
+      disabled : function(column) {
         if (column instanceof Backbone.Collection) {
           // This has been called during generating the header cell
           return false;
         }
-        return !(this.node_info && this.node_info.server.user.name == column.get('grantor') ||
-                this.attributes.node_info.server.user.name == column.get('grantor'));
-      }
+        return !(
+          this.node_info &&
+            this.node_info.server.user.name == column.get('grantor') ||
+            this.attributes.node_info.server.user.name == column.get('grantor')
+        );
+      },
     },{
       id: 'grantor', label: gettext('Grantor'), type: 'text', disabled: true,
-      cell: 'node-list-by-name', node: 'role'
+      cell: 'node-list-by-name', node: 'role',
     }],
 
     /*
@@ -172,36 +174,36 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
 
       if (_.isNull(attrs)) {
         this.set(
-            'grantor',
-            opts && opts.top && opts.top.node_info && opts.top.node_info.server.user.name,
-            {silent: true}
-            );
+          'grantor',
+          opts && opts.top && opts.top.node_info && opts.top.node_info.server.user.name,
+          {silent: true}
+        );
       }
 
       /*
        * Define the collection of the privilege supported by this model
        */
       var self = this,
-          models = self.get('privileges'),
-          privileges = this.get('privileges') || {};
+        models = self.get('privileges'),
+        privileges = this.get('privileges') || {};
 
       if (_.isArray(privileges)) {
         privileges = new (pgNode.Collection)(
-            models, {
-              model: PrivilegeModel,
-              top: this.top || this,
-              handler: this,
-              silent: true,
-              parse: false
-            });
+          models, {
+            model: PrivilegeModel,
+            top: this.top || this,
+            handler: this,
+            silent: true,
+            parse: false,
+          });
         this.set('privileges', privileges, {silent: true});
       }
 
       var privs = {};
       _.each(self.privileges, function(p) {
         privs[p] = {
-          'privilege_type': p, 'privilege': false, 'with_grant': false
-        }
+          'privilege_type': p, 'privilege': false, 'with_grant': false,
+        };
       });
 
       privileges.each(function(m) {
@@ -212,7 +214,7 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
         privileges.add(p, {silent: true});
       });
 
-      self.on("change:grantee", self.granteeChanged);
+      self.on('change:grantee', self.granteeChanged);
       privileges.on('change', function() {
         self.trigger('change:privileges', self);
       });
@@ -222,22 +224,22 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
 
     granteeChanged: function() {
       var privileges = this.get('privileges'),
-          grantee = this.get('grantee');
+        grantee = this.get('grantee');
 
       // Reset all with grant options if grantee is public.
       if (grantee == 'PUBLIC') {
         privileges.each(function(m) {
-          m.set("with_grant", false, {silent: true});
+          m.set('with_grant', false, {silent: true});
         });
       }
     },
 
-    toJSON: function(session) {
+    toJSON: function() {
 
       var privileges = [];
 
       if (this.attributes &&
-            !this.attributes['privileges']) {
+        !this.attributes['privileges']) {
         return null;
       }
 
@@ -251,71 +253,68 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
       return {
         'grantee': this.get('grantee'),
         'grantor': this.get('grantor'),
-        'privileges': privileges
-        };
+        'privileges': privileges,
+      };
     },
 
     validate: function() {
-      var err = {},
-        errmsg = null,
-        changedAttrs = this.sessAttrs,
-        msg = undefined;
+      var  errmsg = null,
+        msg;
 
       if (_.isUndefined(this.get('grantee'))) {
         msg = gettext('A grantee must be selected.');
         this.errorModel.set('grantee', msg);
         errmsg = msg;
       } else {
-         this.errorModel.unset('grantee');
+        this.errorModel.unset('grantee');
       }
 
-
       if (this.attributes &&
-            this.attributes['privileges']) {
-          var anyPrivSelected = false;
-          this.attributes['privileges'].each(
+        this.attributes['privileges']) {
+        var anyPrivSelected = false;
+        this.attributes['privileges'].each(
             function(p) {
               if (p.get('privilege')) {
                 anyPrivSelected = true;
               }
             });
 
-          if (!anyPrivSelected) {
-            msg = gettext('At least one privilege should be selected.');
-            this.errorModel.set('privileges', msg);
-            errmsg = errmsg || msg;
-          } else {
-            this.errorModel.unset('privileges');
-          }
+        if (!anyPrivSelected) {
+          msg = gettext('At least one privilege should be selected.');
+          this.errorModel.set('privileges', msg);
+          errmsg = errmsg || msg;
+        } else {
+          this.errorModel.unset('privileges');
+        }
       }
 
       return errmsg;
-    }
+    },
   });
 
   /**
-     Custom cell editor for editing privileges.
+   Custom cell editor for editing privileges.
    */
   var PrivilegeCellEditor = Backgrid.Extension.PrivilegeCellEditor =
     Backgrid.CellEditor.extend({
-      tagName: "div",
+      tagName: 'div',
 
       // All available privileges in the PostgreSQL database server for
       // generating the label for the specific Control
       Labels: {
-        "C": "CREATE",
-        "T": "TEMPORARY",
-        "c": "CONNECT",
-        "a": "INSERT",
-        "r": "SELECT",
-        "w": "UPDATE",
-        "d": "DELETE",
-        "D": "TRUNCATE",
-        "x": "REFERENCES",
-        "t": "TRIGGER",
-        "U": "USAGE",
-        "X": "EXECUTE"
-        },
+        'C': 'CREATE',
+        'T': 'TEMPORARY',
+        'c': 'CONNECT',
+        'a': 'INSERT',
+        'r': 'SELECT',
+        'w': 'UPDATE',
+        'd': 'DELETE',
+        'D': 'TRUNCATE',
+        'x': 'REFERENCES',
+        't': 'TRIGGER',
+        'U': 'USAGE',
+        'X': 'EXECUTE',
+      },
 
       template: _.template([
         '<tr class="<%= header ? "header" : "" %>">',
@@ -331,11 +330,11 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
         '   WITH GRANT OPTION',
         '  </label>',
         ' </td>',
-        '</tr>'].join(" "), null, {variable: null}),
+        '</tr>'].join(' '), null, {variable: null}),
 
       events: {
         'change': 'privilegeChanged',
-        'blur': 'lostFocus'
+        'blur': 'lostFocus',
       },
 
       render: function () {
@@ -343,10 +342,10 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
         this.$el.attr('tabindex', '1');
         this.$el.attr('target', this.elId);
 
-        var collection = this.model.get(this.column.get("name")),
-            tbl = $("<table></table>").appendTo(this.$el),
-            self = this,
-            privilege = true, with_grant = true;
+        var collection = this.model.get(this.column.get('name')),
+          tbl = $('<table></table>').appendTo(this.$el),
+          self = this,
+          privilege = true, with_grant = true;
 
         // For each privilege generate html template.
         // List down all the Privilege model.
@@ -362,8 +361,8 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
               'header': false,
               'privilege_label': self.Labels[d.privilege_type],
               'with_grant': (self.model.get('grantee') != 'PUBLIC' && d.with_grant),
-              'enable_with_grant': (self.model.get('grantee') != 'PUBLIC' && d.privilege)
-              });
+              'enable_with_grant': (self.model.get('grantee') != 'PUBLIC' && d.privilege),
+            });
           privilege = (privilege && d.privilege);
           with_grant = (with_grant && privilege && d.with_grant);
           tbl.append(self.template(d));
@@ -372,15 +371,15 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
         if (collection.length > 1) {
           // Preprend the ALL controls on that table
           tbl.prepend(
-              self.template({
-                'target': self.cid,
-                'privilege_label': 'ALL',
-                'privilege_type': 'ALL',
-                'privilege': privilege,
-                'with_grant': (self.model.get('grantee') != 'PUBLIC' && with_grant),
-                'enable_with_grant': (self.model.get('grantee') != 'PUBLIC' && privilege),
-                'header': true
-              }));
+            self.template({
+              'target': self.cid,
+              'privilege_label': 'ALL',
+              'privilege_type': 'ALL',
+              'privilege': privilege,
+              'with_grant': (self.model.get('grantee') != 'PUBLIC' && with_grant),
+              'enable_with_grant': (self.model.get('grantee') != 'PUBLIC' && privilege),
+              'header': true,
+            }));
         }
         self.$el.find('input[type=checkbox]').first().focus();
         // Since blur event does not bubble we need to explicitly call parent's blur event.
@@ -406,13 +405,14 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
            * We're looking for checkboxes only.
            */
           var $el = $(ev.target),
-              privilege_type = $el.attr('privilege'),
-              type = $el.attr('name'),
-              checked = $el.prop('checked'),
-              $tr = $el.closest('tr'),
-              $tbl = $tr.closest('table'),
-              collection = this.model.get('privileges'),
-              grantee = this.model.get('grantee');
+            privilege_type = $el.attr('privilege'),
+            type = $el.attr('name'),
+            checked = $el.prop('checked'),
+            $tr = $el.closest('tr'),
+            $tbl = $tr.closest('table'),
+            collection = this.model.get('privileges'),
+            grantee = this.model.get('grantee'), $allGrants,
+            $allPrivileges, $elGrant;
 
           this.undelegateEvents();
           /*
@@ -420,14 +420,15 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
            * the checkbox for each privilege.
            */
           if (privilege_type == 'ALL') {
-            var $elGrant = $tr.find('input[name=with_grant]'),
-                $allPrivileges = $tbl.find(
-                    'input[name=privilege][privilege!=\'ALL\']'
-                    ),
-                $allGrants = $tbl.find(
-                    'input[name=with_grant][privilege!=\'ALL\']'
-                    ),
-                allPrivilege, allWithGrant;
+            var allPrivilege, allWithGrant;
+
+            $elGrant = $tr.find('input[name=with_grant]');
+            $allPrivileges = $tbl.find(
+              'input[name=privilege][privilege!=\'ALL\']'
+            );
+            $allGrants = $tbl.find(
+              'input[name=with_grant][privilege!=\'ALL\']'
+            );
 
             if (type == 'privilege') {
               /*
@@ -439,6 +440,7 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
 
               if (checked) {
                 $allPrivileges.prop('checked', true);
+
                 /*
                  * We have clicked the ALL checkbox, we should be able to select
                  * the grant options too.
@@ -461,7 +463,7 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
                  */
                 $allPrivileges.prop('checked', false);
                 $elGrant.prop('checked', false),
-                $allGrants.prop('checked', false);
+                  $allGrants.prop('checked', false);
                 $elGrant.prop('disabled', true);
                 $allGrants.prop('disabled', true);
               }
@@ -479,146 +481,149 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
               $allGrants.prop('checked', checked);
             }
 
-          /*
-           * Set the values for each Privilege Model.
-           */
-          collection.each(function(m) {
-            m.set(
-              {'privilege': allPrivilege, 'with_grant': allWithGrant},
-              {silent: true}
+            /*
+             * Set the values for each Privilege Model.
+             */
+            collection.each(function(m) {
+              m.set(
+                {'privilege': allPrivilege, 'with_grant': allWithGrant},
+                {silent: true}
+              );
+            });
+          } else {
+            /*
+             * Particular privilege has been selected/deselected, which can be
+             * identified using the privilege="X" attribute.
+             */
+            var attrs = {};
+
+            $tbl = $tr.closest('table');
+            $allPrivileges = $tbl.find(
+              'input[name=privilege][privilege=\'ALL\']'
             );
-          });
-        } else {
-          /*
-           * Particular privilege has been selected/deselected, which can be
-           * identified using the privilege="X" attribute.
-           */
-          var attrs = {},
-              $tbl = $tr.closest('table'),
-              $allPrivilege = $tbl.find(
-                  'input[name=privilege][privilege=\'ALL\']'
-                  ),
-              $allGrant = $tbl.find(
-                  'input[name=with_grant][privilege=\'ALL\']'
-                  );
-
-          attrs[type] = checked;
-
-          if (type == 'privilege') {
-            var $elGrant = ($el.closest('tr')).find('input[name=with_grant]');
-            if (!checked) {
-              attrs['with_grant'] = false;
-
-              $elGrant.prop('checked', false).prop('disabled', true);
-              $allPrivilege.prop('checked', false);
-              $allGrant.prop('disabled', true);
-              $allGrant.prop('checked', false);
-            } else if (grantee != "PUBLIC") {
-              $elGrant.prop('disabled', false);
+            $allGrants = $tbl.find(
+              'input[name=with_grant][privilege=\'ALL\']'
+            );
+
+            attrs[type] = checked;
+
+            if (type == 'privilege') {
+              $elGrant = ($el.closest('tr')).find('input[name=with_grant]');
+              if (!checked) {
+                attrs['with_grant'] = false;
+
+                $elGrant.prop('checked', false).prop('disabled', true);
+                $allPrivileges.prop('checked', false);
+                $allGrants.prop('disabled', true);
+                $allGrants.prop('checked', false);
+              } else if (grantee != 'PUBLIC') {
+                $elGrant.prop('disabled', false);
+              }
+            } else if (!checked) {
+              $allGrants.prop('checked', false);
             }
-          } else if (!checked) {
-            $allGrant.prop('checked', false);
-          }
-          collection.get(privilege_type).set(attrs, {silent: true});
+            collection.get(privilege_type).set(attrs, {silent: true});
 
-          if (checked) {
-            var $allPrivileges = $tbl.find(
-                  'input[name=privilege][privilege!=\'ALL\']:checked'
-                  );
+            if (checked) {
+              $allPrivileges = $tbl.find(
+                'input[name=privilege][privilege!=\'ALL\']:checked'
+              );
 
-            if ($allPrivileges.length > 1 &&
-                  $allPrivileges.length == collection.models.length) {
+              if ($allPrivileges.length > 1 &&
+                $allPrivileges.length == collection.models.length) {
 
-              $allPrivilege.prop('checked', true);
+                $allPrivileges.prop('checked', true);
 
-              if (type == 'with_grant') {
-                var $allGrants = $tbl.find(
-                    'input[name=with_grant][privilege!=\'ALL\']:checked'
+                if (type == 'with_grant') {
+                  $allGrants = $tbl.find(
+                      'input[name=with_grant][privilege!=\'ALL\']:checked'
                     );
-                if ($allGrants.length == collection.models.length) {
-                  $allGrant.prop('disabled', false);
-                  $allGrant.prop('checked', true);
+                  if ($allGrants.length == collection.models.length) {
+                    $allGrants.prop('disabled', false);
+                    $allGrants.prop('checked', true);
+                  }
+                } else if (grantee != 'PUBLIC') {
+                  $allGrants.prop('disabled', false);
                 }
-              } else if (grantee != "PUBLIC") {
-                $allGrant.prop('disabled', false);
               }
             }
           }
-        }
-        this.model.trigger('change', this.model);
+          this.model.trigger('change', this.model);
 
-        var anySelected = false,
+          var anySelected = false,
             msg = null;
 
-        collection.each(function(m) {
-          anySelected = anySelected || m.get('privilege');
-        });
+          collection.each(function(m) {
+            anySelected = anySelected || m.get('privilege');
+          });
 
-        if (anySelected) {
-          this.model.errorModel.unset('privileges');
-          if (this.model.errorModel.has('grantee')) {
-            msg = this.model.errorModel.get('grantee');
-          }
-        } else {
-          this.model.errorModel.set(
-            'privileges', gettext('At least one privilege should be selected.')
+          if (anySelected) {
+            this.model.errorModel.unset('privileges');
+            if (this.model.errorModel.has('grantee')) {
+              msg = this.model.errorModel.get('grantee');
+            }
+          } else {
+            this.model.errorModel.set(
+              'privileges', gettext('At least one privilege should be selected.')
             );
-          msg = gettext('At least one privilege should be selected.');
-        }
-        if (msg) {
-          this.model.collection.trigger(
-            'pgadmin-session:model:invalid', msg, this.model
+            msg = gettext('At least one privilege should be selected.');
+          }
+          if (msg) {
+            this.model.collection.trigger(
+              'pgadmin-session:model:invalid', msg, this.model
             );
-        } else {
-          this.model.collection.trigger(
-            'pgadmin-session:model:valid', this.model
+          } else {
+            this.model.collection.trigger(
+              'pgadmin-session:model:valid', this.model
             );
+          }
         }
-      }
-      this.delegateEvents();
-    },
+        this.delegateEvents();
+      },
 
-    lostFocus: function(ev) {
-      /*
-       * We lost the focus, it's time for us to exit the editor.
-       */
-      var self = this,
-      /*
-       * Function to determine whether one dom element is descendant of another
-       * dom element.
-       */
-      isDescendant = function (parent, child) {
-         var node = child.parentNode;
-         while (node != null) {
-             if (node == parent) {
-                 return true;
-             }
-             node = node.parentNode;
-         }
-         return false;
-      }
-      /*
-       * Between leaving the old element focus and entering the new element focus the
-       * active element is the document/body itself so add timeout to get the proper
-       * focused active element.
-       */
-      setTimeout(function() {
+      lostFocus: function(ev) {
         /*
-         Do not close the control if user clicks outside dialog window,
-         only close the row if user clicks on add button or on another row, if user
-         clicks somewhere else then we will get tagName as 'BODY' or 'WINDOW'
-        */
-        var is_active_element = document.activeElement.tagName == 'DIV' ||
-                                document.activeElement.tagName == 'BUTTON';
-
-        if (is_active_element && self.$el[0] != document.activeElement &&
-                !isDescendant(self.$el[0], document.activeElement)) {
-          var m = self.model;
-          m.trigger('backgrid:edited', m, self.column, new Backgrid.Command(ev));
-        }},10);
-      return;
-    }
-  });
+         * We lost the focus, it's time for us to exit the editor.
+         */
+        var self = this,
+          /*
+           * Function to determine whether one dom element is descendant of another
+           * dom element.
+           */
+          isDescendant = function (parent, child) {
+            var node = child.parentNode;
+            while (node != null) {
+              if (node == parent) {
+                return true;
+              }
+              node = node.parentNode;
+            }
+            return false;
+          };
+
+        /*
+         * Between leaving the old element focus and entering the new element focus the
+         * active element is the document/body itself so add timeout to get the proper
+         * focused active element.
+         */
+        setTimeout(function() {
+          /*
+           * Do not close the control if user clicks outside dialog window,
+           * only close the row if user clicks on add button or on another row,
+           * if user clicks somewhere else then we will get tagName as 'BODY'
+           * or 'WINDOW'
+           */
+          var is_active_element = document.activeElement.tagName == 'DIV' ||
+            document.activeElement.tagName == 'BUTTON';
+
+          if (is_active_element && self.$el[0] != document.activeElement &&
+            !isDescendant(self.$el[0], document.activeElement)) {
+            var m = self.model;
+            m.trigger('backgrid:edited', m, self.column, new Backgrid.Command(ev));
+          }},10);
+        return;
+      },
+    });
 
   /*
    * This will help us transform the privileges value in proper format to be
@@ -628,26 +633,25 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
     function () {};
   _.extend(PrivilegeCellFormatter.prototype, {
     notation: {
-      "CREATE" : "C",
-      "TEMPORARY" : "T",
-      "CONNECT" : "c",
-      "INSERT" : "a",
-      "SELECT" : "r",
-      "UPDATE" : "w",
-      "DELETE" : "d",
-      "TRUNCATE" : "D",
-      "REFERENCES" : "x",
-      "TRIGGER" : "t",
-      "USAGE" : "U",
-      "EXECUTE" : "X"
+      'CREATE' : 'C',
+      'TEMPORARY' : 'T',
+      'CONNECT' : 'c',
+      'INSERT' : 'a',
+      'SELECT' : 'r',
+      'UPDATE' : 'w',
+      'DELETE' : 'd',
+      'TRUNCATE' : 'D',
+      'REFERENCES' : 'x',
+      'TRIGGER' : 't',
+      'USAGE' : 'U',
+      'EXECUTE' : 'X',
     },
     /**
      * Takes a raw value from a model and returns an optionally formatted
      * string for display.
      */
-    fromRaw: function (rawData, model) {
-      var res = '',
-          self = this;
+    fromRaw: function (rawData) {
+      var res = '';
 
       if (rawData instanceof Backbone.Collection) {
         rawData.each(function(m) {
@@ -660,23 +664,23 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
         });
       }
       return res;
-    }
+    },
   });
 
   /*
    *  PrivilegeCell for rendering and taking input for the privileges.
    */
-  var PrivilegeCell = Backgrid.Extension.PrivilegeCell = Backgrid.Cell.extend({
-    className: "edit-cell",
+  Backgrid.Extension.PrivilegeCell = Backgrid.Cell.extend({
+    className: 'edit-cell',
     formatter: PrivilegeCellFormatter,
     editor: PrivilegeCellEditor,
 
-    initialize: function (options) {
+    initialize: function () {
       var self = this;
       Backgrid.Cell.prototype.initialize.apply(this, arguments);
 
-      self.model.on("change:grantee", function() {
-        if (!self.$el.hasClass("editor")) {
+      self.model.on('change:grantee', function() {
+        if (!self.$el.hasClass('editor')) {
           /*
            * Add time out before render; As we might want to wait till model
            * is updated by PrivilegeRoleModel:granteeChanged.
@@ -686,7 +690,7 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
           },10);
         }
       });
-    }
+    },
   });
 
   return PrivilegeRoleModel;
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.js b/web/pgadmin/browser/server_groups/servers/static/js/server.js
index 3736a302..99328083 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/server.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/server.js
@@ -1,46 +1,43 @@
 define('pgadmin.node.server', [
-  'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
+  'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
   'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
-  'pgadmin.server.supported_servers',
-  'pgadmin.user_management.current_user',
-  'pgadmin.alertifyjs', 'pgadmin.browser.server.privilege'
+  'pgadmin.server.supported_servers', 'pgadmin.user_management.current_user',
+  'pgadmin.alertifyjs', 'pgadmin.backform', 'pgadmin.browser.server.privilege',
 ], function(
-  gettext, url_for, $, _, S, pgAdmin, pgBrowser,
-  supported_servers, current_user, alertify
+  gettext, url_for, $, _, Backbone, S, pgAdmin, pgBrowser,
+  supported_servers, current_user, Alertify, Backform
 ) {
 
   if (!pgBrowser.Nodes['server']) {
     var SSL_MODES = ['prefer', 'require', 'verify-ca', 'verify-full'];
 
-    var SecurityModel = pgBrowser.SecLabelModel = pgBrowser.Node.Model.extend({
+    pgBrowser.SecLabelModel = pgBrowser.Node.Model.extend({
       defaults: {
         provider: undefined,
-        label: undefined
+        label: undefined,
       },
       schema: [{
         id: 'provider', label: gettext('Provider'),
         type: 'text', editable: true,
-        cellHeaderClasses:'width_percent_50'
+        cellHeaderClasses:'width_percent_50',
       },{
         id: 'label', label: gettext('Security Label'),
         type: 'text', editable: true,
-        cellHeaderClasses:'override_label_class_font_size'
+        cellHeaderClasses:'override_label_class_font_size',
       }],
       validate: function() {
-        var err = {},
-          errmsg = null;
         this.errorModel.clear();
 
         if (_.isUndefined(this.get('label')) ||
           _.isNull(this.get('label')) ||
-          String(this.get('label')).replace(/^\s+|\s+$/g, '') == '') {
-            errmsg = gettext('Label must be specified.');
-            this.errorModel.set('label', errmsg);
-            return errmsg;
+            String(this.get('label')).replace(/^\s+|\s+$/g, '') == '') {
+          var errmsg = gettext('Label must be specified.');
+          this.errorModel.set('label', errmsg);
+          return errmsg;
         }
 
         return null;
-      }
+      },
     });
 
     pgAdmin.Browser.Nodes['server'] = pgAdmin.Browser.Node.extend({
@@ -66,48 +63,48 @@ define('pgadmin.node.server', [
           name: 'create_server_on_sg', node: 'server_group', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 1, label: gettext('Server...'),
-          data: {action: 'create'}, icon: 'wcTabIcon icon-server'
+          data: {action: 'create'}, icon: 'wcTabIcon icon-server',
         },{
           name: 'create_server', node: 'server', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 3, label: gettext('Server...'),
-          data: {action: 'create'}, icon: 'wcTabIcon icon-server'
+          data: {action: 'create'}, icon: 'wcTabIcon icon-server',
         },{
           name: 'connect_server', node: 'server', module: this,
           applies: ['object', 'context'], callback: 'connect_server',
           category: 'connect', priority: 4, label: gettext('Connect Server'),
-          icon: 'fa fa-link', enable : 'is_not_connected'
+          icon: 'fa fa-link', enable : 'is_not_connected',
         },{
           name: 'disconnect_server', node: 'server', module: this,
           applies: ['object', 'context'], callback: 'disconnect_server',
           category: 'drop', priority: 5, label: gettext('Disconnect Server'),
-          icon: 'fa fa-chain-broken', enable : 'is_connected'
+          icon: 'fa fa-chain-broken', enable : 'is_connected',
         },{
           name: 'reload_configuration', node: 'server', module: this,
           applies: ['tools', 'context'], callback: 'reload_configuration',
           category: 'reload', priority: 6, label: gettext('Reload Configuration'),
-          icon: 'fa fa-repeat', enable : 'enable_reload_config'
+          icon: 'fa fa-repeat', enable : 'enable_reload_config',
         },{
           name: 'restore_point', node: 'server', module: this,
           applies: ['tools', 'context'], callback: 'restore_point',
           category: 'restore', priority: 9, label: gettext('Add Named Restore Point...'),
-          icon: 'fa fa-anchor', enable : 'is_applicable'
+          icon: 'fa fa-anchor', enable : 'is_applicable',
         },{
           name: 'change_password', node: 'server', module: this,
           applies: ['file'], callback: 'change_password',
           label: gettext('Change Password...'),
-          icon: 'fa fa-lock', enable : 'is_connected'
+          icon: 'fa fa-lock', enable : 'is_connected',
         },{
           name: 'wal_replay_pause', node: 'server', module: this,
           applies: ['tools', 'context'], callback: 'pause_wal_replay',
           category: 'wal_replay_pause', priority: 7, label: gettext('Pause Replay of WAL'),
-          icon: 'fa fa-pause-circle', enable : 'wal_pause_enabled'
+          icon: 'fa fa-pause-circle', enable : 'wal_pause_enabled',
         },{
           name: 'wal_replay_resume', node: 'server', module: this,
           applies: ['tools', 'context'], callback: 'resume_wal_replay',
           category: 'wal_replay_resume', priority: 8, label: gettext('Resume Replay of WAL'),
-          icon: 'fa fa-play-circle', enable : 'wal_resume_enabled'
-         }]);
+          icon: 'fa fa-play-circle', enable : 'wal_resume_enabled',
+        }]);
 
         _.bindAll(this, 'connection_lost');
         pgBrowser.Events.on(
@@ -122,38 +119,38 @@ define('pgadmin.node.server', [
       },
       enable_reload_config: function(node) {
         // Must be connected & is Super user
-        if (node && node._type == "server" &&
-            node.connected && node.user.is_superuser) {
-          return true
+        if (node && node._type == 'server' &&
+          node.connected && node.user.is_superuser) {
+          return true;
         }
         return false;
       },
       is_applicable: function(node) {
         // Must be connected & super user & not in recovery mode
-        if (node && node._type == "server" &&
-            node.connected && node.user.is_superuser
+        if (node && node._type == 'server' &&
+          node.connected && node.user.is_superuser
             && node.in_recovery == false) {
-            return true;
+          return true;
         }
         return false;
       },
       wal_pause_enabled: function(node) {
         // Must be connected & is Super user & in Recovery mode
-        if (node && node._type == "server" &&
-            node.connected && node.user.is_superuser
+        if (node && node._type == 'server' &&
+          node.connected && node.user.is_superuser
             && node.in_recovery == true
             && node.wal_pause == false) {
-            return true;
+          return true;
         }
         return false;
       },
       wal_resume_enabled: function(node) {
         // Must be connected & is Super user & in Recovery mode
-        if (node && node._type == "server" &&
-            node.connected && node.user.is_superuser
+        if (node && node._type == 'server' &&
+          node.connected && node.user.is_superuser
             && node.in_recovery == true
             && node.wal_pause == true) {
-            return true;
+          return true;
         }
         return false;
       },
@@ -191,7 +188,7 @@ define('pgadmin.node.server', [
               type:'DELETE',
               success: function(res) {
                 if (res.success == 1) {
-                  alertify.success(res.info);
+                  Alertify.success(res.info);
                   d = t.itemData(i);
                   t.removeIcon(i);
                   d.connected = false;
@@ -199,7 +196,7 @@ define('pgadmin.node.server', [
                   t.addIcon(i, {icon: d.icon});
                   obj.callbacks.refresh.apply(obj, [null, i]);
                   if (pgBrowser.serverInfo && d._id in pgBrowser.serverInfo) {
-                    delete pgBrowser.serverInfo[d._id]
+                    delete pgBrowser.serverInfo[d._id];
                   }
                   pgBrowser.enable_disable_menus(i);
                   // Trigger server disconnect event
@@ -210,32 +207,36 @@ define('pgadmin.node.server', [
                 }
                 else {
                   try {
-                    alertify.error(res.errormsg);
-                  } catch (e) {}
+                    Alertify.error(res.errormsg);
+                  } catch (e) {
+                    console.warn(e.stack || e);
+                  }
                   t.unload(i);
                 }
               },
-              error: function(xhr, status, error) {
+              error: function(xhr) {
                 try {
                   var err = $.parseJSON(xhr.responseText);
                   if (err.success == 0) {
-                    alertify.error(err.errormsg);
+                    Alertify.error(err.errormsg);
                   }
-                } catch (e) {}
+                } catch (e) {
+                  console.warn(e.stack || e);
+                }
                 t.unload(i);
-              }
+              },
             });
           };
 
           if (notify) {
-            alertify.confirm(
+            Alertify.confirm(
               gettext('Disconnect server'),
               gettext(
                 'Are you sure you want to disconnect the server %(server)s?',
                 {server: d.label}
               ),
-              function(evt) { disconnect(); },
-              function(evt) { return true;}
+              function() { disconnect(); },
+              function() { return true;}
             );
           } else {
             disconnect();
@@ -278,35 +279,38 @@ define('pgadmin.node.server', [
           if (!d)
             return false;
 
-          alertify.confirm(
+          Alertify.confirm(
             gettext('Reload server configuration'),
-            S( gettext('Are you sure you want to reload the server configuration on %s?')).sprintf(d.label).value(),
-            function(evt) {
+            S(
+              gettext('Are you sure you want to reload the server configuration on %s?')
+            ).sprintf(d.label).value(),
+            function() {
               $.ajax({
                 url: obj.generate_url(i, 'reload', d, true),
                 method:'GET',
                 success: function(res) {
                   if (res.data.status) {
-                    alertify.success(res.data.result);
+                    Alertify.success(res.data.result);
                   }
                   else {
-                    alertify.error(res.data.result);
+                    Alertify.error(res.data.result);
                   }
                 },
-                error: function(xhr, status, error) {
+                error: function(xhr) {
                   try {
                     var err = $.parseJSON(xhr.responseText);
                     if (err.success == 0) {
-                      alertify.error(err.errormsg);
+                      Alertify.error(err.errormsg);
                     }
-                  } catch (e) {}
+                  } catch (e) {
+                    console.warn(e.stack || e);
+                  }
                   t.unload(i);
-                }
+                },
               });
-          },
-          function(evt) {
-              return true;
-          });
+            },
+            function() { return true; }
+          );
 
           return false;
         },
@@ -321,40 +325,41 @@ define('pgadmin.node.server', [
           if (!d)
             return false;
 
-          alertify.prompt( gettext('Enter the name of the restore point to add'), '',
-           // We will execute this function when user clicks on the OK button
-           function(evt, value) {
-             // If user has provided a value, send it to the server
-             if(!_.isUndefined(value) && !_.isNull(value) && value !== ''
+          Alertify.prompt(
+            gettext('Enter the name of the restore point to add'), '',
+            // We will execute this function when user clicks on the OK button
+            function(evt, value) {
+              // If user has provided a value, send it to the server
+              if(!_.isUndefined(value) && !_.isNull(value) && value !== ''
                 && String(value).replace(/^\s+|\s+$/g, '') !== '') {
-              $.ajax({
-                url: obj.generate_url(i, 'restore_point', d, true),
-                method:'POST',
-                data:{ 'value': JSON.stringify(value) },
-                success: function(res) {
-                  alertify.success(res.data.result, 10);
-                },
-                error: function(xhr, status, error) {
-                  try {
-                    var err = $.parseJSON(xhr.responseText);
-                    if (err.success == 0) {
-                      alertify.error(err.errormsg, 10);
+                $.ajax({
+                  url: obj.generate_url(i, 'restore_point', d, true),
+                  method:'POST',
+                  data:{ 'value': JSON.stringify(value) },
+                  success: function(res) {
+                    Alertify.success(res.data.result, 10);
+                  },
+                  error: function(xhr) {
+                    try {
+                      var err = $.parseJSON(xhr.responseText);
+                      if (err.success == 0) {
+                        Alertify.error(err.errormsg, 10);
+                      }
+                    } catch (e) {
+                      console.warn(e.stack || e);
                     }
-                  } catch (e) {}
-                  t.unload(i);
-                }
-              });
-             } else {
+                    t.unload(i);
+                  },
+                });
+              } else {
                 evt.cancel = true;
-                alertify.error( gettext('Please enter a valid name.'), 10);
-             }
-           },
-           // We will execute this function when user clicks on the Cancel button
-           // Do nothing just close it
-           function(evt, value) {
-             evt.cancel = false;
-           }
-          ).set({'title':'Restore point name'});
+                Alertify.error( gettext('Please enter a valid name.'), 10);
+              }
+            },
+            // We will execute this function when user clicks on the Cancel
+            // button.  Do nothing just close it.
+            function(evt) { evt.cancel = false; }
+          ).set({'title': gettext('Restore point name')});
         },
 
         /* Change password */
@@ -364,7 +369,6 @@ define('pgadmin.node.server', [
             t = pgBrowser.tree,
             i = input.item || t.selected(),
             d = i && i.length == 1 ? t.itemData(i) : undefined,
-            node = d && pgBrowser.Nodes[d._type],
             url = obj.generate_url(i, 'change_password', d, true),
             is_pgpass_file_used = false,
             check_pgpass_url = obj.generate_url(i, 'check_pgpass', d, true);
@@ -372,51 +376,51 @@ define('pgadmin.node.server', [
           if (!d)
             return false;
 
-          if(!alertify.changeServerPassword) {
+          if(!Alertify.changeServerPassword) {
             var newPasswordModel = Backbone.Model.extend({
                 defaults: {
                   user_name: undefined,
                   password: undefined,
                   newPassword: undefined,
-                  confirmPassword: undefined
+                  confirmPassword: undefined,
                 },
                 validate: function() {
                   return null;
-                }
+                },
               }),
               passwordChangeFields = [{
-                  name: 'user_name', label: gettext('User'),
-                  type: 'text', disabled: true, control: 'input'
-                },{
-                  name: 'password', label: gettext('Current Password'),
-                  type: 'password', disabled: function() { return is_pgpass_file_used },
-                  control: 'input', required: true
-                },{
-                  name: 'newPassword', label: gettext('New Password'),
-                  type: 'password', disabled: false, control: 'input',
-                  required: true
-                },{
-                  name: 'confirmPassword', label: gettext('Confirm Password'),
-                  type: 'password', disabled: false, control: 'input',
-                  required: true
-                }];
-
-
-            alertify.dialog('changeServerPassword' ,function factory() {
+                name: 'user_name', label: gettext('User'),
+                type: 'text', disabled: true, control: 'input',
+              },{
+                name: 'password', label: gettext('Current Password'),
+                type: 'password', disabled: function() { return is_pgpass_file_used; },
+                control: 'input', required: true,
+              },{
+                name: 'newPassword', label: gettext('New Password'),
+                type: 'password', disabled: false, control: 'input',
+                required: true,
+              },{
+                name: 'confirmPassword', label: gettext('Confirm Password'),
+                type: 'password', disabled: false, control: 'input',
+                required: true,
+              }];
+
+
+            Alertify.dialog('changeServerPassword' ,function factory() {
               return {
-                 main: function(params) {
+                main: function(params) {
                   var title = gettext('Change Password ');
                   this.set('title', title);
                   this.user_name = params.user.name;
-                 },
-                 setup:function() {
+                },
+                setup:function() {
                   return {
                     buttons: [{
                       text: gettext('Ok'), key: 13, className: 'btn btn-primary',
-                      attrs:{name:'submit'}
+                      attrs:{name:'submit'},
                     },{
                       text: gettext('Cancel'), key: 27, className: 'btn btn-danger',
-                      attrs:{name:'cancel'}
+                      attrs:{name:'cancel'},
                     }],
                     // Set options for dialog
                     options: {
@@ -426,8 +430,8 @@ define('pgadmin.node.server', [
                       resizable: true,
                       maximizable: true,
                       pinnable: false,
-                      closableByDimmer: false
-                    }
+                      closableByDimmer: false,
+                    },
                   };
                 },
                 hooks: {
@@ -436,21 +440,21 @@ define('pgadmin.node.server', [
                     if (this.view) {
                       this.view.remove({data: true, internal: true, silent: true});
                     }
-                  }
+                  },
                 },
                 prepare: function() {
                   var self = this;
                   // Disable Ok button until user provides input
                   this.__internal.buttons[0].element.disabled = true;
 
-                  var $container = $("<div class='change_password'></div>"),
+                  var $container = $('<div class=\'change_password\'></div>'),
                     newpasswordmodel = new newPasswordModel(
                       {'user_name': self.user_name}
                     ),
                     view = this.view = new Backform.Form({
                       el: $container,
                       model: newpasswordmodel,
-                      fields: passwordChangeFields
+                      fields: passwordChangeFields,
                     });
 
                   view.render();
@@ -460,13 +464,13 @@ define('pgadmin.node.server', [
                   // Listen to model & if filename is provided then enable Backup button
                   this.view.model.on('change', function() {
                     var that = this,
-                        password = this.get('password'),
-                        newPassword = this.get('newPassword'),
-                        confirmPassword = this.get('confirmPassword');
+                      password = this.get('password'),
+                      newPassword = this.get('newPassword'),
+                      confirmPassword = this.get('confirmPassword');
 
                     // Only check password field if pgpass file is not available
                     if ((!is_pgpass_file_used &&
-                         (_.isUndefined(password) || _.isNull(password) || password == '')) ||
+                      (_.isUndefined(password) || _.isNull(password) || password == '')) ||
                         _.isUndefined(newPassword) || _.isNull(newPassword) || newPassword == '' ||
                         _.isUndefined(confirmPassword) || _.isNull(confirmPassword) || confirmPassword == '') {
                       self.__internal.buttons[0].element.disabled = true;
@@ -476,7 +480,7 @@ define('pgadmin.node.server', [
                       this.errorTimeout && clearTimeout(this.errorTimeout);
                       this.errorTimeout = setTimeout(function() {
                         that.errorModel.set('confirmPassword', gettext('Passwords do not match.'));
-                        } ,400);
+                      } ,400);
                     }else {
                       that.errorModel.clear();
                       self.__internal.buttons[0].element.disabled = false;
@@ -485,9 +489,9 @@ define('pgadmin.node.server', [
                 },
                 // Callback functions when click on the buttons of the Alertify dialogs
                 callback: function(e) {
-                  if (e.button.element.name == "submit") {
+                  if (e.button.element.name == 'submit') {
                     var self = this,
-                        args =  this.view.model.toJSON();
+                      args =  this.view.model.toJSON();
 
                     e.cancel = true;
 
@@ -499,31 +503,33 @@ define('pgadmin.node.server', [
                         if (res.success) {
                           // Notify user to update pgpass file
                           if(is_pgpass_file_used) {
-                            alertify.alert(
-                              gettext("Change Password"),
-                              gettext("Please make sure to disconnect the server"
-                              + " and update the new password in the pgpass file"
-                              + " before performing any other operation")
+                            Alertify.alert(
+                              gettext('Change Password'),
+                              gettext('Please make sure to disconnect the server'
+                                + ' and update the new password in the pgpass file'
+                                  + ' before performing any other operation')
                             );
                           }
 
-                          alertify.success(res.info);
+                          Alertify.success(res.info);
                           self.close();
                         } else {
-                          alertify.error(res.errormsg);
+                          Alertify.error(res.errormsg);
                         }
                       },
-                      error: function(xhr, status, error) {
+                      error: function(xhr) {
                         try {
                           var err = $.parseJSON(xhr.responseText);
                           if (err.success == 0) {
-                            alertify.error(err.errormsg);
+                            Alertify.error(err.errormsg);
                           }
-                        } catch (e) {}
-                      }
+                        } catch (e) {
+                          console.warn(e.stack || e);
+                        }
+                      },
                     });
                   }
-               }
+                },
               };
             });
           }
@@ -536,16 +542,18 @@ define('pgadmin.node.server', [
               if (res.success && res.data.is_pgpass) {
                 is_pgpass_file_used = true;
               }
-              alertify.changeServerPassword(d).resizeTo('40%','52%');
+              Alertify.changeServerPassword(d).resizeTo('40%','52%');
             },
-            error: function(xhr, status, error) {
+            error: function(xhr) {
               try {
                 var err = $.parseJSON(xhr.responseText);
                 if (err.success == 0) {
-                  alertify.error(err.errormsg);
+                  Alertify.error(err.errormsg);
                 }
-              } catch (e) {}
-            }
+              } catch (e) {
+                console.warn(e.stack || e);
+              }
+            },
           });
 
           return false;
@@ -554,22 +562,21 @@ define('pgadmin.node.server', [
         /* Pause WAL Replay */
         pause_wal_replay: function(args) {
           var input = args || {},
-              obj = this,
-              t = pgBrowser.tree,
-              i = input.item || t.selected(),
-              d = i && i.length == 1 ? t.itemData(i) : undefined;
+            obj = this,
+            t = pgBrowser.tree,
+            i = input.item || t.selected(),
+            d = i && i.length == 1 ? t.itemData(i) : undefined;
 
           if (!d)
             return false;
 
-          var data = d;
           $.ajax({
             url: obj.generate_url(i, 'wal_replay' , d, true),
             type:'DELETE',
-            dataType: "json",
+            dataType: 'json',
             success: function(res) {
               if (res.success == 1) {
-                alertify.success(res.info);
+                Alertify.success(res.info);
                 t.itemData(i).wal_pause=res.data.wal_pause;
                 t.unload(i);
                 t.setInode(i);
@@ -580,38 +587,38 @@ define('pgadmin.node.server', [
                 }, 10);
               }
             },
-            error: function(xhr, status, error) {
+            error: function(xhr) {
               try {
                 var err = $.parseJSON(xhr.responseText);
                 if (err.success == 0) {
-                  msg = S(err.errormsg).value();
-                  alertify.error(err.errormsg);
+                  Alertify.error(err.errormsg);
                 }
-              } catch (e) {}
+              } catch (e) {
+                console.warn(e.stack || e);
+              }
               t.unload(i);
-            }
-          })
+            },
+          });
         },
 
         /* Resume WAL Replay */
         resume_wal_replay: function(args) {
           var input = args || {},
-              obj = this,
-              t = pgBrowser.tree,
-              i = input.item || t.selected(),
-              d = i && i.length == 1 ? t.itemData(i) : undefined;
+            obj = this,
+            t = pgBrowser.tree,
+            i = input.item || t.selected(),
+            d = i && i.length == 1 ? t.itemData(i) : undefined;
 
           if (!d)
             return false;
 
-          var data = d;
           $.ajax({
             url: obj.generate_url(i, 'wal_replay' , d, true),
             type:'PUT',
-            dataType: "json",
+            dataType: 'json',
             success: function(res) {
               if (res.success == 1) {
-                alertify.success(res.info);
+                Alertify.success(res.info);
                 t.itemData(i).wal_pause=res.data.wal_pause;
                 t.unload(i);
                 t.setInode(i);
@@ -622,18 +629,19 @@ define('pgadmin.node.server', [
                 }, 10);
               }
             },
-            error: function(xhr, status, error) {
+            error: function(xhr) {
               try {
                 var err = $.parseJSON(xhr.responseText);
                 if (err.success == 0) {
-                  msg = S(err.errormsg).value();
-                  alertify.error(err.errormsg);
+                  Alertify.error(err.errormsg);
                 }
-              } catch (e) {}
+              } catch (e) {
+                console.warn(e.stack || e);
+              }
               t.unload(i);
-            }
-          })
-        }
+            },
+          });
+        },
       },
       model: pgAdmin.Browser.Node.Model.extend({
         defaults: {
@@ -656,7 +664,7 @@ define('pgadmin.node.server', [
           sslcert: undefined,
           sslkey: undefined,
           sslrootcert: undefined,
-          sslcrl: undefined
+          sslcrl: undefined,
         },
         // Default values!
         initialize: function(attrs, args) {
@@ -668,70 +676,70 @@ define('pgadmin.node.server', [
           pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments);
         },
         schema: [{
-          id: 'id', label: gettext('ID'), type: 'int', mode: ['properties']
+          id: 'id', label: gettext('ID'), type: 'int', mode: ['properties'],
         },{
           id: 'name', label: gettext('Name'), type: 'text',
-          mode: ['properties', 'edit', 'create']
+          mode: ['properties', 'edit', 'create'],
         },{
           id: 'gid', label: gettext('Server group'), type: 'int',
           control: 'node-list-by-id', node: 'server_group',
-          mode: ['create', 'edit'], select2: {allowClear: false}
+          mode: ['create', 'edit'], select2: {allowClear: false},
         },{
           id: 'server_type', label: gettext('Server type'), type: 'options',
           mode: ['properties'], visible: 'isConnected',
-          'options': supported_servers
+          'options': supported_servers,
         },{
           id: 'connected', label: gettext('Connected?'), type: 'switch',
           mode: ['properties'], group: gettext('Connection'), 'options': {
             'onText':  gettext('True'), 'offText':  gettext('False'), 'onColor':  'success',
-            'offColor': 'danger', 'size': 'small'
-          }
+            'offColor': 'danger', 'size': 'small',
+          },
         },{
           id: 'version', label: gettext('Version'), type: 'text', group: null,
-          mode: ['properties'], visible: 'isConnected'
+          mode: ['properties'], visible: 'isConnected',
         },{
           id: 'bgcolor', label: gettext('Background'), type: 'color',
           group: null, mode: ['edit', 'create'], disabled: 'isfgColorSet',
-          deps: ['fgcolor']
+          deps: ['fgcolor'],
         },{
           id: 'fgcolor', label: gettext('Foreground'), type: 'color',
           group: null, mode: ['edit', 'create'], disabled: 'isConnected',
         },{
           id: 'connect_now', controlLabel: gettext('Connect now?'), type: 'checkbox',
-          group: null, mode: ['create']
+          group: null, mode: ['create'],
         },{
           id: 'comment', label: gettext('Comments'), type: 'multiline', group: null,
-          mode: ['properties', 'edit', 'create']
+          mode: ['properties', 'edit', 'create'],
         },{
           id: 'host', label: gettext('Host name/address'), type: 'text', group: gettext('Connection'),
-          mode: ['properties', 'edit', 'create'], disabled: 'isConnected'
+          mode: ['properties', 'edit', 'create'], disabled: 'isConnected',
         },{
           id: 'port', label: gettext('Port'), type: 'int', group: gettext('Connection'),
-          mode: ['properties', 'edit', 'create'], disabled: 'isConnected', min: 1024, max: 65535
+          mode: ['properties', 'edit', 'create'], disabled: 'isConnected', min: 1024, max: 65535,
         },{
           id: 'db', label: gettext('Maintenance database'), type: 'text', group: gettext('Connection'),
-          mode: ['properties', 'edit', 'create'], disabled: 'isConnected'
+          mode: ['properties', 'edit', 'create'], disabled: 'isConnected',
         },{
           id: 'username', label: gettext('Username'), type: 'text', group: gettext('Connection'),
-          mode: ['properties', 'edit', 'create'], disabled: 'isConnected'
+          mode: ['properties', 'edit', 'create'], disabled: 'isConnected',
         },{
           id: 'password', label: gettext('Password'), type: 'password',
           group: gettext('Connection'), control: 'input', mode: ['create'], deps: ['connect_now'],
           visible: function(m) {
             return m.get('connect_now') && m.isNew();
-          }
+          },
         },{
-          id: 'save_password', controlLabel: gettext('Save password?'), type: 'checkbox',
-          group: gettext('Connection'), mode: ['create'], deps: ['connect_now'],
-          visible: function(m) {
+          id: 'save_password', controlLabel: gettext('Save password?'),
+          type: 'checkbox', group: gettext('Connection'), mode: ['create'],
+          deps: ['connect_now'], visible: function(m) {
             return m.get('connect_now') && m.isNew();
           },
-          disabled: function(m) {
+          disabled: function() {
             return !current_user.allow_save_password;
-          }
+          },
         },{
           id: 'role', label: gettext('Role'), type: 'text', group: gettext('Connection'),
-          mode: ['properties', 'edit', 'create'], disabled: 'isConnected'
+          mode: ['properties', 'edit', 'create'], disabled: 'isConnected',
         },{
           id: 'sslmode', label: gettext('SSL mode'), type: 'options', group: gettext('SSL'),
           mode: ['properties', 'edit', 'create'], disabled: 'isConnected',
@@ -741,38 +749,38 @@ define('pgadmin.node.server', [
             {label: gettext('Require'), value: 'require'},
             {label: gettext('Disable'), value: 'disable'},
             {label: gettext('Verify-CA'), value: 'verify-ca'},
-            {label: gettext('Verify-Full'), value: 'verify-full'}
-          ]
+            {label: gettext('Verify-Full'), value: 'verify-full'},
+          ],
         },{
           id: 'sslcert', label: gettext('Client certificate'), type: 'text',
           group: gettext('SSL'), mode: ['edit', 'create'],
           disabled: 'isSSL', control: Backform.FileControl,
           dialog_type: 'select_file', supp_types: ['*'],
-          deps: ['sslmode']
+          deps: ['sslmode'],
         },{
           id: 'sslkey', label: gettext('Client certificate key'), type: 'text',
           group: gettext('SSL'), mode: ['edit', 'create'],
           disabled: 'isSSL', control: Backform.FileControl,
           dialog_type: 'select_file', supp_types: ['*'],
-          deps: ['sslmode']
+          deps: ['sslmode'],
         },{
           id: 'sslrootcert', label: gettext('Root certificate'), type: 'text',
           group: gettext('SSL'), mode: ['edit', 'create'],
           disabled: 'isSSL', control: Backform.FileControl,
           dialog_type: 'select_file', supp_types: ['*'],
-          deps: ['sslmode']
+          deps: ['sslmode'],
         },{
           id: 'sslcrl', label: gettext('Certificate revocation list'), type: 'text',
           group: gettext('SSL'), mode: ['edit', 'create'],
           disabled: 'isSSL', control: Backform.FileControl,
           dialog_type: 'select_file', supp_types: ['*'],
-          deps: ['sslmode']
+          deps: ['sslmode'],
         },{
           id: 'sslcompression', label: gettext('SSL compression?'), type: 'switch',
           mode: ['edit', 'create'], group: gettext('SSL'),
           'options': { 'onText':   gettext('True'), 'offText':  gettext('False'),
-          'onColor':  'success', 'offColor': 'danger', 'size': 'small'},
-          deps: ['sslmode'], disabled: 'isSSL'
+            'onColor':  'success', 'offColor': 'danger', 'size': 'small'},
+          deps: ['sslmode'], disabled: 'isSSL',
         },{
           id: 'sslcert', label: gettext('Client certificate'), type: 'text',
           group: gettext('SSL'), mode: ['properties'],
@@ -780,7 +788,7 @@ define('pgadmin.node.server', [
           visible: function(m) {
             var sslcert = m.get('sslcert');
             return !_.isUndefined(sslcert) && !_.isNull(sslcert);
-          }
+          },
         },{
           id: 'sslkey', label: gettext('Client certificate key'), type: 'text',
           group: gettext('SSL'), mode: ['properties'],
@@ -788,7 +796,7 @@ define('pgadmin.node.server', [
           visible: function(m) {
             var sslkey = m.get('sslkey');
             return !_.isUndefined(sslkey) && !_.isNull(sslkey);
-          }
+          },
         },{
           id: 'sslrootcert', label: gettext('Root certificate'), type: 'text',
           group: gettext('SSL'), mode: ['properties'],
@@ -796,7 +804,7 @@ define('pgadmin.node.server', [
           visible: function(m) {
             var sslrootcert = m.get('sslrootcert');
             return !_.isUndefined(sslrootcert) && !_.isNull(sslrootcert);
-          }
+          },
         },{
           id: 'sslcrl', label: gettext('Certificate revocation list'), type: 'text',
           group: gettext('SSL'), mode: ['properties'],
@@ -804,40 +812,40 @@ define('pgadmin.node.server', [
           visible: function(m) {
             var sslcrl = m.get('sslcrl');
             return !_.isUndefined(sslcrl) && !_.isNull(sslcrl);
-          }
+          },
         },{
           id: 'sslcompression', label: gettext('SSL compression?'), type: 'switch',
           mode: ['properties'], group: gettext('SSL'),
           'options': { 'onText':  gettext('True'), 'offText':  gettext('False'),
-          'onColor':  'success', 'offColor': 'danger', 'size': 'small'},
+            'onColor':  'success', 'offColor': 'danger', 'size': 'small'},
           deps: ['sslmode'], visible: function(m) {
             var sslmode = m.get('sslmode');
             return _.indexOf(SSL_MODES, sslmode) != -1;
-          }
+          },
         },{
           id: 'hostaddr', label: gettext('Host address'), type: 'text', group: gettext('Advanced'),
-          mode: ['properties', 'edit', 'create'], disabled: 'isConnected'
+          mode: ['properties', 'edit', 'create'], disabled: 'isConnected',
         },{
           id: 'db_res', label: gettext('DB restriction'), type: 'select2', group: gettext('Advanced'),
           mode: ['properties', 'edit', 'create'], disabled: 'isConnected', select2: {multiple: true, allowClear: false,
-          tags: true, tokenSeparators: [','], first_empty: false, selectOnClose: true, emptyOptions: true}
+            tags: true, tokenSeparators: [','], first_empty: false, selectOnClose: true, emptyOptions: true},
         },{
           id: 'passfile', label: gettext('Password file'), type: 'text',
           group: gettext('Advanced'), mode: ['edit', 'create'],
           disabled: 'isConnectedWithValidLib', control: Backform.FileControl,
-          dialog_type: 'select_file', supp_types: ['*']
+          dialog_type: 'select_file', supp_types: ['*'],
         },{
           id: 'passfile', label: gettext('Password file'), type: 'text',
           group: gettext('Advanced'), mode: ['properties'],
           visible: function(m) {
             var passfile = m.get('passfile');
             return !_.isUndefined(passfile) && !_.isNull(passfile);
-          }
+          },
         }],
         validate: function() {
           var err = {},
-              errmsg,
-              self = this;
+            errmsg,
+            self = this;
 
           var check_for_empty = function(id, msg) {
             var v = self.get(id);
@@ -851,28 +859,28 @@ define('pgadmin.node.server', [
               self.errorModel.unset(id);
               return false;
             }
-          }
+          };
           var check_for_valid_ipv6 = function(val){
             // Regular expression for validating IPv6 address formats
             var exps = ['^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|',
-                '(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|',
-                '2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|',
-                '(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|',
-                ':((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|',
-                '(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|',
-                '2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|',
-                '(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|',
-                '[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|',
-                '((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|',
-                '(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|',
-                '1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|',
-                '((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$'];
+              '(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|',
+              '2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|',
+              '(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|',
+              ':((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|',
+              '(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|',
+              '2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|',
+              '(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|',
+              '[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|',
+              '((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|',
+              '(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|',
+              '1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|',
+              '((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$'];
 
             var exp = new RegExp(exps.join(''));
             return exp.test(val.trim());
-          }
+          };
           var check_for_valid_ip = function(id, msg) {
-            var v4exps = "(^\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\s*$)";
+            var v4exps = '(^\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\s*$)';
             var v4exp = new RegExp(v4exps);
             var v = self.get(id);
             if (
@@ -885,7 +893,7 @@ define('pgadmin.node.server', [
             } else {
               self.errorModel.unset(id);
             }
-          }
+          };
 
           if (!self.isNew() && 'id' in self.sessAttrs) {
             err['id'] = gettext('The ID cannot be changed.');
@@ -928,7 +936,7 @@ define('pgadmin.node.server', [
         },
         isfgColorSet: function(model) {
           var bgcolor = model.get('bgcolor'),
-              fgcolor = model.get('fgcolor');
+            fgcolor = model.get('fgcolor');
 
           if(model.get('connected')) {
             return true;
@@ -958,15 +966,13 @@ define('pgadmin.node.server', [
           // older version of libpq do not support 'passfile' parameter in
           // connect method, valid libpq must have version >= 100000
           return pgBrowser.utils.pg_libpq_version < 100000;
-        }
+        },
       }),
       connection_lost: function(i, resp) {
         if (pgBrowser.tree) {
           var t = pgBrowser.tree,
-              info = i && this.getTreeNodeHierarchy(i),
-              s = null,
-              d = i && t.itemData(i),
-              self = this;
+            d = i && t.itemData(i),
+            self = this;
 
           while (d && d._type != 'server') {
             i = t.parent(i);
@@ -994,7 +1000,7 @@ define('pgadmin.node.server', [
                   // Make sure - the server is disconnected properly
                   pgBrowser.Events.trigger(
                     'pgadmin:server:disconnect',
-                    {item: _i, data: _d}, false
+                    {item: i, data: d}, false
                   );
                 }
               };
@@ -1003,7 +1009,7 @@ define('pgadmin.node.server', [
               pgBrowser.Events.on(
                 'pgadmin:server:connect:cancelled', disconnect
               );
-              alertify.confirm(
+              Alertify.confirm(
                 gettext('Connection lost'),
                 gettext('Would you like to reconnect to the database?'),
                 function() {
@@ -1022,79 +1028,79 @@ define('pgadmin.node.server', [
             }
           }
         }
-      }
+      },
     });
-    function connect_to_server(obj, data, tree, item, reconnect) {
+    var connect_to_server = function(obj, data, tree, item, reconnect) {
       var wasConnected = reconnect || data.connected,
-          onFailure = function(
-            xhr, status, error, _node, _data, _tree, _item, _wasConnected
-          ) {
-            data.connected = false;
+        onFailure = function(
+          xhr, status, error, _node, _data, _tree, _item, _wasConnected
+        ) {
+          data.connected = false;
+
+          // It should be attempt to reconnect.
+          // Let's not change the status of the tree node now.
+          if (!_wasConnected) {
+            tree.setInode(_item);
+            tree.addIcon(_item, {icon: 'icon-server-not-connected'});
+          }
 
-            // It should be attempt to reconnect.
-            // Let's not change the status of the tree node now.
-            if (!_wasConnected) {
-              tree.setInode(_item);
-              tree.addIcon(_item, {icon: 'icon-server-not-connected'});
+          Alertify.pgNotifier('error', xhr, error, function(msg) {
+            setTimeout(function() {
+              Alertify.dlgServerPass(
+                gettext('Connect to Server'),
+                msg, _node, _data, _tree, _item, _wasConnected
+              ).resizeTo();
+            }, 100);
+          });
+        },
+        onSuccess = function(res, node, data, tree, item, _wasConnected) {
+          if (res && res.data) {
+            if (typeof res.data.icon == 'string') {
+              tree.removeIcon(item);
+              data.icon = res.data.icon;
+              tree.addIcon(item, {icon: data.icon});
             }
 
-            alertify.pgNotifier('error', xhr, error, function(msg) {
-              setTimeout(function() {
-                alertify.dlgServerPass(
-                  gettext('Connect to Server'),
-                  msg, _node, _data, _tree, _item, _wasConnected
-                ).resizeTo();
-              }, 100);
-            });
-          },
-          onSuccess = function(res, node, data, tree, item, _wasConnected) {
-            if (res && res.data) {
-              if (typeof res.data.icon == 'string') {
-                tree.removeIcon(item);
-                data.icon = res.data.icon;
-                tree.addIcon(item, {icon: data.icon});
-              }
-
-              _.extend(data, res.data);
-              data.is_connecting = false;
+            _.extend(data, res.data);
+            data.is_connecting = false;
 
-              var serverInfo = pgBrowser.serverInfo =
-                pgBrowser.serverInfo || {};
-              serverInfo[data._id] = _.extend({}, data);
+            var serverInfo = pgBrowser.serverInfo =
+              pgBrowser.serverInfo || {};
+            serverInfo[data._id] = _.extend({}, data);
 
-              alertify.success(res.info);
-              obj.trigger('connected', obj, item, data);
+            Alertify.success(res.info);
+            obj.trigger('connected', obj, item, data);
 
-              // Generate the event that server is connected
-              pgBrowser.Events.trigger(
-                'pgadmin:server:connected', data._id, item, data
-              );
-              // Generate the event that database is connected
-              pgBrowser.Events.trigger(
-                'pgadmin:database:connected', data._id, data.db, item, data
-              );
+            // Generate the event that server is connected
+            pgBrowser.Events.trigger(
+              'pgadmin:server:connected', data._id, item, data
+            );
+            // Generate the event that database is connected
+            pgBrowser.Events.trigger(
+              'pgadmin:database:connected', data._id, data.db, item, data
+            );
 
-              // We're not reconnecting
-              if (!_wasConnected) {
-                tree.setInode(item);
-                tree.deselect(item);
+            // We're not reconnecting
+            if (!_wasConnected) {
+              tree.setInode(item);
+              tree.deselect(item);
 
-                setTimeout(function() {
-                  tree.select(item);
-                  tree.open(item);
-                }, 10);
-              } else {
-                // We just need to refresh the tree now.
-                setTimeout(function() {
-                  node.callbacks.refresh.apply(node, [true]);
-                }, 10);
-              }
+              setTimeout(function() {
+                tree.select(item);
+                tree.open(item);
+              }, 10);
+            } else {
+              // We just need to refresh the tree now.
+              setTimeout(function() {
+                node.callbacks.refresh.apply(node, [true]);
+              }, 10);
             }
-          };
+          }
+        };
 
       // Ask Password and send it back to the connect server
-      if (!alertify.dlgServerPass) {
-        alertify.dialog('dlgServerPass', function factory() {
+      if (!Alertify.dlgServerPass) {
+        Alertify.dialog('dlgServerPass', function factory() {
           return {
             main: function(
               title, message, node, data, tree, item,
@@ -1113,18 +1119,15 @@ define('pgadmin.node.server', [
             },
             setup:function() {
               return {
-                buttons:[
-                  {
-                    text: gettext("OK"), key: 13, className: "btn btn-primary"
-                  },
-                  {
-                    text: gettext("Cancel"), className: "btn btn-danger"
-                  }
-                ],
-                focus: { element: '#password', select: true },
+                buttons:[{
+                  text: gettext('OK'), key: 13, className: 'btn btn-primary',
+                },{
+                  text: gettext('Cancel'), className: 'btn btn-danger',
+                }],
+                focus: {element: '#password', select: true},
                 options: {
-                  modal: 0, resizable: false, maximizable: false, pinnable: false
-                }
+                  modal: 0, resizable: false, maximizable: false, pinnable: false,
+                },
               };
             },
             build:function() {},
@@ -1133,15 +1136,15 @@ define('pgadmin.node.server', [
             },
             callback: function(closeEvent) {
               var _tree = this.tree,
-                  _item = this.nodeItem,
-                  _node = this.node,
-                  _data = this.nodeData,
-                  _status = this.connected,
-                  _onSuccess = this.onSuccess,
-                  _onFailure = this.onFailure,
-                  _onCancel = this.onCancel;
+                _item = this.nodeItem,
+                _node = this.node,
+                _data = this.nodeData,
+                _status = this.connected,
+                _onSuccess = this.onSuccess,
+                _onFailure = this.onFailure,
+                _onCancel = this.onCancel;
 
-              if (closeEvent.button.text == gettext("OK")) {
+              if (closeEvent.button.text == gettext('OK')) {
 
                 var _url = _node.generate_url(_item, 'connect', _data, true);
 
@@ -1159,19 +1162,19 @@ define('pgadmin.node.server', [
                   success: function(res) {
                     return _onSuccess(
                       res, _node, _data, _tree, _item, _status
-                      );
+                    );
                   },
                   error: function(xhr, status, error) {
                     return _onFailure(
                       xhr, status, error, _node, _data, _tree, _item, _status
-                      );
-                  }
+                    );
+                  },
                 });
               } else {
-                this.onCancel && typeof(this.onCancel) == 'function' &&
-                  this.onCancel(_tree, _item, _data, _status);
+                _onCancel && typeof(_onCancel) == 'function' &&
+                  _onCancel(_tree, _item, _data, _status);
               }
-            }
+            },
           };
         });
       }
@@ -1195,30 +1198,21 @@ define('pgadmin.node.server', [
       };
 
       data.is_connecting = true;
-      var url = obj.generate_url(item, "connect", data, true);
+      var url = obj.generate_url(item, 'connect', data, true);
       $.post(url)
-      .done(function(res) {
-        if (res.success == 1) {
-          return onSuccess(
-            res, obj, data, tree, item, wasConnected
+        .done(function(res) {
+          if (res.success == 1) {
+            return onSuccess(
+              res, obj, data, tree, item, wasConnected
+            );
+          }
+        })
+        .fail(function(xhr, status, error) {
+          return onFailure(
+            xhr, status, error, obj, data, tree, item, wasConnected
           );
-        }
-      })
-      .fail(function(xhr, status, error) {
-        return onFailure(
-          xhr, status, error, obj, data, tree, item, wasConnected
-        );
-      });
-    }
-
-    /* Send PING to indicate that session is alive */
-    function server_status(server_id)
-    {
-      url = "/ping";
-      $.post(url)
-      .done(function(data) { return true})
-      .fail(function(xhr, status, error) { return false})
-    }
+        });
+    };
   }
 
   return pgBrowser.Nodes['server'];
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/variable.js b/web/pgadmin/browser/server_groups/servers/static/js/variable.js
index 669768b0..5dca9f58 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/variable.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/variable.js
@@ -1,495 +1,480 @@
 define([
   'sources/gettext', 'underscore', 'jquery', 'backbone', 'backform', 'backgrid', 'alertify',
-  'sources/pgadmin', 'pgadmin.browser.node', 'pgadmin.browser.node.ui'
-  ],
- function(gettext, _, $, Backbone, Backform, Backgrid, Alertify, pgAdmin, pgNode) {
-
-  /*
-   * cellFunction for variable control.
-   * This function returns cell class depending on vartype.
-   */
-  var cellFunction = function(model) {
-    var self = this,
-      name = model.get("name"),
-      availVariables = {};
-
-    self.collection.each(function(col) {
-      if (col.get("name") == "name") {
-        availVariables = col.get('availVariables');
-      }
-    });
+  'sources/pgadmin', 'pgadmin.browser.node', 'pgadmin.browser.node.ui',
+],
+  function(gettext, _, $, Backbone, Backform, Backgrid, Alertify, pgAdmin, pgNode) {
 
+    /*
+     * cellFunction for variable control.
+     * This function returns cell class depending on vartype.
+     */
+    var cellFunction = function(model) {
+      var self = this,
+        name = model.get('name'),
+        availVariables = {};
 
-    var variable = name ? availVariables[name]: undefined,
-      value = model.get("value");
+      self.collection.each(function(col) {
+        if (col.get('name') == 'name') {
+          availVariables = col.get('availVariables');
+        }
+      });
 
-    switch(variable && variable.vartype) {
-      case "bool":
-        /*
-         * bool cell and variable cannot be stateless (i.e undefined).
-         * It should be either true or false.
-         */
+      var variable = name ? availVariables[name]: undefined,
+        value = model.get('value');
 
-        model.set("value", !!model.get("value"), {silent: true});
+      switch(variable && variable.vartype) {
+      case 'bool':
+          /*
+           * bool cell and variable cannot be stateless (i.e undefined).
+           * It should be either true or false.
+           */
+
+        model.set('value', !!model.get('value'), {silent: true});
 
         return Backgrid.Extension.SwitchCell;
-      break;
-      case "enum":
+      case 'enum':
         model.set({'value': value}, {silent:true});
         var options = [],
-            enumVals = variable.enumvals;
+          enumVals = variable.enumvals;
 
         _.each(enumVals, function(enumVal) {
           options.push([enumVal, enumVal]);
         });
 
         return Backgrid.Extension.Select2Cell.extend({optionValues: options});
-      break;
-      case "integer":
+      case 'integer':
         if (!_.isNaN(parseInt(value))) {
           model.set({'value': parseInt(value)}, {silent:true});
         } else {
           model.set({'value': undefined}, {silent:true});
         }
         return Backgrid.IntegerCell;
-        break;
-      case "real":
+      case 'real':
         if (!_.isNaN(parseFloat(value))) {
           model.set({'value': parseFloat(value)}, {silent:true});
         } else {
           model.set({'value': undefined}, {silent:true});
         }
         return Backgrid.NumberCell.extend({decimals: 0});
-      break;
-      case "string":
+      case 'string':
         return Backgrid.StringCell;
-      break;
       default:
         model.set({'value': undefined}, {silent:true});
         return Backgrid.Cell;
-      break;
-    }
-    model.set({'value': undefined}, {silent:true});
-    return Backgrid.Cell;
-  }
-
-  /*
-   * This row will define behaviour or value column cell depending upon
-   * variable name.
-   */
-  var VariableRow = Backgrid.Row.extend({
-    modelDuplicateColor: "lightYellow",
-
-    modelUniqueColor: "#fff",
-
-    initialize: function () {
-      Backgrid.Row.prototype.initialize.apply(this, arguments);
-      var self = this;
-      self.model.on("change:name", function() {
-        setTimeout(function() {
-          self.columns.each(function(col) {
-            if (col.get('name') == 'value') {
-
-              var idx = self.columns.indexOf(col),
-                cf = col.get("cellFunction"),
-                cell = new (cf.apply(col, [self.model]))({
-                  column: col,
-                  model: self.model
-                }),
+      }
+    };
+
+      /*
+       * This row will define behaviour or value column cell depending upon
+       * variable name.
+       */
+    var VariableRow = Backgrid.Row.extend({
+      modelDuplicateColor: 'lightYellow',
+
+      modelUniqueColor: '#fff',
+
+      initialize: function () {
+        Backgrid.Row.prototype.initialize.apply(this, arguments);
+        var self = this;
+        self.model.on('change:name', function() {
+          setTimeout(function() {
+            self.columns.each(function(col) {
+              if (col.get('name') == 'value') {
+
+                var idx = self.columns.indexOf(col),
+                  cf = col.get('cellFunction'),
+                  cell = new (cf.apply(col, [self.model]))({
+                    column: col,
+                    model: self.model,
+                  }),
                   oldCell = self.cells[idx];
                 oldCell.remove();
                 self.cells[idx] = cell;
                 self.render();
-            }
+              }
 
-          });
-        }, 10);
-      });
-      self.listenTo(self.model, 'pgadmin-session:model:duplicate', self.modelDuplicate);
-      self.listenTo(self.model, 'pgadmin-session:model:unique', self.modelUnique);
-    },
-    modelDuplicate: function() {
-      $(this.el).removeClass("new");
-      this.el.style.backgroundColor = this.modelDuplicateColor;
-    },
-    modelUnique: function() {
-      this.el.style.backgroundColor = this.modelUniqueColor;
-    }
-
-  })
-  /**
-   *  VariableModel used to represent configuration parameters (variables tab)
-   *  for database objects.
-   **/
-  var VariableModel = pgNode.VariableModel = pgNode.Model.extend({
-    keys: ['name'],
-    defaults: {
-      name: undefined,
-      value: undefined,
-      role: null,
-      database: null,
-    },
-    schema: [
-      {
-        id: 'name', label: gettext('Name'), type:'text', cellHeaderClasses: 'width_percent_30',
-        editable: function(m) {
-          return (m instanceof Backbone.Collection) ? true : m.isNew();
-        },
-        cell: Backgrid.Extension.NodeAjaxOptionsCell.extend({
-          initialize: function() {
-            Backgrid.Extension.NodeAjaxOptionsCell.prototype.initialize.apply(this, arguments);
+            });
+          }, 10);
+        });
+        self.listenTo(self.model, 'pgadmin-session:model:duplicate', self.modelDuplicate);
+        self.listenTo(self.model, 'pgadmin-session:model:unique', self.modelUnique);
+      },
+      modelDuplicate: function() {
+        $(this.el).removeClass('new');
+        this.el.style.backgroundColor = this.modelDuplicateColor;
+      },
+      modelUnique: function() {
+        this.el.style.backgroundColor = this.modelUniqueColor;
+      },
 
-            // Immediately process options as we need them before render.
+    });
+      /**
+       *  VariableModel used to represent configuration parameters (variables tab)
+       *  for database objects.
+       **/
+    var VariableModel = pgNode.VariableModel = pgNode.Model.extend({
+      keys: ['name'],
+      defaults: {
+        name: undefined,
+        value: undefined,
+        role: null,
+        database: null,
+      },
+      schema: [
+        {
+          id: 'name', label: gettext('Name'), type:'text', cellHeaderClasses: 'width_percent_30',
+          editable: function(m) {
+            return (m instanceof Backbone.Collection) ? true : m.isNew();
+          },
+          cell: Backgrid.Extension.NodeAjaxOptionsCell.extend({
+            initialize: function() {
+              Backgrid.Extension.NodeAjaxOptionsCell.prototype.initialize.apply(this, arguments);
+
+              // Immediately process options as we need them before render.
 
-            var opVals = _.clone(this.optionValues ||
+              var opVals = _.clone(this.optionValues ||
                 (_.isFunction(this.column.get('options')) ?
-                    (this.column.get('options'))(this) :
+                  (this.column.get('options'))(this) :
                     this.column.get('options')));
 
-            this.column.set('options', opVals);
-          }
-        }),
-        url: 'vopts',
-        select2: { allowClear: false },
-        transform: function(vars, cell) {
-          var self = this,
-              res = [],
+              this.column.set('options', opVals);
+            },
+          }),
+          url: 'vopts',
+          select2: { allowClear: false },
+          transform: function(vars, cell) {
+            var res = [],
               availVariables = {};
 
-          _.each(vars, function(v) {
-            res.push({
-              'value': v.name,
-              'image': undefined,
-              'label': v.name
+            _.each(vars, function(v) {
+              res.push({
+                'value': v.name,
+                'image': undefined,
+                'label': v.name,
+              });
+              availVariables[v.name] = v;
             });
-            availVariables[v.name] = v;
-          });
 
-          cell.column.set("availVariables", availVariables);
-          return res;
+            cell.column.set('availVariables', availVariables);
+            return res;
+          },
+        },
+        {
+          id: 'value', label: gettext('Value'), type: 'text', editable: true,
+          cellFunction: cellFunction, cellHeaderClasses: 'width_percent_40',
+        },
+        {id: 'database', label: gettext('Database'), type: 'text', editable: true,
+          node: 'database', cell: Backgrid.Extension.NodeListByNameCell,
+        },
+        {id: 'role', label: gettext('Role'), type: 'text', editable: true,
+          node: 'role', cell: Backgrid.Extension.NodeListByNameCell},
+      ],
+      toJSON: function() {
+        var d = Backbone.Model.prototype.toJSON.apply(this);
+
+        // Remove not defined values from model values.
+        // i.e.
+        // role, database
+        if (_.isUndefined(d.database) || _.isNull(d.database)) {
+          delete d.database;
         }
-      },
-      {
-        id: 'value', label: gettext('Value'), type: 'text', editable: true,
-        cellFunction: cellFunction, cellHeaderClasses: 'width_percent_40'
-      },
-      {id: 'database', label: gettext('Database'), type: 'text', editable: true,
-      node: 'database', cell: Backgrid.Extension.NodeListByNameCell
-      },
-      {id: 'role', label: gettext('Role'), type: 'text', editable: true,
-      node: 'role', cell: Backgrid.Extension.NodeListByNameCell}
-    ],
-    toJSON: function() {
-      var d = Backbone.Model.prototype.toJSON.apply(this);
-
-      // Remove not defined values from model values.
-      // i.e.
-      // role, database
-      if (_.isUndefined(d.database) || _.isNull(d.database)) {
-        delete d.database;
-      }
 
-      if (_.isUndefined(d.role) || _.isNull(d.role)) {
-        delete d.role;
-      }
+        if (_.isUndefined(d.role) || _.isNull(d.role)) {
+          delete d.role;
+        }
 
-      return d;
-    },
-    validate: function() {
-      if (_.isUndefined(this.get('name')) ||
+        return d;
+      },
+      validate: function() {
+        var msg = null;
+        if (_.isUndefined(this.get('name')) ||
           _.isNull(this.get('name')) ||
-          String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
-        var msg = 'Please select a parameter name.';
-
-        this.errorModel.set('name', msg);
-
-        return msg;
-      } else if (_.isUndefined(this.get('value')) ||
-          _.isNull(this.get('value')) ||
-          String(this.get('value')).replace(/^\s+|\s+$/g, '') == '') {
-        var msg = 'Please enter a value for the parameter.';
-
-        this.errorModel.set('value', msg);
+            String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
+          msg = gettext('Please select a parameter name.');
+          this.errorModel.set('name', msg);
+        } else if (_.isUndefined(this.get('value')) ||
+              _.isNull(this.get('value')) ||
+                String(this.get('value')).replace(/^\s+|\s+$/g, '') == '') {
+          msg = ('Please enter a value for the parameter.');
+          this.errorModel.set('value', msg);
+          this.errorModel.unset('name');
+        } else {
+          this.errorModel.unset('name');
+          this.errorModel.unset('value');
+        }
 
         return msg;
-      } else {
-        this.errorModel.unset('name');
-        this.errorModel.unset('value');
-      }
-
-      return null;
-    }
-  });
-
-  /**
-   * Variable Tab Control to set/update configuration values for database object.
-   *
-   **/
-  var VariableCollectionControl =  Backform.VariableCollectionControl =
-    Backform.UniqueColCollectionControl.extend({
+      },
+    });
 
-    hasDatabase: false,
-    hasRole: false,
+      /**
+       * Variable Tab Control to set/update configuration values for database object.
+       *
+       **/
+    Backform.VariableCollectionControl =
+      Backform.UniqueColCollectionControl.extend({
 
-    initialize: function(opts) {
-      var self = this,
-          keys = ['name'];
+        hasDatabase: false,
+        hasRole: false,
 
-      /*
-       * Read from field schema whether user wants to use database and role
-       * fields in Variable control.
-       */
-      self.hasDatabase = opts.field.get('hasDatabase');
-      self.hasRole = opts.field.get('hasRole');
-
-      // Update unique coll field based on above flag status.
-      if (self.hasDatabase) {
-        keys.push('database');
-      } else if (self.hasRole) {
-        keys.push('role');
-      }
-      // Overriding the uniqueCol in the field
-      if (opts && opts.field) {
-        if (opts.field instanceof Backform.Field) {
-          opts.field.set({
-            model: pgNode.VariableModel.extend({keys:keys})
-          },
-          {
-            silent: true
-          });
-        } else {
-          opts.field.extend({
-            model: pgNode.VariableModel.extend({keys:keys})
-          });
-        }
-      }
+        initialize: function(opts) {
+          var self = this,
+            keys = ['name'];
+
+            /*
+             * Read from field schema whether user wants to use database and role
+             * fields in Variable control.
+             */
+          self.hasDatabase = opts.field.get('hasDatabase');
+          self.hasRole = opts.field.get('hasRole');
+
+          // Update unique coll field based on above flag status.
+          if (self.hasDatabase) {
+            keys.push('database');
+          } else if (self.hasRole) {
+            keys.push('role');
+          }
+          // Overriding the uniqueCol in the field
+          if (opts && opts.field) {
+            if (opts.field instanceof Backform.Field) {
+              opts.field.set({
+                model: pgNode.VariableModel.extend({keys:keys}),
+              },
+                {
+                  silent: true,
+                });
+            } else {
+              opts.field.extend({
+                model: pgNode.VariableModel.extend({keys:keys}),
+              });
+            }
+          }
 
-      Backform.UniqueColCollectionControl.prototype.initialize.apply(
-          self, arguments
+          Backform.UniqueColCollectionControl.prototype.initialize.apply(
+            self, arguments
           );
 
-      self.availVariables = {};
+          self.availVariables = {};
 
-      var node = self.field.get('node').type,
-          gridCols = ['name', 'value'];
+          var gridCols = ['name', 'value'];
 
-      if (self.hasDatabase) {
-        gridCols.push('database');
-      }
+          if (self.hasDatabase) {
+            gridCols.push('database');
+          }
 
-      if (self.hasRole) {
-        gridCols.push('role');
-      }
+          if (self.hasRole) {
+            gridCols.push('role');
+          }
 
-      self.gridSchema = Backform.generateGridColumnsFromModel(
-          self.field.get('node_info'), VariableModel.extend({keys:keys}), 'edit', gridCols, self.field.get('schema_node')
+          self.gridSchema = Backform.generateGridColumnsFromModel(
+            self.field.get('node_info'), VariableModel.extend({keys:keys}), 'edit', gridCols, self.field.get('schema_node')
           );
 
-      // Make sure - we do have the data for variables
-      self.getVariables();
-    },
-    /*
-     * Get the variable data for this node.
-     */
-    getVariables: function() {
-      var self = this,
-          url = this.field.get('url'),
-          m = self.model;
-
-      if (!this.field.get('version_compatible'))
-        return;
-
-      if (url && !m.isNew()) {
-        var node = self.field.get('node'),
-            node_data = self.field.get('node_data'),
-            node_info = self.field.get('node_info'),
-            full_url = node.generate_url.apply(
-              node, [
-                null, url, node_data, true, node_info
-              ]),
-            data,
-            isTracking = self.collection.trackChanges;
-
-        if (isTracking) {
-          self.collection.stopSession();
-        }
-        m.trigger('pgadmin-view:fetching', m, self.field);
-
-        $.ajax({
-          async: false,
-          url: full_url,
-          success: function (res) {
-            data = res.data;
-          },
-          error: function() {
-            m.trigger('pgadmin-view:fetch:error', m, self.field);
-          }
-        });
-        m.trigger('pgadmin-view:fetched', m, self.field);
-
-        if (data && _.isArray(data)) {
-          self.collection.reset(data, {silent: true});
-        }
+          // Make sure - we do have the data for variables
+          self.getVariables();
+        },
         /*
-         * Make sure - new data will be taken care by the session management
+         * Get the variable data for this node.
          */
-        if (isTracking) {
-          self.collection.startNewSession();
-        }
-      }
-    },
+        getVariables: function() {
+          var self = this,
+            url = this.field.get('url'),
+            m = self.model;
+
+          if (!this.field.get('version_compatible'))
+            return;
+
+          if (url && !m.isNew()) {
+            var node = self.field.get('node'),
+              node_data = self.field.get('node_data'),
+              node_info = self.field.get('node_info'),
+              full_url = node.generate_url.apply(
+                node, [
+                  null, url, node_data, true, node_info,
+                ]),
+              data,
+              isTracking = self.collection.trackChanges;
+
+            if (isTracking) {
+              self.collection.stopSession();
+            }
+            m.trigger('pgadmin-view:fetching', m, self.field);
+
+            $.ajax({
+              async: false,
+              url: full_url,
+              success: function (res) {
+                data = res.data;
+              },
+              error: function() {
+                m.trigger('pgadmin-view:fetch:error', m, self.field);
+              },
+            });
+            m.trigger('pgadmin-view:fetched', m, self.field);
+
+            if (data && _.isArray(data)) {
+              self.collection.reset(data, {silent: true});
+            }
+              /*
+               * Make sure - new data will be taken care by the session management
+               */
+            if (isTracking) {
+              self.collection.startNewSession();
+            }
+          }
+        },
 
-    showGridControl: function(data) {
+        showGridControl: function(data) {
 
-      var self = this,
-          titleTmpl = _.template([
-            "<div class='subnode-header'>",
-            "<label class='control-label'><%-label%></label>",
-            "<button class='btn-sm btn-default add fa fa-plus' <%=canAdd ? '' : 'disabled=\"disabled\"'%>></button>",
-            "</div>"].join("\n")),
-          $gridBody =
-            $("<div class='pgadmin-control-group backgrid form-group col-xs-12 object subnode'></div>").append(
+          var self = this,
+            titleTmpl = _.template([
+              '<div class=\'subnode-header\'>',
+              '<label class=\'control-label\'><%-label%></label>',
+              '<button class=\'btn-sm btn-default add fa fa-plus\' <%=canAdd ? \'\' : \'disabled="disabled"\'%>></button>',
+              '</div>'].join('\n')),
+            $gridBody =
+            $('<div class=\'pgadmin-control-group backgrid form-group col-xs-12 object subnode\'></div>').append(
               titleTmpl(data)
             );
 
-      // Clean up existing grid if any (in case of re-render)
-      if (self.grid) {
-        self.grid.remove();
-      }
-
-      var gridSchema = _.clone(this.gridSchema);
+          // Clean up existing grid if any (in case of re-render)
+          if (self.grid) {
+            self.grid.remove();
+          }
 
-      _.each(gridSchema.columns, function(col) {
-        if (col.name == 'value') {
-          col.availVariables = self.availVariables;
-        }
-      });
+          var gridSchema = _.clone(this.gridSchema);
 
-      // Insert Delete Cell into Grid
-      if (data.disabled == false && data.canDelete) {
-          gridSchema.columns.unshift({
-            name: "pg-backform-delete", label: "",
-            cell: Backgrid.Extension.DeleteCell,
-            editable: false, cell_priority: -1
+          _.each(gridSchema.columns, function(col) {
+            if (col.name == 'value') {
+              col.availVariables = self.availVariables;
+            }
           });
-      }
 
-      // Change format of each of the data
-      // Because - data coming from the server is in string format
-      self.collection.each(function(model) {
-        var name = model.get("name");
-
-        if (name in self.availVariables) {
-          switch(self.availVariables[name].vartype) {
-            case 'real':
-              var v = parseFloat(model.get('value'));
-              model.set('value', (isNaN(v) ? undefined : v), {silent: true});
-
-              break;
-            case 'integer':
-              var v = parseInt(model.get('value'));
-              model.set('value', (isNaN(v) ? undefined : v), {silent: true});
-
-              break;
-            default:
-              break;
+          // Insert Delete Cell into Grid
+          if (data.disabled == false && data.canDelete) {
+            gridSchema.columns.unshift({
+              name: 'pg-backform-delete', label: '',
+              cell: Backgrid.Extension.DeleteCell,
+              editable: false, cell_priority: -1,
+            });
           }
-        }
-      });
 
-      // Initialize a new Grid instance
-      var grid = self.grid = new Backgrid.Grid({
-        columns: gridSchema.columns,
-        collection: self.collection,
-        row: VariableRow,
-        className: "backgrid table-bordered"
-      });
-      self.$grid = grid.render().$el;
-
-      $gridBody.append(self.$grid);
-
-      // Add button callback
-      if (!(data.disabled || data.canAdd == false)) {
-        $gridBody.find('button.add').first().click(function(e) {
-          e.preventDefault();
-          var canAddRow = _.isFunction(data.canAddRow) ?
-                            data.canAddRow.apply(self, [self.model]) : true;
-          if (canAddRow) {
-
-              var allowMultipleEmptyRows = !!self.field.get('allowMultipleEmptyRows');
-
-              // If allowMultipleEmptyRows is not set or is false then don't allow second new empty row.
-              // There should be only one empty row.
-              if (!allowMultipleEmptyRows && self.collection) {
-                var isEmpty = false;
-                self.collection.each(function(model) {
-                  var modelValues = [];
-                  _.each(model.attributes, function(val, key) {
-                    modelValues.push(val);
-                  })
-                  if(!_.some(modelValues, _.identity)) {
-                    isEmpty = true;
+          // Change format of each of the data
+          // Because - data coming from the server is in string format
+          self.collection.each(function(model) {
+            var name = model.get('name'), val;
+
+            if (name in self.availVariables) {
+              switch(self.availVariables[name].vartype) {
+              case 'real':
+                val = parseFloat(model.get('value'));
+                model.set('value', (isNaN(val) ? undefined : val), {silent: true});
+
+                break;
+              case 'integer':
+                val = parseInt(model.get('value'));
+                model.set('value', (isNaN(val) ? undefined : val), {silent: true});
+
+                break;
+              default:
+                break;
+              }
+            }
+          });
+
+          // Initialize a new Grid instance
+          var grid = self.grid = new Backgrid.Grid({
+            columns: gridSchema.columns,
+            collection: self.collection,
+            row: VariableRow,
+            className: 'backgrid table-bordered',
+          });
+          self.$grid = grid.render().$el;
+
+          $gridBody.append(self.$grid);
+
+          // Add button callback
+          if (!(data.disabled || data.canAdd == false)) {
+            $gridBody.find('button.add').first().click(function(e) {
+              e.preventDefault();
+              var canAddRow = _.isFunction(data.canAddRow) ?
+                data.canAddRow.apply(self, [self.model]) : true;
+              if (canAddRow) {
+
+                var allowMultipleEmptyRows = !!self.field.get('allowMultipleEmptyRows');
+
+                // If allowMultipleEmptyRows is not set or is false then don't allow second new empty row.
+                // There should be only one empty row.
+                if (!allowMultipleEmptyRows && self.collection) {
+                  var isEmpty = false;
+                  self.collection.each(function(model) {
+                    var modelValues = [];
+                    _.each(model.attributes, function(val) {
+                      modelValues.push(val);
+                    });
+                    if(!_.some(modelValues, _.identity)) {
+                      isEmpty = true;
+                    }
+                  });
+                  if(isEmpty) {
+                    return false;
                   }
-                });
-                if(isEmpty) {
-                  return false;
                 }
-              }
 
-              $(grid.body.$el.find($("tr.new"))).removeClass("new")
-              var m = new (data.model) (null, {
-                silent: true,
-                handler: self.collection,
-                top: self.model.top || self.model,
-                collection: self.collection,
-                node_info: self.model.node_info
-              });
-              self.collection.add(m);
+                $(grid.body.$el.find($('tr.new'))).removeClass('new');
+                var m = new (data.model) (null, {
+                  silent: true,
+                  handler: self.collection,
+                  top: self.model.top || self.model,
+                  collection: self.collection,
+                  node_info: self.model.node_info,
+                });
+                self.collection.add(m);
 
-              var idx = self.collection.indexOf(m),
+                var idx = self.collection.indexOf(m),
                   newRow = grid.body.rows[idx].$el;
 
-              newRow.addClass("new");
-              $(newRow).pgMakeVisible('backform-tab');
+                newRow.addClass('new');
+                $(newRow).pgMakeVisible('backform-tab');
 
-              return false;
+                return false;
+              }
+            });
           }
-        });
-      }
 
-      // Render node grid
-      return $gridBody;
-    },
+          // Render node grid
+          return $gridBody;
+        },
 
-    addVariable: function(ev) {
-      ev.preventDefault();
+        addVariable: function(ev) {
+          ev.preventDefault();
 
-      var self = this,
-          m = new (self.field.get('model'))(
-                self.headerData.toJSON(), {
-                  silent: true, top: self.collection.top,
-                  handler: self.collection
-                }),
-          coll = self.model.get(self.field.get('name'));
+          var self = this,
+            m = new (self.field.get('model'))(
+              self.headerData.toJSON(), {
+                silent: true, top: self.collection.top,
+                handler: self.collection,
+              }),
+            coll = self.model.get(self.field.get('name'));
 
-      coll.add(m);
+          coll.add(m);
 
-      var idx = coll.indexOf(m);
+          var idx = coll.indexOf(m);
 
-      // idx may not be always > -1 because our UniqueColCollection may
-      // remove 'm' if duplicate value found.
-      if (idx > -1) {
-        self.$grid.find('.new').removeClass('new');
+          // idx may not be always > -1 because our UniqueColCollection may
+          // remove 'm' if duplicate value found.
+          if (idx > -1) {
+            self.$grid.find('.new').removeClass('new');
 
-        var newRow = self.grid.body.rows[idx].$el;
+            var newRow = self.grid.body.rows[idx].$el;
 
-        newRow.addClass("new");
-        $(newRow).pgMakeVisible('backform-tab');
-      }
+            newRow.addClass('new');
+            $(newRow).pgMakeVisible('backform-tab');
+          }
 
-      return false;
-    }
-  });
+          return false;
+        },
+      });
 
-  return VariableModel;
-});
+    return VariableModel;
+  });
diff --git a/web/pgadmin/browser/server_groups/servers/tablespaces/static/js/tablespace.js b/web/pgadmin/browser/server_groups/servers/tablespaces/static/js/tablespace.js
index 28bd11ec..1dd02e69 100644
--- a/web/pgadmin/browser/server_groups/servers/tablespaces/static/js/tablespace.js
+++ b/web/pgadmin/browser/server_groups/servers/tablespaces/static/js/tablespace.js
@@ -1,21 +1,23 @@
 define('pgadmin.node.tablespace', [
-  'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
-  'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
-  'pgadmin.browser.collection', 'pgadmin.browser.node.ui',
-  'pgadmin.browser.server.privilege'
-], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
+  'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
+  'pgadmin.backform', 'pgadmin.browser.collection', 'pgadmin.browser.node.ui',
+  'pgadmin.browser.server.privilege',
+], function(
+  gettext, url_for, $, _, Backbone, pgAdmin, pgBrowser, Alertify, Backform
+) {
 
   if (!pgBrowser.Nodes['coll-tablespace']) {
-    var databases = pgBrowser.Nodes['coll-tablespace'] =
+    pgBrowser.Nodes['coll-tablespace'] =
       pgBrowser.Collection.extend({
         node: 'tablespace',
         label: gettext('Tablespaces'),
         type: 'coll-tablespace',
         columns: ['name', 'spcuser', 'description'],
         hasStatistics: true,
-        statsPrettifyFields: ['Size']
+        statsPrettifyFields: ['Size'],
       });
-  };
+  }
 
   if (!pgBrowser.Nodes['tablespace']) {
     pgBrowser.Nodes['tablespace'] = pgBrowser.Node.extend({
@@ -33,7 +35,7 @@ define('pgadmin.node.tablespace', [
       Init: function() {
         /* Avoid mulitple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -42,42 +44,42 @@ define('pgadmin.node.tablespace', [
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Tablespace...'),
           icon: 'wcTabIcon icon-tablespace', data: {action: 'create'},
-          enable: 'can_create_tablespace'
+          enable: 'can_create_tablespace',
         },{
           name: 'create_tablespace_on_coll', node: 'coll-tablespace', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Tablespace...'),
           icon: 'wcTabIcon icon-tablespace', data: {action: 'create'},
-          enable: 'can_create_tablespace'
+          enable: 'can_create_tablespace',
         },{
           name: 'create_tablespace', node: 'tablespace', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 4, label: gettext('Tablespace...'),
           icon: 'wcTabIcon icon-tablespace', data: {action: 'create'},
-          enable: 'can_create_tablespace'
+          enable: 'can_create_tablespace',
         },{
           name: 'move_tablespace', node: 'tablespace', module: this,
           applies: ['object', 'context'], callback: 'move_objects',
           category: 'move_tablespace', priority: 5,
           label: gettext('Move objects to...'),
           icon: 'fa fa-exchange', data: {action: 'create'},
-          enable: 'can_move_objects'
-        }
+          enable: 'can_move_objects',
+        },
         ]);
       },
       can_create_tablespace: function(node, item) {
         var treeData = this.getTreeNodeHierarchy(item),
-            server = treeData['server'];
+          server = treeData['server'];
 
         return server.connected && server.user.is_superuser;
       },
       can_move_objects: function(node, item) {
         var treeData = this.getTreeNodeHierarchy(item),
-            server = treeData['server'];
+          server = treeData['server'];
         // Only supported PG9.4 and above version
         return server.connected &&
-                server.user.is_superuser &&
-                server.version >= 90400;
+          server.user.is_superuser &&
+          server.version >= 90400;
       },
       callbacks: {
         /* Move objects from one tablespace to another */
@@ -87,7 +89,6 @@ define('pgadmin.node.tablespace', [
             t = pgBrowser.tree,
             i = input.item || t.selected(),
             d = i && i.length == 1 ? t.itemData(i) : undefined,
-            node = d && pgBrowser.Nodes[d._type],
             url = obj.generate_url(i, 'move_objects', d, true),
             msql_url = obj.generate_url(i, 'move_objects_sql', d, true);
 
@@ -96,107 +97,107 @@ define('pgadmin.node.tablespace', [
 
           // Object model
           var objModel = Backbone.Model.extend({
-              idAttribute: 'id',
-              defaults: {
-                new_tblspc: undefined,
-                obj_type: 'all',
-                user: undefined
+            idAttribute: 'id',
+            defaults: {
+              new_tblspc: undefined,
+              obj_type: 'all',
+              user: undefined,
+            },
+            schema: [{
+              id: 'tblspc', label: gettext('New tablespace'),
+              type: 'text', disabled: false, control: 'node-list-by-name',
+              node: 'tablespace', select2: {allowClear: false},
+              filter: function(o) {
+                return o && (o.label != d.label);
               },
-              schema: [{
-                  id: 'tblspc', label: gettext('New tablespace'),
-                  type: 'text', disabled: false, control: 'node-list-by-name',
-                  node: 'tablespace', select2: {allowClear: false},
-                  filter: function(o) {
-                    return o && (o.label != d.label);
-                  }
-              },{
-                  id: 'obj_type', label: gettext('Object type'),
-                  type: 'text', disabled: false, control: 'select2',
-                  select2: { allowClear: false, width: "100%" },
-                  options: [
-                    {label: gettext("All"), value: 'all'},
-                    {label: gettext("Tables"), value: 'tables'},
-                    {label: gettext("Indexes"), value: 'indexes'},
-                    {label: gettext("Materialized views"), value: 'materialized_views'},
-                  ]
-              },{
-                  id: 'user', label: gettext('Object owner'),
-                  type: 'text', disabled: false, control: 'node-list-by-name',
-                  node: 'role', select2: {allowClear: false}
-              },{
-                  id: 'sqltab', label: gettext('SQL'), group: gettext('SQL'),
-                  type: 'text', disabled: false, control: Backform.SqlTabControl.extend({
-                    initialize: function() {
-                      // Initialize parent class
-                      Backform.SqlTabControl.prototype.initialize.apply(this, arguments);
-                    },
-                    onTabChange: function(obj) {
-                      // Fetch the information only if the SQL tab is visible at the moment.
-                      if (this.dialog && obj.shown == this.tabIndex) {
-                            var self = this,
-                            args = self.model.toJSON();
-                            // Add existing tablespace
-                            args.old_tblspc = d.label;
+            },{
+              id: 'obj_type', label: gettext('Object type'),
+              type: 'text', disabled: false, control: 'select2',
+              select2: { allowClear: false, width: '100%' },
+              options: [
+                {label: gettext('All'), value: 'all'},
+                {label: gettext('Tables'), value: 'tables'},
+                {label: gettext('Indexes'), value: 'indexes'},
+                {label: gettext('Materialized views'), value: 'materialized_views'},
+              ],
+            },{
+              id: 'user', label: gettext('Object owner'),
+              type: 'text', disabled: false, control: 'node-list-by-name',
+              node: 'role', select2: {allowClear: false},
+            },{
+              id: 'sqltab', label: gettext('SQL'), group: gettext('SQL'),
+              type: 'text', disabled: false, control: Backform.SqlTabControl.extend({
+                initialize: function() {
+                  // Initialize parent class
+                  Backform.SqlTabControl.prototype.initialize.apply(this, arguments);
+                },
+                onTabChange: function(obj) {
+                  // Fetch the information only if the SQL tab is visible at the moment.
+                  if (this.dialog && obj.shown == this.tabIndex) {
+                    var self = this,
+                      args = self.model.toJSON();
+                    // Add existing tablespace
+                    args.old_tblspc = d.label;
 
-                            // Fetches modified SQL
-                            $.ajax({
-                              url: msql_url,
-                              type: 'GET',
-                              cache: false,
-                              data: args,
-                              dataType: "json",
-                              contentType: "application/json"
-                            }).done(function(res) {
-                              self.sqlCtrl.clearHistory();
-                              self.sqlCtrl.setValue(res.data);
-                              self.sqlCtrl.refresh();
-                            }).fail(function() {
-                              self.model.trigger('pgadmin-view:msql:error');
-                            }).always(function() {
-                              self.model.trigger('pgadmin-view:msql:fetched');
-                            });
-                      }
-                    }
-                  })
-              }],
-              validate: function() {
-                  return null;
-              }
+                    // Fetches modified SQL
+                    $.ajax({
+                      url: msql_url,
+                      type: 'GET',
+                      cache: false,
+                      data: args,
+                      dataType: 'json',
+                      contentType: 'application/json',
+                    }).done(function(res) {
+                      self.sqlCtrl.clearHistory();
+                      self.sqlCtrl.setValue(res.data);
+                      self.sqlCtrl.refresh();
+                    }).fail(function() {
+                      self.model.trigger('pgadmin-view:msql:error');
+                    }).always(function() {
+                      self.model.trigger('pgadmin-view:msql:fetched');
+                    });
+                  }
+                },
+              }),
+            }],
+            validate: function() {
+              return null;
+            },
           });
 
-          if(!alertify.move_objects_dlg) {
-            alertify.dialog('move_objects_dlg' ,function factory() {
+          if(!Alertify.move_objects_dlg) {
+            Alertify.dialog('move_objects_dlg' ,function factory() {
               return {
                 main: function() {
-                 var title = gettext('Move objects to another tablespace');
-                 this.set('title', title);
+                  var title = gettext('Move objects to another tablespace');
+                  this.set('title', title);
                 },
                 build: function() {
-                  alertify.pgDialogBuild.apply(this);
+                  Alertify.pgDialogBuild.apply(this);
                 },
                 setup:function() {
                   return {
-                     buttons: [{
-                       text: '', key: 112, className: 'btn btn-default pull-left fa fa-lg fa-question',
-                       attrs:{name:'dialog_help', type:'button', label: gettext('Users'),
-                       url: url_for('help.static', {'filename': 'move_objects.html'})}
-                       },{
-                       text: gettext('OK'), key: 13, className: 'btn btn-primary fa fa-lg fa-save pg-alertify-button'
-                       },{
-                       text: gettext('Cancel'), key: 27, className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button'
-                     }],
-                     // Set options for dialog
-                     options: {
-                       //disable both padding and overflow control.
-                       padding : !1,
-                       overflow: !1,
-                       modal: false,
-                       resizable: true,
-                       maximizable: true,
-                       pinnable: false,
-                       closableByDimmer: false
-                     }
-                   };
+                    buttons: [{
+                      text: '', key: 112, className: 'btn btn-default pull-left fa fa-lg fa-question',
+                      attrs:{name:'dialog_help', type:'button', label: gettext('Users'),
+                        url: url_for('help.static', {'filename': 'move_objects.html'})},
+                    },{
+                      text: gettext('OK'), key: 13, className: 'btn btn-primary fa fa-lg fa-save pg-alertify-button',
+                    },{
+                      text: gettext('Cancel'), key: 27, className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button',
+                    }],
+                    // Set options for dialog
+                    options: {
+                      //disable both padding and overflow control.
+                      padding : !1,
+                      overflow: !1,
+                      modal: false,
+                      resizable: true,
+                      maximizable: true,
+                      pinnable: false,
+                      closableByDimmer: false,
+                    },
+                  };
                 },
                 hooks: {
                   // Triggered when the dialog is closed
@@ -205,11 +206,11 @@ define('pgadmin.node.tablespace', [
                       // clear our backform model/view
                       this.view.remove({data: true, internal: true, silent: true});
                     }
-                  }
+                  },
                 },
                 prepare: function() {
                   var self = this,
-                    $container = $("<div class='move_objects'></div>");
+                    $container = $('<div class=\'move_objects\'></div>');
                   //Disbale Okay button
                   this.__internal.buttons[1].element.disabled = true;
                   // Find current/selected node
@@ -224,13 +225,13 @@ define('pgadmin.node.tablespace', [
                   var treeInfo = node.getTreeNodeHierarchy.apply(node, [i]);
                   // Instance of backbone model
                   var newModel = new objModel({}, {node_info: treeInfo}),
-                      fields = Backform.generateViewSchema(
-                        treeInfo, newModel, 'create', node,
-                        treeInfo.server, true
-                      );
+                    fields = Backform.generateViewSchema(
+                      treeInfo, newModel, 'create', node,
+                      treeInfo.server, true
+                    );
 
                   var view = this.view = new Backform.Dialog({
-                    el: $container, model: newModel, schema: fields
+                    el: $container, model: newModel, schema: fields,
                   });
                   // Add our class to alertify
                   $(this.elements.body.childNodes[0]).addClass(
@@ -248,13 +249,13 @@ define('pgadmin.node.tablespace', [
                       self.__internal.buttons[1].element.disabled = false;
                     } else {
                       self.__internal.buttons[1].element.disabled = true;
-                      this.errorModel.set('tblspc', gettext('Please select tablespace'))
+                      this.errorModel.set('tblspc', gettext('Please select tablespace'));
                     }
                   });
                 },
                 // Callback functions when click on the buttons of the Alertify dialogs
                 callback: function(e) {
-                  if (e.button.element.name == "dialog_help") {
+                  if (e.button.element.name == 'dialog_help') {
                     e.cancel = true;
                     pgBrowser.showHelp(e.button.element.name, e.button.element.getAttribute('url'),
                       null, null, e.button.element.getAttribute('label'));
@@ -262,10 +263,10 @@ define('pgadmin.node.tablespace', [
                   }
                   if (e.button.text === gettext('OK')) {
                     var self = this,
-                        args =  this.view.model.toJSON();
-                        args.old_tblspc = d.label;
+                      args =  this.view.model.toJSON();
+                    args.old_tblspc = d.label;
                     e.cancel = true;
-                    alertify.confirm(
+                    Alertify.confirm(
                       gettext('Move objects...'),
                       gettext(
                         'Are you sure you wish to move the objects from %(old_tablespace)s to %(new_tablespace)s?',
@@ -278,20 +279,22 @@ define('pgadmin.node.tablespace', [
                           data:{'data': JSON.stringify(args) },
                           success: function(res) {
                             if (res.success) {
-                              alertify.success(res.info);
+                              Alertify.success(res.info);
                               self.close();
                             } else {
-                              alertify.error(res.errormsg);
+                              Alertify.error(res.errormsg);
                             }
                           },
-                          error: function(xhr, status, error) {
+                          error: function(xhr) {
                             try {
                               var err = $.parseJSON(xhr.responseText);
                               if (err.success == 0) {
-                                alertify.error(err.errormsg);
+                                Alertify.error(err.errormsg);
                               }
-                            } catch (e) {}
-                          }
+                            } catch (e) {
+                              console.warn(e.stack || e);
+                            }
+                          },
                         });
                       },
                       function() {
@@ -299,12 +302,12 @@ define('pgadmin.node.tablespace', [
                       }
                     );
                   }
-                }
-              }
+                },
+              };
             });
           }
-          alertify.move_objects_dlg(true).resizeTo('40%','50%');;
-        }
+          Alertify.move_objects_dlg(true).resizeTo('40%','50%');
+        },
       },
       model: pgBrowser.Node.Model.extend({
         defaults: {
@@ -314,7 +317,7 @@ define('pgadmin.node.tablespace', [
           spclocation: undefined,
           spcoptions: [],
           spcacl: [],
-          seclabels:[]
+          seclabels:[],
         },
 
         // Default values!
@@ -330,10 +333,10 @@ define('pgadmin.node.tablespace', [
 
         schema: [{
           id: 'name', label: gettext('Name'), cell: 'string',
-          type: 'text'
+          type: 'text',
         },{
           id: 'oid', label: gettext('OID'), cell: 'string',
-          type: 'text', disabled: true, mode: ['properties']
+          type: 'text', disabled: true, mode: ['properties'],
         },{
           id: 'spclocation', label: gettext('Location'), cell: 'string',
           group: gettext('Definition'), type: 'text', mode: ['properties', 'edit','create'],
@@ -341,59 +344,58 @@ define('pgadmin.node.tablespace', [
             // To disabled it in edit mode,
             // We'll check if model is new if yes then disabled it
             return !m.isNew();
-          }
+          },
         },{
           id: 'spcuser', label: gettext('Owner'), cell: 'string',
           type: 'text', control: 'node-list-by-name', node: 'role',
-          select2: {allowClear: false}
+          select2: {allowClear: false},
         },{
           id: 'acl', label: gettext('Privileges'), type: 'text',
-          group: gettext('Security'), mode: ['properties'], disabled: true
+          group: gettext('Security'), mode: ['properties'], disabled: true,
         },{
           id: 'description', label: gettext('Comment'), cell: 'string',
-          type: 'multiline'
+          type: 'multiline',
         },{
           id: 'spcoptions', label: gettext('Parameters'), type: 'collection',
-          group: gettext("Parameters"), control: 'variable-collection',
+          group: gettext('Parameters'), control: 'variable-collection',
           model: pgBrowser.Node.VariableModel,
           mode: ['edit', 'create'], canAdd: true, canEdit: false,
-          canDelete: true
-         },{
+          canDelete: true,
+        },{
           id: 'spcacl', label: gettext('Privileges'), type: 'collection',
           group: gettext('Security'), control: 'unique-col-collection',
           model: pgBrowser.Node.PrivilegeRoleModel.extend({privileges: ['C']}),
           mode: ['edit', 'create'], canAdd: true, canDelete: true,
           uniqueCol : ['grantee'],
-          columns: ['grantee', 'grantor', 'privileges']
-         },{
+          columns: ['grantee', 'grantor', 'privileges'],
+        },{
           id: 'seclabels', label: gettext('Security Labels'),
           model: pgBrowser.SecLabelModel, editable: false, type: 'collection',
           group: gettext('Security'), mode: ['edit', 'create'],
           min_version: 90200, canAdd: true,
-          canEdit: false, canDelete: true, control: 'unique-col-collection'
-        }
+          canEdit: false, canDelete: true, control: 'unique-col-collection',
+        },
         ],
         validate: function() {
-          var err = {},
-            errmsg = null,
-            changedAttrs = this.sessAttrs,
-            msg = undefined;
+          var msg;
+
           if (_.isUndefined(this.get('name'))
-              || String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
+            || String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
             msg = gettext('Name cannot be empty.');
             this.errorModel.set('name', msg);
           } else if (_.isUndefined(this.get('spclocation'))
               || String(this.get('spclocation')).replace(/^\s+|\s+$/g, '') == '') {
             msg = gettext('Location cannot be empty.');
             this.errorModel.set('spclocation', msg);
+            this.errorModel.unset('name');
           } else {
             this.errorModel.unset('name');
             this.errorModel.unset('spclocation');
           }
           return null;
-        }
-      })
-  });
+        },
+      }),
+    });
 
   }
 
diff --git a/web/pgadmin/browser/server_groups/static/js/server_group.js b/web/pgadmin/browser/server_groups/static/js/server_group.js
index 0ef9b35e..58d1ccd2 100644
--- a/web/pgadmin/browser/server_groups/static/js/server_group.js
+++ b/web/pgadmin/browser/server_groups/static/js/server_group.js
@@ -1,7 +1,7 @@
 define('pgadmin.node.server_group', [
-  'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'sources/pgadmin',
-  'backbone', 'pgadmin.browser', 'pgadmin.browser.node'
-], function(gettext, url_for, $, _, pgAdmin, Backbone) {
+  'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
+  'sources/pgadmin', 'pgadmin.browser', 'pgadmin.browser.node',
+], function(gettext, url_for, $, _, pgAdmin) {
 
   if (!pgAdmin.Browser.Nodes['server_group']) {
     pgAdmin.Browser.Nodes['server_group'] = pgAdmin.Browser.Node.extend({
@@ -15,7 +15,7 @@ define('pgadmin.node.server_group', [
       Init: function() {
         /* Avoid multiple registration of menus */
         if (this.initialized)
-            return;
+          return;
 
         this.initialized = true;
 
@@ -23,26 +23,26 @@ define('pgadmin.node.server_group', [
           name: 'create_server_group', node: 'server_group', module: this,
           applies: ['object', 'context'], callback: 'show_obj_properties',
           category: 'create', priority: 1, label: gettext('Server Group...'),
-          data: {'action': 'create'}, icon: 'wcTabIcon icon-server_group'
+          data: {'action': 'create'}, icon: 'wcTabIcon icon-server_group',
         }]);
       },
       model: pgAdmin.Browser.Node.Model.extend({
         defaults: {
           id: undefined,
-          name: null
+          name: null,
         },
         schema: [
           {
             id: 'id', label: gettext('ID'), type: 'int', group: null,
-            mode: ['properties']
+            mode: ['properties'],
           },{
             id: 'name', label: gettext('Name'), type: 'text', group: null,
-            mode: ['properties', 'edit', 'create']
-          }
+            mode: ['properties', 'edit', 'create'],
+          },
         ],
-        validate: function(attrs, options) {
-           var err = {},
-              errmsg = null;
+        validate: function() {
+          var errmsg = null;
+
           this.errorModel.clear();
 
           if (!this.isNew() && 'id' in this.changed) {
@@ -52,20 +52,15 @@ define('pgadmin.node.server_group', [
           }
           if (_.isUndefined(this.get('name')) ||
             _.isNull(this.get('name')) ||
-            String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
+              String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
             errmsg = gettext('Name cannot be empty.');
             this.errorModel.set('name', errmsg);
             return errmsg;
           }
           return null;
-        }
+        },
       }),
-      canDrop: function(itemData, item, data) {
-        if(itemData.can_delete) {
-          return true;
-        }
-        return false;
-      },
+      canDrop: function(itemData) { return itemData.can_delete; },
       canDelete: function(i) {
         var s = pgAdmin.Browser.tree.siblings(i, true);
 
@@ -74,7 +69,7 @@ define('pgadmin.node.server_group', [
           return false;
         }
         return true;
-      }
+      },
     });
   }
 
