diff --git a/AstuteClient2/src/app/customer/customer.component.html b/AstuteClient2/src/app/customer/customer.component.html index cf6cebd..bffabd7 100644 --- a/AstuteClient2/src/app/customer/customer.component.html +++ b/AstuteClient2/src/app/customer/customer.component.html @@ -18,7 +18,6 @@ (rowDataChanged)="resizeColumns($event)" rowSelection="single" rowDeselection="true" - suppressHorizontalScroll="false" > diff --git a/AstuteClient2/src/app/customer/customer.component.ts b/AstuteClient2/src/app/customer/customer.component.ts index a189816..308d17a 100644 --- a/AstuteClient2/src/app/customer/customer.component.ts +++ b/AstuteClient2/src/app/customer/customer.component.ts @@ -120,6 +120,7 @@ export class CustomerComponent implements OnInit { // callback for grid selection setSelectedRow(event) { this.selected = event.data; + this.contactsData = this.astuteClientService.getCustomerContacts(this.selected.customerId); } // wrappers for customer service methods @@ -306,10 +307,13 @@ export class CustomerComponent implements OnInit { // opening and closing modal-form components open(ref) { // this.getSelectedRows(); - if (this.selected) { - this.contactsData = this.astuteClientService.getCustomerContacts(this.selected.customerId); - } ref.open(); + if (this.gridColumnApi) { + this.gridColumnApi.autoSizeAllColumns(); + } + if (this.contactColumnApi) { + this.contactColumnApi.autoSizeAllColumns(); + } } close(ref) { ref.close(); @@ -325,6 +329,7 @@ export class CustomerComponent implements OnInit { } refreshContactData(customerId) { this.contactsData = this.astuteClientService.getCustomerContacts(customerId); + this.contactColumnApi.autoSizeColumns(); } // on each grid ready: sets api's and enable auto-resizing diff --git a/AstuteClient2/src/app/invoice/invoice.component.ts b/AstuteClient2/src/app/invoice/invoice.component.ts index 1a36a38..a42861f 100644 --- a/AstuteClient2/src/app/invoice/invoice.component.ts +++ b/AstuteClient2/src/app/invoice/invoice.component.ts @@ -384,13 +384,13 @@ export class InvoiceComponent implements OnInit { // open(content, indexPO, indexINV) { open(content) { // this.setCorrespondingCustomer(); + content.open(); if (this.gridColumnApi) { this.gridColumnApi.autoSizeAllColumns(); } if (this.detailColumnApi) { this.detailColumnApi.autoSizeAllColumns(); } - content.open(); // this.detailDescription = ViewChild('detailDescription'); // this.detailAmount = ViewChild('detailAmount'); // this.detailRate = ViewChild('detailRate'); @@ -414,10 +414,10 @@ export class InvoiceComponent implements OnInit { } getCurrDate() { - let d = new Date(), - month = '' + (d.getMonth() + 1), - day = '' + d.getDate(), - year = d.getFullYear(); + const d = new Date(); + let month = '' + (d.getMonth() + 1), + day = '' + d.getDate(); + const year = d.getFullYear(); if (month.length < 2) month = '0' + month; if (day.length < 2) day = '0' + day; @@ -428,8 +428,8 @@ export class InvoiceComponent implements OnInit { formatDate(d: Date) { let month = '' + (d.getMonth() + 1), - day = '' + d.getDate(), - year = d.getFullYear(); + day = '' + d.getDate(); + const year = d.getFullYear(); if (month.length < 2) { month = '0' + month; diff --git a/AstuteClient2/src/app/sales-order/sales-order.component.ts b/AstuteClient2/src/app/sales-order/sales-order.component.ts index 80068be..659419e 100644 --- a/AstuteClient2/src/app/sales-order/sales-order.component.ts +++ b/AstuteClient2/src/app/sales-order/sales-order.component.ts @@ -276,13 +276,13 @@ export class SalesOrderComponent implements OnInit { // open and closing modal-form components open(ref) { // this.getSelectedRows(); + ref.open(); if (this.gridColumnApi) { this.gridColumnApi.autoSizeAllColumns(); } if (this.detailColumnApi) { this.detailColumnApi.autoSizeAllColumns(); } - ref.open(); } close(ref) { // this.newPODetail = [];