Commit 52be4e8d by Nattana Chaiyamat

แก้ปุ่มเพิ่ม ปุ่มลบหน้าdatasource table

parent e0853513
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
</thead> </thead>
<tbody *ngIf="!datasourceTableFilter().length"> <tbody *ngIf="!datasourceTableFilter().length">
<tr style="background-color:#ebf2f6"> <tr style="background-color:#ebf2f6">
<td colspan="7" class="text-center">ไม่พบข้อมูล</td> <td colspan="9" class="text-center">ไม่พบข้อมูล</td>
</tr> </tr>
</tbody> </tbody>
<tbody *ngIf="datasourceTableFilter().length"> <tbody *ngIf="datasourceTableFilter().length">
......
...@@ -47,10 +47,10 @@ export class DatasourceTableComponent implements OnInit { ...@@ -47,10 +47,10 @@ export class DatasourceTableComponent implements OnInit {
modalConfirmRef.result.then(result => { modalConfirmRef.result.then(result => {
this.datasourceTable.loading = true this.datasourceTable.loading = true
this.datasourseTableService.post(this.datasourceTable.select).subscribe(response => { this.datasourseTableService.post(this.datasourceTable.select).subscribe(response => {
this.openAlertModal(response.message)
if (response.success) { if (response.success) {
this.getList() this.getList()
} else { } else {
this.openAlertModal(response.message)
this.datasourceTable.loading = false this.datasourceTable.loading = false
} }
}, error => { }, error => {
...@@ -64,14 +64,14 @@ export class DatasourceTableComponent implements OnInit { ...@@ -64,14 +64,14 @@ export class DatasourceTableComponent implements OnInit {
centered: true, centered: true,
backdrop: 'static', backdrop: 'static',
}) })
modalConfirmRef.componentInstance.message = 'คุณต้องการบันทึกข้อมูลหรือไม่' modalConfirmRef.componentInstance.message = 'คุณต้องการลบข้อมูลหรือไม่'
modalConfirmRef.result.then(result => { modalConfirmRef.result.then(result => {
this.datasourceTable.loading = true this.datasourceTable.loading = true
this.datasourseTableService.post(this.datasourceTable.select).subscribe(response => { this.datasourseTableService.delete(this.datasourceTable.select).subscribe(response => {
this.openAlertModal(response.message)
if (response.success) { if (response.success) {
this.getList() this.getList()
} else { } else {
this.openAlertModal(response.message)
this.datasourceTable.loading = false this.datasourceTable.loading = false
} }
}, error => { }, error => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment