diff --git a/src/app/grid-filter/date-filter/date-filter.component.ts b/src/app/grid-filter/date-filter/date-filter.component.ts
index b746175..e526432 100644
--- a/src/app/grid-filter/date-filter/date-filter.component.ts
+++ b/src/app/grid-filter/date-filter/date-filter.component.ts
@@ -30,7 +30,7 @@ export class DateFilterComponent extends BaseFilterCellComponent implements OnI
if ( this.range > this.end ){
this.range = this.end;
}
- this.date = new Date();
+ this.date = null;
}
private rangeBetween(start: number, end: number): number[] {
@@ -55,7 +55,6 @@ export class DateFilterComponent extends BaseFilterCellComponent implements OnI
this.debouncedDoFilter().then();
}
public onRangeChange(r: number): void {
- console.log(this.date, r);
this.debouncedDoFilter().then();
}
@@ -89,17 +88,16 @@ export class DateFilterComponent extends BaseFilterCellComponent implements OnI
const fs: FilterDescriptor[] = [];
const start: Date = new Date(this.date); start.setDate(this.date.getDate() - this.range);
const end: Date = new Date(this.date); end.setDate(this.date.getDate() + this.range);
- console.log(new Date(start), new Date(end));
fs.push({
field: this.fieldName,
operator: 'gte',
- value: start.getTime()
+ value: start.getTime() / 1000
});
fs.push({
field: this.fieldName,
operator: 'lte',
- value: end.getTime()
+ value: end.getTime() / 1000
});
this.removeFilter(this.fieldName);
const root: CompositeFilterDescriptor = this.filter || { logic: 'and',
diff --git a/src/app/grid-filter/number-range-filter/number-range-filter.component.ts b/src/app/grid-filter/number-range-filter/number-range-filter.component.ts
index 0187ac1..0049abe 100644
--- a/src/app/grid-filter/number-range-filter/number-range-filter.component.ts
+++ b/src/app/grid-filter/number-range-filter/number-range-filter.component.ts
@@ -84,11 +84,11 @@ export class NumberRangeFilterComponent extends BaseFilterCellComponent implemen
}
private initAvailableOperators(): void {
- this.availableOperators = this.AllOperatorMap.filter( v => {
- // console.log(v, this.options.indexOf(v.value), this.options);
- return this.options.indexOf(v.value) !== -1;
- } );
- if ( this.availableOperators.length === 0) {
+ this.availableOperators = [];
+ const self = this;
+ this.options.forEach( v => this.availableOperators.push(self.getOp(v)) );
+
+ if ( this.availableOperators.length <= 0) {
this.availableOperators = [this.defaultOperator];
this.operator = this.defaultOperator;
}else{
@@ -97,6 +97,16 @@ export class NumberRangeFilterComponent extends BaseFilterCellComponent implemen
this.singleMode = this.operator.value !== 'range';
}
+ private getOp(key: string): Operator {
+ let ret: Operator;
+ this.AllOperatorMap.every( v => {
+ if ( v.value === key ) {
+ ret = v;
+ }
+ return v.value !== key;
+ });
+ return ret;
+ }
//
// Events handling
diff --git a/src/app/grid-filter/string-filter/string-filter.component.ts b/src/app/grid-filter/string-filter/string-filter.component.ts
index 53cfe2f..8aa86f0 100644
--- a/src/app/grid-filter/string-filter/string-filter.component.ts
+++ b/src/app/grid-filter/string-filter/string-filter.component.ts
@@ -30,7 +30,7 @@ export class StringFilterComponent extends BaseFilterCellComponent implements On
this.removeFilter(this.fieldName) :
this.updateFilter({
field: this.fieldName,
- operator: 'eq',
+ operator: 'contains',
value: v
})
);
diff --git a/src/app/list-income/list-income.component.html b/src/app/list-income/list-income.component.html
index fc634d8..f4a3a07 100644
--- a/src/app/list-income/list-income.component.html
+++ b/src/app/list-income/list-income.component.html
@@ -4,6 +4,7 @@
[showLoanColumn]="true"
[showUploadColumn]="true"
[LoadDataNow]="startLoad"
+ [allowFilter]="true"
>
diff --git a/src/app/pay-in/pay-in.component.html b/src/app/pay-in/pay-in.component.html
index 9eec4ab..2893048 100644
--- a/src/app/pay-in/pay-in.component.html
+++ b/src/app/pay-in/pay-in.component.html
@@ -5,7 +5,7 @@
[pageSize]="filter.Take"
[skip]="filter.Skip"
[sortable]="sortable"
- [filterable]="allowFilter"
+ [filterable]="filterable"
[loading]="loading"
[sort]="filter.Sort"
@@ -39,8 +39,8 @@
0 " class="badge badge-pill badge-primary specific-upload"> {{uploadMeta.Id}}
0 " class="badge badge-secondary specific-upload"> {{uploadMeta.FileName}}
-
+
@@ -90,7 +90,7 @@
@@ -140,7 +140,7 @@
@@ -171,7 +171,7 @@
diff --git a/src/app/pay-in/pay-in.component.ts b/src/app/pay-in/pay-in.component.ts
index 9fa1fae..9b5cd9b 100644
--- a/src/app/pay-in/pay-in.component.ts
+++ b/src/app/pay-in/pay-in.component.ts
@@ -12,7 +12,7 @@ import {
RowClassArgs,
SortSettings,
DataStateChangeEvent,
- SelectableSettings
+ SelectableSettings, PagerSettings
} from '@progress/kendo-angular-grid';
import {CompositeFilterDescriptor, FilterDescriptor, SortDescriptor} from '@progress/kendo-data-query';
import {UploadMetaModel} from '../models/uploadMetaModel';
@@ -57,10 +57,16 @@ export class PayInComponent implements OnInit {
public showBalance = true;
public showOffsetBalance = true;
- @Input() public pageable = true;
+ @Input() public pageable: PagerSettings = {
+ pageSizes: [2, 5, 10, 15, 20, 30, 40, 50, 100],
+ previousNext: true
+ };
@Input() public pageSize = 15;
@Input() public Selection: number[] = [];
+
+ public pageSizeOptions = [2, 5, 10, 15, 20, 30, 40, 50, 100];
+ public filterable: boolean;
public sortable: SortSettings = {
mode: 'single'
};
@@ -345,6 +351,7 @@ export class PayInComponent implements OnInit {
public pageChange(event: PageChangeEvent): void {
this.filter.Skip = event.skip;
+ this.filter.Take = event.take;
// this.loadFilteredData();
}
@@ -355,11 +362,12 @@ export class PayInComponent implements OnInit {
public filterChange( filter: CompositeFilterDescriptor): void {
// console.log (filter, this.state.filter);
+ this.filter.Skip = 0;
}
public dataStateChange(state: DataStateChangeEvent): void {
this.state = state;
+ console.log(state);
this.loadFilteredPayInList();
- console.log(state, this.state);
}
public onLoanChange(loan: LoanModel): void {
@@ -422,4 +430,12 @@ export class PayInComponent implements OnInit {
});
return found;
}
+
+ public onFilterEnable(filtering: boolean): void {
+ if ( ! filtering ) {
+ this.state.filter = { logic: 'and', filters: [] };
+ this.state.skip = 0;
+ this.loadFilteredPayInList();
+ }
+ }
}