I am integrating Syncfusion into my Angular project. Whenever a paging event occurs, I need to retrieve the current page and page size of the grid. Below are the relevant code snippets:
component.html:
<ejs-grid #Grid class="data-grid" (recordDoubleClick)="onDoubleClick($event)" height="55vh" [dataSource]='dataSource'
[allowPaging]="true" [allowResizing]="true" [allowSorting]="true" [allowFiltering]="true"
[pageSettings]='pageSettings' (actionBegin)="onActionBegin($event)">
. . . .
. . . .
</ejs-grid>
component.ts:
//For pagination handling
@ViewChild("Grid")
public grid!:GridComponent;
currentPage: number = 1;
pageSize: number = 50;
onActionBegin(e: any) {
this.currentPage = this.grid.pagerModule.pagerObj.currentPage;
this.pageSize = this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value
console.log(this.pageSize)
}
The issue arises when trying to access dropDownListObject
, which results in an error message stating:
Property 'dropDownListObject' is private and only accessible within class 'PagerDropDown'.
How can I resolve this problem effectively?
(Related link)