Hi,
I am trying to allow the user to dynamically change the number of records per page.
I have followed this thread: https://www.syncfusion.com/forums/116047/allowing-user-to-select-number-of-records-per-page
But receive an error on the code in the debugging console.
Code:
$('#pageSettings').on('change', function (sender) {
var model = $("#RowSelection").ejGrid("model"); //Will be called when a value is selected in dropdown
var model1 = $("#RowSelection").ejGrid("getGridPager").ejPager("model");
var newLastPage = Math.ceil(model.pageSettings.totalRecordsCount / sender.value);
if (model1.currentPage > newLastPage)
$("#RowSelection").ejGrid("getGridPager").ejPager("goToPage", newLastPage);
$("#RowSelection").ejGrid({ "pageSettings": { pageSize: parseInt(sender.value) } }); //Setting the new page size
renderDrop();
});
The error:
Uncaught ej.Grid: function/property - getGridPager does not exist
Error: ej.Grid: function/property - getGridPager does not exist
at t.throwError (http://localhost:3082/Scripts/ej/ej.web.all.min.js:10:26895)
at jQuery.fn.init.n.fn.(anonymous function) [as ejGrid] (http://localhost:3082/Scripts/ej/ej.web.all.min.js:10:21451)
at HTMLSelectElement.<anonymous> (http://localhost:3082/Anatomy/ViewLinkedItems?includePartials=true&includeP…owSelectiondatetime_CustomDrop2=&RowSelectiondatetime_CustomValue2=:320:45)
at HTMLSelectElement.dispatch (http://localhost:3082/Scripts/jquery-2.2.4.js:4737:27)
at HTMLSelectElement.elemData.handle (http://localhost:3082/Scripts/jquery-2.2.4.js:4549:28)
Also I am unsure of the function renderDrop()
The other thread does not show its implementation.
Thanks,
N. Jamieson