ngx-datatable-wy
v15.2.2
Published
ngx-datatable is a Angular2+ table grid component for presenting large and complex data. NOTE: this is angular6 version.
Downloads
4
Maintainers
Readme
ngx-datatable-wy
fork from @swimlane/ngx-datatable
support Angular7.0, wyy branch for publish.
# package
npm run package
# postversion
npm run postversion --[tag]
Feature
- DataTableBodyComponent only vertical scrolling trigger updateRows() methods.
onBodyScroll() {
// ...
// this.updateRows(); // source code
if(event.direction) { // Vertical scroll
this.updateRows();
}
}
- DatatableComponent Update recalculate(): add markForCheck.
recalculate(): void {
this.recalculateDims();
this.recalculateColumns();
this.cd.markForCheck(); // +++
}
- DataTableSelectionComponent Update selectRow(): emit current selected row.
selectRow(event: KeyboardEvent | MouseEvent, index: number, row: any): void {
//...
this.select.emit({
selected,
row // +++ 选中行返回当前行数据
});
}
Bugfix
- DataTableBodyComponent [trackByProp]
constructor(private cd: ChangeDetectorRef) {
// declare fn here so we can get access to the `this` property
this.rowTrackingFn = function(this: any, index: number, row: any): any {
const idx = this.getRowIndex(row);
if (this.trackByProp) {
return row[this.trackByProp]; // to fix
// return `${idx}-${this.trackByProp}`; // source code
} else {
return idx;
}
}.bind(this);
}