Change load limited data in member editor in React
13 Sep 20259 minutes to read
Overview
When working with large datasets in the React Pivotview component, loading all field values in the filter dialog’s member editor can cause performance issues. The maxNodeLimitInMemberEditor
property allows you to set a limit on the number of field values displayed initially, improving the loading performance while still providing access to all data through search functionality.
Setting the data limit
The maxNodeLimitInMemberEditor
property determines how many field values are loaded initially in the member editor. By default, this property is set to 1000 items.
When the number of field values exceeds this limit:
- Only the specified number of values will load initially
- A message appears indicating how many additional values are available
- Users can use the search option to find specific values from the complete dataset
This property is available in both pivot table and field list components.
Implementation example
In the following example, the limit of data in the member editor is set to 100. As a result, the member editor for the ProductID
field displays only its first 100 members out of 1000 total members.
import { GroupingBar, Inject, PivotViewComponent } from '@syncfusion/ej2-react-pivotview';
import * as React from 'react';
let date1;
let date2;
function data(count) {
let result = [];
let dt = 0;
for (let i = 1; i < (count + 1); i++) {
dt++;
let round;
let toString = 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),
Price: Math.round(Math.random() * 5000) + 5000,
Sold: Math.round(Math.random() * 80) + 10,
});
if (dt / 4 == 1) {
dt = 0;
}
}
return result;
};
function App() {
let dataSourceSettings = {
dataSource: data(1000),
enableSorting: false,
expandAll: true,
formatSettings: [{ name: 'Price', format: 'C0' }],
rows: [{ name: 'ProductID' }],
columns: [{ name: 'Year' }],
values: [{ name: 'Price', caption: 'Unit Price' }, { name: 'Sold', caption: 'Unit Sold' }]
};
let pivotObj;
return (<PivotViewComponent ref={d => pivotObj = d} id='PivotView' height={350} dataSourceSettings={dataSourceSettings} showGroupingBar={true} maxNodeLimitInMemberEditor={100}><Inject services={[GroupingBar]}/></PivotViewComponent>);
};
export default App;
import { GroupingBar, IDataSet, Inject, PivotViewComponent } from '@syncfusion/ej2-react-pivotview';
import { DataSourceSettingsModel } from '@syncfusion/ej2-pivotview/src/model/datasourcesettings-model';
import * as React from 'react';
let date1: number;
let date2: number;
function 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),
Price: Math.round(Math.random() * 5000) + 5000,
Sold: Math.round(Math.random() * 80) + 10,
});
if (dt / 4 == 1) {
dt = 0;
}
}
return result;
};
function App() {
let dataSourceSettings: DataSourceSettingsModel = {
dataSource: data(1000),
enableSorting: false,
expandAll: true,
formatSettings: [{ name: 'Price', format: 'C0' }],
rows: [{ name: 'ProductID' }],
columns: [{ name: 'Year' }],
values: [{ name: 'Price', caption: 'Unit Price' }, { name: 'Sold', caption: 'Unit Sold' }]
}
let pivotObj: PivotViewComponent;
return (<PivotViewComponent ref={ (d: PivotViewComponent) => pivotObj = d } id='PivotView' height={350} dataSourceSettings={dataSourceSettings} showGroupingBar={true} maxNodeLimitInMemberEditor={100}><Inject services={[GroupingBar]}/></PivotViewComponent>);
};
export default App;