diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/templates/index/js/index.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/templates/index/js/index.js index 031225bd9..328358295 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/templates/index/js/index.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/templates/index/js/index.js @@ -107,7 +107,7 @@ function($, _, S, pgAdmin, pgBrowser, Backform, alertify) { } },{ id: 'sort_order', label:'{{ _('Sort order') }}', - cell: Backgrid.ExtensionSwitchDepCell, type: 'switch', + cell: Backgrid.Extension.SwitchDepCell, type: 'switch', disabled: 'checkAccessMethod', editable: function(m) { // Header cell then skip diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/js/schema.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/js/schema.js index 72a5936a2..0ea8cd6cd 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/js/schema.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/js/schema.js @@ -457,7 +457,8 @@ function($, _, S, pgAdmin, pgBrowser, Backform, alertify) { } // Switch Cell with Deps - var SwitchDepCell = Backgrid.Extension.SwitchCell.extend({ + var SwitchDepCell = + Backgrid.Extension.SwitchDepCell = Backgrid.Extension.SwitchCell.extend({ initialize: function() { Backgrid.Extension.SwitchCell.prototype.initialize.apply(this, arguments); Backgrid.Extension.DependentCell.prototype.initialize.apply(this, arguments); @@ -466,15 +467,18 @@ function($, _, S, pgAdmin, pgBrowser, Backform, alertify) { var model = this.model, column = this.column, editable = this.column.get("editable"), - input = this.$el.find('input[type=checkbox]').first(); + input = this.$el.find('input[type=checkbox]').first(), + self_name = column.get('name'); is_editable = _.isFunction(editable) ? !!editable.apply(column, [model]) : !!editable; if (is_editable) { this.$el.addClass("editable"); - input.prop('disabled', false); + input.bootstrapSwitch('disabled',false); } else { this.$el.removeClass("editable"); - input.prop('disabled', true); + input.bootstrapSwitch('disabled',true); + // Set self value into model to false + setTimeout(function() { model.set(self_name, false); }, 10); } this.delegateEvents();