Search results

How To

15 Oct 2021 / 2 minutes to read

Member Editor

Load limited data in Member Editor

In the filter dialog, user can set the limit to display field values while loading the large data. Based on this limit, the initial loading will complete quickly without any performance constraint. And user can use search option to refining the field values from exceeded limit. You can refine the data further by using search option and a message with the remaining data count will be displayed in member editor. The data limit can be set in the property maxNodeLimitInEditor.

By default, the property holds the value 1000.

The property is available in both Pivot Grid and Field List components.

In the below example, the data in the member editor limits to 100. So, the member editor of the field ProductID shows only its first 100 members from its 1000 members.

Source
Preview
app.component.ts
app.module.ts
Copied to clipboard
import { Component, OnInit } from '@angular/core';
import { IDataOptions, PivotView, VirtualScrollService, GroupingBarService } from '@syncfusion/ej2-angular-pivotview';

@Component({
  selector: 'app-container',
  providers: [VirtualScrollService, GroupingBarService],
  template: `<ejs-pivotview #pivotview id='PivotView' [dataSource]=dataSource showGroupingBar='true 'enableVirtualization='true' maxNodeLimitInEditor='100' width='710' height='260'></ejs-pivotview>`
})

export class AppComponent implements OnInit  {
public dataSource: IDataOptions;
public date1: number;
public date2: number;
data(count: number) {
  let result: Object[] = [];
  let dt: number = 0;
  for (let i: number = 1; i < count + 1; i++) {
dt++;
let round: string;
let toString: string = i.toString();
if (toString.length === 1) {
  round = "0000" + i;
} else if (toString.length === 2) {
  round = "000" + i;
} else if (toString.length === 3) {
  round = "00" + i;
} else if (toString.length === 4) {
  round = "0" + i;
} else {
  round = toString;
}
result.push({
  ProductID: "PRO-" + round,
  Year: "FY " + (dt + 2013),
  Sold: Math.round(Math.random() * 80) + 10
});
if (dt / 4 == 1) {
    dt = 0;
}
  }
  return result;
}
ngOnInit(): void {
    this.dataSource = {
    data: this.data(1000) as IDataSet[],
    enableSorting: false,
    rows: [{ name: 'ProductID' }],
    columns: [{ name: 'Year' }],
    values: [{ name: 'Sold', caption: 'Unit Sold' }]
    };
}
}
Copied to clipboard
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { PivotViewAllModule, PivotFieldListAllModule } from '@syncfusion/ej2-angular-pivotview';
import { AppComponent } from './app.component';

/**
 * Module
 */
@NgModule({
    imports: [
        BrowserModule,
        PivotViewAllModule,
        PivotFieldListAllModule
    ],
    declarations: [AppComponent],
    bootstrap: [AppComponent]
})
export class AppModule { }