📅  最后修改于: 2023-12-03 14:43:24.044000             🧑  作者: Mango
The pagesizeoptions
property in jQWidgets jqxGrid specifies an array of possible page sizes that can be selected by the user.
$('#jqxgrid').jqxGrid({
pagesizeoptions: ['10', '20', '50']
});
The pagesizeoptions
property should be an array of string values representing the possible page sizes. When the user clicks on the page size drop-down list, they will see these values as options.
$('#jqxgrid').jqxGrid({
pagesize: 10,
pagesizeoptions: ['5', '10', '20', '50'],
pageable: true,
autoheight: true,
source: dataAdapter,
columns: [
{ text: 'Name', datafield: 'name', width: '30%' },
{ text: 'Age', datafield: 'age', width: '30%' },
{ text: 'Address', datafield: 'address', width: '40%' }
]
});
In the above code snippet, the pagesizeoptions
property defines four size options (5, 10, 20, and 50) that the user can select from.
pagesizeoptions
array must be in string format.pagesizeoptions
array must be sorted in ascending order.pagesizeoptions
property is optional. If it is not specified, the page size drop-down list will be hidden.pagesizeoptions
property is specified, but the pageable
property is set to false
, the page size drop-down list will be shown but will not have any effect.The pagesizeoptions
property in jQWidgets jqxGrid allows the user to select the number of records displayed on each page. It provides the user with the flexibility to choose from a set of predefined page sizes.