-
+
-
-
-
-
-
-
-
-
+
+
+
+
-
+
+
+
+
+
+
+
+
-
-
-
- {{ rowIndex + 1 }}
+
+
+
+
+ {{rowIndex+1}}
-
-
-
- {{ element.name }}
-
+
+
+ Device Name
+
+
+ {{value}}
-
-
-
- {{ element.position }}
-
+
+
+ Category
+
+
+ {{value}}
-
-
- {{ element.office }}
+
+
+ Location
+
+
+ {{value}}
-
-
- {{ element.age }}
+
+
+ Location Room
+
+
+ {{value}}
-
-
- {{ element.salary }}
+
+
+ Duration Use
+
+
+ {{value}}
-
-
- {{ element.startdate }}
+
+
+ Status
+
+
+ {{value}}
{
+ this.tableApiservice.getTableInitialisationData().subscribe((response) => {
this.data = response;
this.filteredRows = this.data.rows;
});
@@ -80,48 +80,44 @@ export class DeviceComponent implements OnInit {
);
}
- // private newAttribute = {
- // id: 15,
- // name: "Mark",
- // position: "Otto",
- // office: "@mdo",
- // age: "31",
- // salary: "12000",
- // startdate: "16/05/2017",
- // };
-
- // addFieldValue() {
- // this.rows.push(this.newAttribute);
- // this.rows = [...this.rows];
- // }
-
addFieldValue() {
- const modalRef = this.modalService.open(ModalAddEditComponent, { size: 'lg' });
- modalRef.componentInstance.newAttribute = { id: null, name: '', position: '', office: '', age: '', salary: '', startdate: '' };
-
- modalRef.result.then((result) => {
- if (result) {
- this.rows.push(result);
- this.rows = [...this.rows];
- }
- }, (reason) => {
- console.log(`Dismissed: ${reason}`);
+ const modalRef = this.modalService.open(ModalAddEditComponent, {
+ size: "lg",
});
+ modalRef.componentInstance.newAttribute = {
+ id: null,
+ name: "",
+ position: "",
+ office: "",
+ age: "",
+ salary: "",
+ startdate: "",
+ };
+
+ modalRef.result.then(
+ (result) => {
+ if (result) {
+ this.rows.push(result);
+ this.rows = [...this.rows];
+ }
+ },
+ (reason) => {
+ console.log(`Dismissed: ${reason}`);
+ }
+ );
}
viewRow(row) {
console.log("View row:", row);
- this.router.navigate(['/device/view', row.id]);
+ this.router.navigate(["/device/view", row.name]);
}
-
+
editRow(row) {
console.log("Edit row:", row);
- this.router.navigate(['/device/edit', row.id]);
+ this.router.navigate(["/device/edit", row.name]);
}
-
+
deleteRow(row) {
console.log("Delete row:", row);
}
-
-
}