fixes bug with checkAvailableColumns function [fixes SCI-2578]

This commit is contained in:
zmagod 2018-06-29 10:28:10 +02:00
parent 10554fecb4
commit eb75f6c03d
2 changed files with 2 additions and 7 deletions

View file

@ -400,13 +400,7 @@ var RepositoryDatatable = (function(global) {
dataType: 'json',
success: function(data) {
var columns_ids = data.columns;
var present_columns = [];
$('table' + TABLE_ID + ' thead tr').children('th').each(function() {
var id = parseInt($(this).attr('id'));
if(id) {
present_columns.push(id);
}
});
var present_columns = $(TABLE_ID).data('repository-columns-ids');
if( !_.isEqual(columns_ids.sort(), present_columns.sort()) ) {
alert($(TABLE_ID).data('columns-changed'));
animateSpinner();

View file

@ -8,6 +8,7 @@
data-delete-record="<%= repository_delete_records_path(repository) %>"
data-copy-records="<%= repository_copy_records_path(repository) %>"
data-max-dropdown-length="<%= Constants::NAME_TRUNCATION_LENGTH_DROPDOWN %>"
data-repository-columns-ids="<%= repository.available_columns_ids %>"
data-save-text="<%= I18n.t('general.save') %>"
data-edit-text="<%= I18n.t('general.edit') %>"
data-cancel-text="<%= I18n.t('general.cancel') %>"