select records button disable

This commit is contained in:
yuri
2018-06-18 14:23:04 +03:00
parent 30909c497b
commit 4e226ebcb7
2 changed files with 16 additions and 1 deletions
+12 -1
View File
@@ -91,6 +91,7 @@ Espo.define('views/modals/select-records', ['views/modal', 'search-manager'], fu
name: 'select',
style: 'primary',
label: 'Select',
disabled: true,
onClick: function (dialog) {
var listView = this.getView('list');
@@ -193,10 +194,20 @@ Espo.define('views/modals/select-records', ['views/modal', 'search-manager'], fu
checkAllResultDisabled: !this.massRelateEnabled,
buttonsDisabled: true
}, function (view) {
view.once('select', function (model) {
this.listenToOnce(view, 'select', function (model) {
this.trigger('select', model);
this.close();
}.bind(this));
if (this.multiple) {
this.listenTo(view, 'check', function () {
if (view.checkedList.length) {
this.enableButton('select');
} else {
this.disableButton('select');
}
}, this);
}
}.bind(this));
}.bind(this));
+4
View File
@@ -161,6 +161,8 @@ Espo.define('views/record/list', 'view', function (Dep) {
this.$el.find('.actions-button').attr('disabled', true);
this.$el.find('.list > table tbody tr').removeClass('active');
}
this.trigger('check');
},
'click .action': function (e) {
var $el = $(e.currentTarget);
@@ -1002,6 +1004,8 @@ Espo.define('views/record/list', 'view', function (Dep) {
} else {
this.$el.find('.select-all').prop('checked', false);
}
this.trigger('check');
},
getRowActionsDefs: function () {