build_app
This commit is contained in:
@@ -45,6 +45,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- who column -->
|
||||
<clr-dg-column> <ng-container *clrDgHideableColumn="{hidden: false}">
|
||||
@@ -75,6 +77,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- who column -->
|
||||
<clr-dg-cell>
|
||||
@@ -235,6 +239,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- // EDIT DATA......... -->
|
||||
<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
|
||||
<h3 class="modal-title">Update Ad8
|
||||
@@ -258,6 +264,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</h3>
|
||||
<div class="modal-body" *ngIf="rowSelected.id">
|
||||
<h2 class="heading">{{rowSelected.id}}</h2>
|
||||
@@ -275,6 +283,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -305,6 +315,51 @@
|
||||
|
||||
|
||||
|
||||
<!-- one to many code start here -->
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-lg-12">
|
||||
<table class="table" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
|
||||
|
||||
<th class="left" style="width:200px;">description</th>
|
||||
|
||||
|
||||
|
||||
<th class="left" style="width:200px;">name</th>
|
||||
|
||||
|
||||
<th class="right" style="width:200px;">{{ supportcomponents?.length >= 1 ? 'Actions' : '' }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let component of supportcomponents; let i = index">
|
||||
|
||||
|
||||
|
||||
<td class="left"> <input type="text" name="description" [(ngModel)]="component.description" [ngModelOptions]=" {standalone: true}" placeholder="Enter description" class="clr-input">
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<td class="left"> <input type="text" name="name" [(ngModel)]="component.name" [ngModelOptions]=" {standalone: true}" placeholder="Enter name" class="clr-input">
|
||||
</td>
|
||||
|
||||
|
||||
<td> <a>
|
||||
<clr-icon shape="trash" class="is-error" (click)="deleteRow(i)"></clr-icon>
|
||||
</a> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<button type="button" class="btn btn-primary button1" (click)="oneditsupport()" style="margin-left: 20px;">
|
||||
<clr-icon shape="plus"></clr-icon> </button>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- one to many code end here -->
|
||||
|
||||
<!-- form code start -->
|
||||
<div *ngIf="checkFormCode">
|
||||
<h4 style="font-weight: 300;display: inline;">Extension</h4>
|
||||
@@ -357,6 +412,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- aeroplane icon -->
|
||||
|
||||
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
|
||||
@@ -381,6 +438,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -414,6 +473,56 @@
|
||||
</div>
|
||||
|
||||
|
||||
<!-- one to many code start here -->
|
||||
<div style="margin-top: 30px;"><h4 style="display: inline;">support </h4>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="clr-row">
|
||||
<div class="clr-col-lg-12">
|
||||
<table class="table" style="width:100%;" formArrayName="support">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
|
||||
|
||||
<th class="left" style="width:125px;">description</th>
|
||||
|
||||
|
||||
|
||||
<th class="left" style="width:125px;">name</th>
|
||||
|
||||
|
||||
|
||||
<th class="right" style="width:125px;">{{ supportcontrols.length > 1 ? 'Actions' : '' }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let item of supportcontrols; let i=index" [formGroupName]="i">
|
||||
|
||||
|
||||
<td class="left"> <input type="text" formControlName="description" placeholder="Enter description" style="width:180px"
|
||||
class="clr-input"> </td>
|
||||
|
||||
|
||||
|
||||
<td class="left"> <input type="text" formControlName="name" placeholder="Enter name" style="width:180px"
|
||||
class="clr-input"> </td>
|
||||
|
||||
|
||||
|
||||
<td style="width:40px;">
|
||||
<a *ngIf="supportcontrols.length > 1" (click)="onRemovesupport(i)"><clr-icon shape="trash" class="is-error"></clr-icon>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<button type="button" class="btn btn-primary button1" (click)="onAddsupport()" >
|
||||
<clr-icon shape="plus"></clr-icon> </button>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- one to many code end here -->
|
||||
|
||||
|
||||
|
||||
<!-- form code start -->
|
||||
@@ -454,6 +563,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- htmlpopup -->
|
||||
|
||||
<clr-modal [(clrModalOpen)]="modalUpdateButtonupdate2" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
|
||||
|
||||
@@ -78,6 +78,8 @@ name : [null],
|
||||
|
||||
childform: this.childforminitLinesForm(),
|
||||
|
||||
support: this._fb.array([this.initsupportForm()]),
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -87,6 +89,8 @@ childform: this.childforminitLinesForm(),
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}); // component_button200
|
||||
// inser code start
|
||||
this.UpdateFormButtonupdate2 = this._fb.group({
|
||||
@@ -135,6 +139,8 @@ childform: this.childforminitLinesForm(),
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if (this.editInterval) {
|
||||
@@ -165,6 +171,43 @@ childforminitLinesForm() { return this._fb.group({
|
||||
}); }
|
||||
|
||||
|
||||
// one to many start
|
||||
initsupportForm() { return this._fb.group({
|
||||
|
||||
|
||||
|
||||
description: [null],
|
||||
|
||||
|
||||
|
||||
name: [null],
|
||||
|
||||
|
||||
|
||||
}); }
|
||||
get supportcontrols() {return (this.entryForm.get("support") as FormArray).controls; }
|
||||
onAddsupport() {
|
||||
(<FormArray>this.entryForm.get("support")).push(this.initsupportForm()); }
|
||||
onRemovesupport(index: number) {
|
||||
(<FormArray>this.entryForm.get("support")).removeAt(index); }
|
||||
oneditsupport() { this.supportcomponents.push({
|
||||
|
||||
|
||||
description: "",
|
||||
|
||||
|
||||
|
||||
name: "",
|
||||
|
||||
|
||||
|
||||
}); }
|
||||
deletesupportRow(index) {
|
||||
this.supportcomponents.splice(index, 1);
|
||||
}
|
||||
supportcomponents;
|
||||
// one to many end
|
||||
|
||||
error;
|
||||
getData() {
|
||||
this.mainService.getAll().subscribe((data) => {
|
||||
@@ -190,6 +233,8 @@ this.product = [...this.product].reverse(); if(this.product.length==0){
|
||||
|
||||
|
||||
|
||||
this.supportcomponents = row.support;
|
||||
|
||||
|
||||
this.modalEdit = true;
|
||||
}
|
||||
@@ -218,6 +263,8 @@ this.product = [...this.product].reverse(); if(this.product.length==0){
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//console.log("in update");
|
||||
console.log("id " + id);
|
||||
console.log(this.rowSelected);
|
||||
@@ -239,6 +286,8 @@ setTimeout(() => {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}, (error) => {
|
||||
console.log(error);
|
||||
if (error.status >= 200 && error.status <= 299) {
|
||||
@@ -265,6 +314,8 @@ onCreate() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
this.mainService.create(this.entryForm.value).subscribe(
|
||||
(data) => {
|
||||
console.log(data);
|
||||
@@ -282,6 +333,8 @@ setTimeout(() => {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}, (error) => {
|
||||
console.log(error);
|
||||
if (error.status >= 200 && error.status <= 299) {
|
||||
@@ -308,6 +361,8 @@ this.modalAdd = true; this.submitted = false;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
submitted = false;
|
||||
onSubmit() {
|
||||
@@ -326,6 +381,8 @@ onSubmit() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// updateaction
|
||||
|
||||
// update button
|
||||
@@ -413,3 +470,5 @@ onUpdateButtonUpdate(id) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ export class Ad8service{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// updateaction
|
||||
// update button code start
|
||||
updateChildform(id: number,Childform: any): Observable<any> {
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import { ChildformComponent } from './BuilderComponents/stpkg/Childform/Childform.component';
|
||||
import { DistrictComponent } from './BuilderComponents/testdata/District/District.component';
|
||||
import { StateComponent } from './BuilderComponents/testdata/State/State.component';
|
||||
@@ -293,6 +310,40 @@ const routes: Routes = [
|
||||
|
||||
|
||||
// buildercomponents
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{path:'Childform',component:ChildformComponent},
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import { ChildformComponent } from './BuilderComponents/stpkg/Childform/Childform.component';
|
||||
import { DistrictComponent } from './BuilderComponents/testdata/District/District.component';
|
||||
import { StateComponent } from './BuilderComponents/testdata/State/State.component';
|
||||
@@ -157,6 +174,40 @@ import { DynamicFormViewerComponent } from './superadmin/dynamicform/dynamic-for
|
||||
|
||||
|
||||
// buildercomponents
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ChildformComponent,
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user