Reset the column list properly if the access method is changed on an index to ensure error handling works correctly. Fixes #2009

This commit is contained in:
Neel Patel 2017-01-08 04:20:09 +00:00 committed by Dave Page
parent 6e14bef801
commit 2787c5c207

View File

@ -285,8 +285,11 @@ function($, _, S, pgAdmin, pgBrowser, Backform, alertify) {
var msg = '{{ _('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');
column_collection.reset();
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(){