I created a button on the list view page and need to obtain the selected record data. I tried using this.getSelectedIds(), but it doesn't work.
HTML Code:
"views": {
"list": "custom:views/Employeework/list"
}
HTML Code:
define('custom:views/Employeework/list', 'views/list', function (Dep) {
return Dep.extend({
setup: function() {
Dep.prototype.setup.call(this);
this.setupCustomButtons();
},
setupCustomButtons: function () {
this.menu.buttons.push({
action: 'myAction',
html: '<span class="fas fa-chess-rook fa-sm"></span> ' + this.translate('Create Employeewages', 'labels', this.scope),
style: 'default',
acl: 'read',
aclScope: this.entityType || this.scope
});
},
actionMyAction: function() {
var selectedItems = this.getSelectedIds(); // 使用 getSelectedIds 方法
if (!selectedItems.length) {
Espo.Ui.warning(this.translate('请选择出勤对象', 'messages', 'Employeework'));
return;
}
},
});
});

Comment