text-filter working
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<h2>grid-filter-demo works!</h2>
|
||||
<psbx-datetime-filter></psbx-datetime-filter>
|
||||
<button class="btn btn-danger" (click)="test()">Test</button>
|
||||
|
||||
|
||||
<ps-data-grid [dataSource]="merchantDataSource" [(columns)]="columns"
|
||||
tableClasses="table table-sm table-dark table-striped table-bordered">
|
||||
@@ -10,11 +10,12 @@
|
||||
[dataSource]="merchantDataSource" command="addMerchant" [template]="theModal">Create Record</button>
|
||||
</ng-container>
|
||||
|
||||
<psbx-ds-text-filter *psDataGridCellFilter [dataSource]="merchantDataSource" (filteredResults)="filteredResults = $event"></psbx-ds-text-filter>
|
||||
|
||||
|
||||
<ng-container psDataGridCol="id">
|
||||
<div *psDataGridColHeader>ID</div>
|
||||
<div *psDataGridCell="let model">{{model.id}}</div>
|
||||
<psbx-ds-text-filter *psDataGridCellFilter [dataSource]="merchantDataSource" (onFilter)="filterMerchants($event)" ></psbx-ds-text-filter>
|
||||
<!-- <psfa-ds-sort-icon *psDataGridColSort [sortPath]="id" [dataSource]="merchantDataSource">
|
||||
|
||||
</psfa-ds-sort-icon> -->
|
||||
|
||||
@@ -20,6 +20,7 @@ export class GridFilterDemoComponent implements OnInit {
|
||||
|
||||
pages:any;
|
||||
filteredResults:any;
|
||||
somefilter:any;
|
||||
|
||||
createDataSource(): IDataSource<IMerchant> {
|
||||
return this.merchantService.createDataSource();
|
||||
@@ -28,9 +29,12 @@ export class GridFilterDemoComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.merchantDataSource.refresh();
|
||||
|
||||
}
|
||||
|
||||
test(){
|
||||
console.log(this.filteredResults);
|
||||
filterMerchants(event){
|
||||
this.somefilter = event;
|
||||
this.merchantDataSource.filters[0]=this.somefilter;
|
||||
this.merchantDataSource.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user