Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
// restore paging
if (this.paging && this.gridState.paging) {
if (this.grid.perPage !== this.gridState.paging.recordsPerPage) {
this.grid.perPage = this.gridState.paging.recordsPerPage;
this.grid.cdr.detectChanges();
}
if (this.grid.page !== this.gridState.paging.index) {
this.grid.paginate(this.gridState.paging.index);
}
}
// restore sorting
if (this.sorting && this.gridState.sorting) {
const strategy = DefaultSortingStrategy.instance();
this.gridState.sorting.forEach((expr) => expr.strategy = strategy);
this.grid.sortingExpressions = this.gridState.sorting;
}
// restore selection
if (this.selection && this.gridState.selection) {
this.grid.selectRows(this.gridState.selection);
}
}
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(): void {
this.localdata = SINGERS;
this.hierarchicalGrid.sortingExpressions = [
{ dir: SortingDirection.Asc, fieldName: "Artist",
ignoreCase: true, strategy: DefaultSortingStrategy.instance() }
];
}
public ngAfterViewInit(): void {
public ngOnInit(): void {
this.data = DATA;
this.grid1.sortingExpressions = [
{
dir: SortingDirection.Asc, fieldName: "CategoryName",
ignoreCase: true, strategy: DefaultSortingStrategy.instance()
}
];
}
public ngOnInit(): void {
this.data = DATA;
this.grid1.sortingExpressions = [
{
dir: SortingDirection.Asc, fieldName: "CategoryName",
ignoreCase: true, strategy: DefaultSortingStrategy.instance()
}
];
}
public ngOnInit(): void {
this.data = FOODS_DATA();
this.treegrid1.sortingExpressions = [
{ dir: SortingDirection.Asc, fieldName: "UnitPrice",
ignoreCase: true, strategy: DefaultSortingStrategy.instance() }
];
}
public ngOnInit() {
this.grid1.sortingExpressions = [
{ dir: SortingDirection.Desc, fieldName: "ID",
ignoreCase: true, strategy: DefaultSortingStrategy.instance() }
];
}
constructor() {
this.data = LOCAL_DATA;
this.expr = [
{ dir: SortingDirection.Asc, fieldName: "ShipCountry", ignoreCase: false,
strategy: DefaultSortingStrategy.instance() }
];
this.summaryPositions = [
{
label: GridSummaryPosition.top,
selected: this.summaryPosition === GridSummaryPosition.top,
togglable: true
},
{
label: GridSummaryPosition.bottom,
selected: this.summaryPosition === GridSummaryPosition.bottom,
togglable: true
}
];
this.summaryCalcModes = [
public onChange(event: any) {
if (this.grid1.groupingExpressions.length > 0) {
this.grid1.groupingExpressions = [];
} else {
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()
}
];
}
}
constructor() {
this.data = INVOICE_DATA;
this.expr = [
{ dir: SortingDirection.Asc, fieldName: "ShipCountry", ignoreCase: false,
strategy: DefaultSortingStrategy.instance() }
];
this.summaryPositions = [
{
label: GridSummaryPosition.top,
selected: this.summaryPosition === GridSummaryPosition.top,
togglable: true
},
{
label: GridSummaryPosition.bottom,
selected: this.summaryPosition === GridSummaryPosition.bottom,
togglable: true
}
];
this.summaryCalcModes = [