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()
} else {
this.useData();
}
-
- if (this.selectionType === 'single') {
- this.table.selectCheck = this.singleSelectCheck.bind(this);
- }
}
initUserConfig() {
resizeable: false,
sortable: false,
draggable: false,
- checkboxable: true,
+ checkboxable: false,
canAutoResize: false,
cellClass: 'cd-datatable-checkbox',
+ cellTemplate: this.rowSelectionTpl,
width: 30
});
}
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;