Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
Pager Size rendered event listener?
posted

I have the following grid rendering with a pager:

and I'm wondering if you have any advice on listening for the page size combo box (outlined in red) being rendered? I have it being rendered with the following settings:

...
features: [
    ...
    {
        recordCountKey: 'TotalRecordsCount',
        pageIndexUrlKey: 'page',
        pageSizeUrlKey: 'pageSize',
        name: 'Paging',
        pageSize: 100,
        type: 'remote',
        pageCountLimit: 50,
        currentPageIndex: 0,
        pageSizeList: [ 5, 10, 20, 25, 75, 100 ],
        totalRecordsCount: 0
    },
    ...
],
...

I tried giving the grid's "rendered" parameter a method and then tried retrieving the combo box there, but the combo box is not yet rendered by that stage. The same goes for the "iggridpagingpagerrendered" event; this only seems to trigger when the paging footer is rendered (the footer containing the next/prev buttons in the screenshot above) but, again, the combo box is not rendered by this stage.

Any help would be appreciated. Thanks in advance!

Parents
  • 700
    Offline posted

    Hello Taylor,

    Thank you for posting in our community!

    I have been looking into your question and it seems that the attached image is not displayed.

    If you refer to the drop-down that changes the page size, what I could suggest is using the document ready function:

    $(document).ready(function () {
        const combo = document.querySelector(".ui-iggrid-pagesizedropdown");
        console.log(combo);
    });

    If you refer to the drop-down that changes the page index, what I would suggest is using the pagerRendered event:

    {
        recordCountKey: "TotalRecordsCount",
        pageIndexUrlKey: "page",
        pageSizeUrlKey: "pageSize",
        name: "Paging",
        pageSize: 100,
        type: "local",
        pageCountLimit: 50,
        currentPageIndex: 0,
        pageSizeList: [5, 10, 20, 25, 75, 100],
        totalRecordsCount: 0,
        pagerRendered: function (evt, ui) {
            const combo = document.querySelector('.ui-iggrid-pagedropdowncontainer div.ui-igedit');
            console.log(combo);
        },
    },

    Please test these approaches and let me know if you need any further assistance regarding this matter.

    Sincerely,
    Riva Ivanova
    Software Developer

Reply Children