File
Constructor
constructor(values: literal type)
|
|
Parameters :
Name |
Type |
Optional |
values |
literal type
|
No
|
|
ignoredValue
|
Type : string
|
Default value : null
|
|
operator
|
Type : string
|
Default value : null
|
|
property
|
Type : string
|
Default value : null
|
|
value
|
Type : string
|
Default value : null
|
|
valueObservable
|
Type : Subject<any>
|
|
Methods
getUrlFragment
|
getUrlFragment()
|
|
|
setParent
|
setParent(parent: any)
|
|
Parameters :
Name |
Type |
Optional |
parent |
any
|
No
|
|
import { Subject } from 'rxjs';
export class FilterDescriptor {
getUrlFragment(): string {
let result = '';
if (
this.value != this.ignoredValue &&
typeof this.value !== 'undefined' &&
this.operator == 'IsGreaterThanOrEqualTo' &&
this.property
) {
result = `(it.${this.property}.CompareTo(${this.value}) >= 0)`;
}
return result;
}
setParent(parent: any): any {
if (this.valueObservable) {
this.valueObservable.subscribe((value) => {
this.value = value;
if (this.value != this.ignoredValue) {
parent.performLoad();
}
});
}
}
property: string = null;
operator: string = null;
ignoredValue: string = null;
value: string = null;
valueObservable: Subject<any>;
constructor(values: {
property?: string;
operator?: string;
ignoredValue?: string;
value?: string;
valueObservable?: Subject<any>;
}) {
if (values.property !== undefined) {
this.property = values.property;
}
if (values.operator !== undefined) {
this.operator = values.operator;
}
this.ignoredValue = values.ignoredValue || '';
if (values.value == undefined) {
this.value = values.value;
}
if (values.valueObservable !== undefined) {
this.valueObservable = values.valueObservable;
}
}
}
export class SortDescriptor {
getUrlFragment(): string {
let result = '';
if (typeof this.property !== 'undefined') {
result = `it.${this.property}`;
}
return result;
}
property: string = null;
direction: string = null;
constructor(values: { property?: string; direction: string }) {
if (values.property !== undefined) {
this.property = values.property;
}
if (values.direction !== undefined) {
this.direction = values.direction;
}
}
}