main test done

This commit is contained in:
Yubing325 2020-07-09 16:24:52 -05:00
parent fcc39e9fac
commit a0445f2474
5 changed files with 64 additions and 26 deletions

View File

@ -4,7 +4,7 @@
<ng-container *psDataGridHeader>
<button class="btn-success btn" psbxFormGroupCommandModal commandTitle="Adding a new merchant"
commandText="Add" [dataSource]="merchantDataSource" command="addMerchant"
(formCreate)="onFormCreate($event)" [template]="theModal">Create a new</button>
(formCreate)="onFormCreate($event)" [template]="theModal">Create New Records</button>
</ng-container>
<ng-container psDataGridCol="id">
<div *psDataGridColHeader>ID</div>
@ -19,12 +19,32 @@
<div *psDataGridCell="let model">{{model.address}}</div>
</ng-container>
<ng-container psDataGridCol="actions">
<ng-container *psDataGridColHeader>Actions</ng-container>
<ng-container *psDataGridCell="let model">
<button class="btn-success btn" psbxFormGroupCommandModal [commandTitle]="'Change ' + model.name + ' name'" commandText="Update"
[dataSource]="merchantDataSource" command="changeMerchant" (formCreate)="onFormCreate($event)" [model]="model" [template]="theModal">Change</button>
<!-- <button class="btn-danger btn" psbxConfirmModal [commandTitle]="'Are you sure you wnat to remove ' + model.name + '?'" commandText="Remove"
[dataSource]="merchantDataSource" command="removeMerchant" [model]="model" >Delete!</button> -->
<div class="btn-group">
<button class="btn-success btn" psbxFormGroupCommandModal
[commandTitle]="'Change ' + model.name + ' name'"
commandText="Update"
[dataSource]="merchantDataSource"
command="changeMerchant"
(formCreate)="onFormCreate($event)"
[model]="model"
[template]="theModal">Change</button>
<button class="btn-danger btn"
psbxCommand
[dataSource]="merchantDataSource"
command="removeMerchant"
[model]="model"
[confirm]="true"
yesClass="warning"
noClass = "secondary"
noText = "Cancel Delete"
yesText = "Delete It"
confirmMessage="Are you sure you want to delete this merchant?"
>RemoveIt</button>
</div>
</ng-container>
</ng-container>
<ng-container *psDataGridFooter>

View File

@ -55,10 +55,18 @@
<button class="btn-info btn" psbxCommandModal [commandTitle]="'Change ' + model.name + ' name'"
commandText="Update" [dataSource]="merchantDataSource" command="changeMerchant" [model]="model"
[template]="theModal">Change</button>
<!-- <button class="btn-danger btn" psbxConfirmModal
[commandTitle]="'Are you sure you wnat to remove ' + model.name + '?'" commandText="Remove"
[dataSource]="merchantDataSource" command="removeMerchant" [model]="model">Remove</button> -->
</div>
<button class="btn-danger btn"
psbxCommand
[dataSource]="merchantDataSource"
command="removeMerchant"
[model]="model"
[confirm]="true"
yesClass="warning"
noClass = "secondary"
noText = "Cancel Delete"
yesText = "Delete It"
confirmMessage="Are you sure you want to delete this merchant?"
>RemoveIt</button></div>
</ng-container>
</ng-container>

View File

@ -34,7 +34,7 @@ export class NgSelectDemoComponent implements OnInit {
this.merchantDataSource3 = merchantService.createDataSource();
this.merchantDataSource4 = merchantService.createDataSource();
this.myForm = fb.group({
'merchantId': [null, null]
'merchantId': [null]
})
}

View File

@ -4,7 +4,7 @@ import { CommonModule } from '@angular/common';
import { PaginationDemoRoutingModule } from './pagination-demo-routing.module';
import { PaginationDemoComponent } from './pagination-demo/pagination/pagination-demo.component';
import { DataGridModule } from '@poweredsoft/ngx-cdk-ui';
import { PaginationModule, CommandModalModule, ConfirmModalModule,SpinnerModule } from '@poweredsoft/ngx-bootstrap';
import { PaginationModule, CommandModalModule, ConfirmModalModule,SpinnerModule, CommandModule } from '@poweredsoft/ngx-bootstrap';
import { FormsModule } from '@angular/forms';
import { ModalModule } from 'ngx-bootstrap/modal';
@ -21,7 +21,8 @@ import { ModalModule } from 'ngx-bootstrap/modal';
CommandModalModule,
ConfirmModalModule,
FormsModule,
SpinnerModule
SpinnerModule,
CommandModule
]
})

View File

@ -16,18 +16,6 @@
<ng-container psDataGridCol="id">
<div *psDataGridColHeader>ID</div>
<div *psDataGridCell="let model">{{model.id}}</div>
<!-- <psfa-ds-sort-icon *psDataGridColSort [sortPath]="id" [dataSource]="merchantDataSource">
</psfa-ds-sort-icon> -->
<!-- <psbx-ds-text-filter *psDataGridCellFilter [dataSource]="merchantDataSource"></psbx-ds-text-filter>
<psdb-ds-date-filter *psDataGridCellFilter></psdb-ds-date-filter>
<psdb-ds-date-range-filter *psDataGridCellFilter></psdb-ds-date-range-filter>
<psbx-ds-number-filter *psDataGridCellFilter></psbx-ds-number-filter>
<psbx-ds-multi-select-filter [dataSource]="merchantDataSource" [selectDataSource]="selectDataSource" [valueField]="id">
<ng-container *psSelectOption="let option">{{ option.name }}</ng-container>
</psbx-ds-multi-select-filter> -->
</ng-container>
<ng-container psDataGridCol="name">
@ -42,8 +30,29 @@
<ng-container psDataGridCol="commands">
<ng-container *psDataGridColHeader>Actions</ng-container>
<ng-container *psDataGridCell="let model">
<!-- <button class="btn-danger btn" psbxConfirmModal [commandTitle]="'Are you sure you wnat to remove ' + model.name + '?'" commandText="Remove"
[dataSource]="merchantDataSource" command="removeMerchant" [model]="model" >Remove</button> -->
<div class="btn-group">
<button class="btn-warning btn" psbxCommandModal
commandTitle="Update {{model.name}}"
commandText="Save"
[dataSource]="merchantDataSource"
command="changeMerchant"
[model]="model"
[template]="theModal">Update</button>
<button class="btn-danger btn"
psbxCommand
[dataSource]="merchantDataSource"
command="removeMerchant"
[model]="model"
[confirm]="true"
yesClass="warning"
noClass = "secondary"
noText = "Cancel Delete"
yesText = "Delete It"
confirmMessage="Are you sure you want to delete this merchant?"
>Remove</button>
</div>
</ng-container>
</ng-container>