Search results

How To

06 Jun 2023 / 2 minutes to read

Member Editor

Load limited data in Member Editor

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

By default, the property holds the value 1000.

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

In the following example, the limit of data in the member editor is set to 100. So, the member editor of the ProductID field shows only its first 100 members from its 1000 members.

Source
Preview
index.ts
index.html
Copied to clipboard
import { PivotView, VirtualScroll, GroupingBar, IDataSet } from '@syncfusion/ej2-pivotview';

let data: Function = (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;
};

PivotView.Inject(VirtualScroll, GroupingBar);
let pivotGridObj: PivotView = new PivotView({
dataSource: {
    data: data(1000) as IDataSet[],
    enableSorting: false,
    rows: [{ name: 'ProductID' }],
    columns: [{ name: 'Year' }],
    values: [{ name: 'Sold', caption: 'Unit Sold' }]
},
width: 710,
height: 260,
enableVirtualization: true,
showGroupingBar: true,
maxNodeLimitInEditor: 100
});

pivotGridObj.appendTo('#PivotGrid');
Copied to clipboard
<!DOCTYPE html>
<html lang="en">

<head>
            
    <title>EJ2 Pivot Grid</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript Pivot Grid Control" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-base/styles/material.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-buttons/styles/material.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-calendars/styles/material.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-dropdowns/styles/material.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-grids/styles/material.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-inputs/styles/material.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-lists/styles/material.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-navigations/styles/material.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-popups/styles/material.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-pivotview/styles/material.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>

<body>
    <div id='loader'>Loading....</div>
    <div id='container'>
        <div>
            <div id='PivotGrid'></div>
        </div>
    </div>
</body>

</html>