]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts
import ceph quincy 17.2.6
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / datatable / table / table.component.ts
index 4f8ca7133036707b8bc905566ad45509c89f86db..c6c9369acfc637dd0c3bdb7235704ec220602acf 100644 (file)
@@ -70,6 +70,8 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O
   timeAgoTpl: TemplateRef<any>;
   @ViewChild('rowDetailsTpl', { static: true })
   rowDetailsTpl: TemplateRef<any>;
+  @ViewChild('rowSelectionTpl', { static: true })
+  rowSelectionTpl: TemplateRef<any>;
 
   // This is the array with the items to be shown.
   @Input()
@@ -331,10 +333,6 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O
     } else {
       this.useData();
     }
-
-    if (this.selectionType === 'single') {
-      this.table.selectCheck = this.singleSelectCheck.bind(this);
-    }
   }
 
   initUserConfig() {
@@ -432,9 +430,10 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O
         resizeable: false,
         sortable: false,
         draggable: false,
-        checkboxable: true,
+        checkboxable: false,
         canAutoResize: false,
         cellClass: 'cd-datatable-checkbox',
+        cellTemplate: this.rowSelectionTpl,
         width: 30
       });
     }
@@ -769,10 +768,6 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O
     this.updateSelection.emit(_.clone(this.selection));
   }
 
-  private singleSelectCheck(row: any) {
-    return this.selection.selected.indexOf(row) === -1;
-  }
-
   toggleColumn(column: CdTableColumn) {
     const prop: TableColumnProp = column.prop;
     const hide = !column.isHidden;