dataBound: function (args) {
if (flag) {
defaultPageSize = grid.dataSource.length;
grid.pageSettings.pageSize = defaultPageSize;
grid.pagerModule.element.getElementsByClassName("e-dropdownlist")[0].ej2_instances[0].value = "All";
flag = false;
}
},
allowPaging: true,
. . . . . . . . . .
pageSettings: {
pageSizes: [5, 10, 15, 20, 25, "All"]
}
|
hello, I faces the above issue when trying to use the solution proposed above
my workaround was to forcibly access it like this: (not sure this is the right way to do it)
```
```
(let me know if I should create a new thread to cater this issue)
Ronald,
In Syncfusion’s Grid, the pagerModule.element property is internally marked as private in the TypeScript definition to indicate that it’s not part of the public API. As a result, direct access like pagerModule.element is blocked by TypeScript with an error. You can access the element without compile-time errors by using below approach and resolve the problem at your end. Please refer the below code example for more information.
Index.ts
import { DropDownList } from '@syncfusion/ej2-dropdowns'; import { getInstance } from '@syncfusion/ej2-base';
dataBound: function() { if (flag) { . . . . . . . . . . . . . . . . . . . . . . //pass the element and dropdownlist within the getInstance method to get the dropdown instance var dropInstance = getInstance(grid.pagerModule.pagerObj.element.getElementsByClassName("e-dropdownlist")[0] as HTMLElement, DropDownList) as DropDownList; dropInstance.value = "All"; flag = false; } } |
Please get back to us if you need further assistance.
hi, thanks for the clarification and solution
Ronald,
We are happy to hear that the provided solution was helpful. Please get back to us if you need any other assistance.