From 596130c208b1e2286bf1e4f30c1c3f0507d8e027 Mon Sep 17 00:00:00 2001 From: RadheTians Date: Sun, 20 Dec 2020 21:37:32 +0530 Subject: [PATCH 1/2] Added row clickable in customer table --- src/app/main/customer/customer.component.html | 3 +-- src/app/main/customer/customer.component.ts | 23 +++++++------------ 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/app/main/customer/customer.component.html b/src/app/main/customer/customer.component.html index 93d9545..332ac7b 100644 --- a/src/app/main/customer/customer.component.html +++ b/src/app/main/customer/customer.component.html @@ -2,8 +2,7 @@
- +
diff --git a/src/app/main/customer/customer.component.ts b/src/app/main/customer/customer.component.ts index 62e6b2f..ea57caf 100644 --- a/src/app/main/customer/customer.component.ts +++ b/src/app/main/customer/customer.component.ts @@ -61,19 +61,7 @@ export class CustomerComponent implements OnInit { /** Settings for smart-table */ settings = { - selectMode: 'multi', - mode: 'external', - actions: { - custom: [ - { - name: 'View', - title: 'View', - }, - ], - add: false, - edit: false, - delete: false, - }, + actions: false, columns: { identifier: { title: 'ID', @@ -103,7 +91,10 @@ export class CustomerComponent implements OnInit { renderComponent: CustomDateRenderComponent, }, }, - pager: false, + mode: 'external', + pager: { + display: false, + }, }; constructor( @@ -222,7 +213,9 @@ export class CustomerComponent implements OnInit { /** Customer row select event */ onCustomerRowSelect(event: any): void { - // const data = event.data; + console.log(event.data); + const customer = event.data; + this.router.navigate(['detail', customer.identifier], { relativeTo: this.route }); } onCustomAction(event: any): void { From 37c6825963c3bd886530edebbda413bb00f324ec Mon Sep 17 00:00:00 2001 From: RadheTians Date: Sun, 20 Dec 2020 21:41:45 +0530 Subject: [PATCH 2/2] Added row clickable in customer table --- src/app/main/customer/customer.component.scss | 13 +++++++++++-- src/app/main/customer/customer.component.ts | 1 - 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/app/main/customer/customer.component.scss b/src/app/main/customer/customer.component.scss index a1212ab..46a9e6c 100644 --- a/src/app/main/customer/customer.component.scss +++ b/src/app/main/customer/customer.component.scss @@ -26,6 +26,9 @@ margin: 0 1rem; } } +:host /deep/ ng2-smart-table table > tbody > tr > td:hover { + cursor: pointer; +} :host /deep/ ng2-smart-table table > tbody > tr > td { font-size: 0.8rem; @@ -47,7 +50,10 @@ height: 0 !important; } -:host /deep/ ng2-st-tbody-custom a.ng2-smart-action.ng2-smart-action-custom-custom { +:host + /deep/ + ng2-st-tbody-custom + a.ng2-smart-action.ng2-smart-action-custom-custom { display: inline-block; height: auto; width: 90px; @@ -55,6 +61,9 @@ font-size: 0.8rem !important; } -:host /deep/ ng2-st-tbody-custom a.ng2-smart-action.ng2-smart-action-custom-custom:hover { +:host + /deep/ + ng2-st-tbody-custom + a.ng2-smart-action.ng2-smart-action-custom-custom:hover { color: #5dcfe3; } diff --git a/src/app/main/customer/customer.component.ts b/src/app/main/customer/customer.component.ts index ea57caf..d0a2719 100644 --- a/src/app/main/customer/customer.component.ts +++ b/src/app/main/customer/customer.component.ts @@ -213,7 +213,6 @@ export class CustomerComponent implements OnInit { /** Customer row select event */ onCustomerRowSelect(event: any): void { - console.log(event.data); const customer = event.data; this.router.navigate(['detail', customer.identifier], { relativeTo: this.route }); }