Move and delete rows (dynamic table)

This commit is contained in:
Denys Vuika
2016-10-20 12:07:28 +01:00
committed by Vito Albano
parent 8542999f0e
commit 4f566a7ba2
3 changed files with 97 additions and 1 deletions

View File

@@ -38,4 +38,34 @@ export class DynamicTableWidget extends WidgetComponent implements OnInit {
this.content.selectedRow = row;
}
}
hasSelection(): boolean {
return !!(this.content && this.content.selectedRow);
}
moveSelectionUp() {
if (this.content) {
this.content.moveRow(this.content.selectedRow, -1);
}
}
moveSelectionDown() {
if (this.content) {
this.content.moveRow(this.content.selectedRow, 1);
}
}
addNewRow() {
console.log('add new row clicked');
}
deleteSelection() {
if (this.content) {
this.content.deleteRow(this.content.selectedRow);
}
}
editSelection() {
console.log('edit selection clicked');
}
}