This commit is contained in:
Yuri Kuznetsov
2024-03-23 13:31:09 +02:00
parent dcd0469977
commit d9d7de8804
+17 -12
View File
@@ -1879,18 +1879,7 @@ class ListRecordView extends View {
const id = $(e.target).attr('data-id');
if (id) {
const model = this.collection.get(id);
if (this.checkboxes) {
const list = [];
list.push(model);
this.trigger('select', list);
}
else {
this.trigger('select', model);
}
this.selectModel(id);
}
e.stopPropagation();
@@ -1988,6 +1977,22 @@ class ListRecordView extends View {
this._renderEmpty = this.options.skipBuildRows;
}
/**
* @private
* @param {string} id
*/
selectModel(id) {
const model = this.collection.get(id);
if (this.checkboxes) {
this.trigger('select', [model]);
return;
}
this.trigger('select', model);
}
afterRender() {
this._stickyBarHelper = null;