Author Topic: Event during Paginatin Row Per Page Dropdown Change  (Read 2285 times)

Akihiro Inoue

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 32
    • View Profile
Event during Paginatin Row Per Page Dropdown Change
« on: August 30, 2017, 11:28:48 am »
Dear Team,

Thank you for your support.

In case if user change the Row Per Page Dropdown (Remote Pagination)

We need to get a confirmation (Yes/No) from user to proceed or Not. (This use case is required for certain scenarios)

Incase if yes, should be able to proceed and if no, should stop the process(should not change RPP).

Please suggest me an API to use for this use case.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Event during Paginatin Row Per Page Dropdown Change
« Reply #1 on: August 30, 2017, 12:16:04 pm »
Please use beforeChange event of pager:

Code: [Select]
        grid.pager().on("beforeChange", function (evt, ui) {
            if ( ui.rPP ) {               
                if ( !window.confirm("Are you sure?") ) {
                    return false;
                }
            }
        });

jeeva

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Event during Paginatin Row Per Page Dropdown Change
« Reply #2 on: September 06, 2017, 10:45:57 am »
Dear Support,

Its working fine. Thank you so much. Pagination dropdown, next and previous. How to fix enter text box in pagination and refresh button action for the same.

Thanks

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Event during Paginatin Row Per Page Dropdown Change
« Reply #3 on: September 06, 2017, 03:22:20 pm »
ui.curPage is defined when page number is changed.

https://paramquery.com/pro/api/pager#event-beforeChange

beforeRefresh event is fired when refresh button is clicked.

https://paramquery.com/pro/api/pager#event-beforeRefresh