Pager update when changing the result per page.
Using the following code to show the maximum number of pages:
div class="CoveoPager pagination" data-number-of-pages="10"
If I use a custom control (radio button or dropdown) to allow my users to select the results returned per pages, how do I make sure that the pager gets adjusted?
So for example, I have two pages with 50 results on each. If the user chooses 100, I want the pager to show only one page, not two.
The value from the attribute is only read at initialization time, and even though it's sometimes possible to directly change the options afterwards by accessing the component directly, it's not officially supported to do so. In this particular case, the internal implementation takes a copy of the option value so you cannot change it once the UI is initialized.
Hence, the best way to achieve the result you're looking for would be to arrange for the user value to be put in the attribute before the UI is initialized (using server side code or JS code before 'init'). When a user changes his preference, you should reload the page in the browser.