Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}
}
}
}
// apply the sort...
if (this.sortExpressions.length > 0) {
const adder: (idx: number, cond: SortCondition) => void = table != null
? (i, c) => table.sortSettings.sortConditions().addItem(table.columns(i), c)
: (i, c) => region.worksheet.filterSettings.sortSettings.
sortConditions().addItem(new RelativeIndex(i), c);
let isCaseSensitive: boolean; // = undefined;
for (const sortExp of this.sortExpressions) {
const sortDir = sortExp.dir === SortingDirection.Desc
? SortDirection.Descending : SortDirection.Ascending;
const sortCondition = new OrderedSortCondition(sortDir);
const relIdx = this.fieldIndexMap[sortExp.fieldName];
if (isCaseSensitive === undefined && sortExp.ignoreCase !== undefined) {
isCaseSensitive = sortExp.ignoreCase;
}
adder(relIdx, sortCondition);
}
if (table) {
table.sortSettings.caseSensitive = isCaseSensitive === true;
} else {
region.worksheet.filterSettings.sortSettings.caseSensitive = isCaseSensitive === true;
}
}
}
public ngOnInit() {
this.grid1.sortingExpressions = [{ fieldName: this.groupColumnKey, dir: SortingDirection.Desc }];
this.volumeChanged = this.volumeSlider.onValueChange.pipe(debounce(() => timer(200)));
this.volumeChanged.subscribe(
(x) => {
this.localService.getData(this.volume);
},
(err) => console.log("Error: " + err));
}
public ngOnInit() {
this.grid1.groupingExpressions = [{
dir: SortingDirection.Desc,
fieldName: "Category",
ignoreCase: false,
strategy: DefaultSortingStrategy.instance()
},
{
dir: SortingDirection.Desc,
fieldName: "Type",
ignoreCase: false,
strategy: DefaultSortingStrategy.instance()
},
{
dir: SortingDirection.Desc,
fieldName: "Contract",
ignoreCase: false,
strategy: DefaultSortingStrategy.instance()
}
];
this.volumeChanged = this.volumeSlider.onValueChange.pipe(debounce(() => timer(200)));
this.volumeChanged.subscribe(
(x) => {
this.localService.getData(this.volume);
},
(err) => console.log("Error: " + err));
}
public ngOnInit() {
this.grid1.sortingExpressions = [{ fieldName: this.groupColumnKey, dir: SortingDirection.Desc }];
this.volumeChanged = this.volumeSlider.onValueChange.pipe(debounce(() => timer(200)));
this.volumeChanged.subscribe(
(x) => {
this.localService.getData(this.volume);
},
(err) => console.log('Error: ' + err));
}
public ngOnInit() {
this.grid.sortingExpressions = [
{ dir: SortingDirection.Asc, fieldName: "ContactTitle", ignoreCase: true,
strategy: DefaultSortingStrategy.instance() },
{ dir: SortingDirection.Desc, fieldName: "Country", ignoreCase: true,
strategy: DefaultSortingStrategy.instance() }
];
}
public ngOnInit() {
this.grid1.sortingExpressions = [
{ dir: SortingDirection.Desc, fieldName: "ID",
ignoreCase: true, strategy: DefaultSortingStrategy.instance() }
];
}
public ngOnInit() {
this.grid1.groupingExpressions = [{
dir: SortingDirection.Desc,
fieldName: "Category",
ignoreCase: false,
strategy: DefaultSortingStrategy.instance()
},
{
dir: SortingDirection.Desc,
fieldName: "Type",
ignoreCase: false,
strategy: DefaultSortingStrategy.instance()
},
{
dir: SortingDirection.Desc,
fieldName: "Contract",
ignoreCase: false,
strategy: DefaultSortingStrategy.instance()
}
public ngOnInit() {
if (this.theme) {
document.body.classList.add("fin-dark-theme");
}
this.grid1.sortingExpressions = [{ fieldName: this.groupColumnKey, dir: SortingDirection.Desc }];
}
templateUrl: "./grid-multi-row-layout.component.html"
})
export class GridMultiRowLayoutComponent {
public sourceData = DATA;
public group = [
{
dir: SortingDirection.Asc,
fieldName: "Country",
ignoreCase: false,
strategy: DefaultSortingStrategy.instance()
}
];
public sort = [
{
dir: SortingDirection.Desc,
fieldName: "CompanyName",
ignoreCase: true
}
];
}
private _buildDataUrl(virtualizationArgs: any, sortingArgs: any): string {
let baseQueryString = `${DATA_URL}?$count=true`;
let scrollingQuery = EMPTY_STRING;
let orderQuery = EMPTY_STRING;
let query = EMPTY_STRING;
if (sortingArgs) {
let sortingDirection: string;
switch (sortingArgs.dir) {
case SortingDirection.Asc:
sortingDirection = SortOrder.ASC;
break;
case SortingDirection.Desc:
sortingDirection = SortOrder.DESC;
break;
default:
sortingDirection = SortOrder.NONE;
}
orderQuery = `$orderby=${sortingArgs.fieldName} ${sortingDirection}`;
}
if (virtualizationArgs) {
let requiredChunkSize: number;
const skip = virtualizationArgs.startIndex;
requiredChunkSize = virtualizationArgs.chunkSize === 0 ? 11 : virtualizationArgs.chunkSize;
const top = requiredChunkSize;
scrollingQuery = `$skip=${skip}&$top=${top}`;
}