views:

148

answers:

2

Hi, how can i get the action (what button was clicked) when a button is clicked in the pager?(edit, del, add...)

A: 

You probably means button of the navigation bar or navigator (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:navigator).

You can implement what you want with at least three different ways:

  1. You define your custom buttons which look like the original add/edit/del buttons (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_buttons) and use {add:false, edit: false, del: off} parameter of navGrid to switch off standard buttons.
  2. You can use addfunc, editfunc and delfunc if you want replace the default add/edit/del functions.
  3. You can use onclickSubmit or afterSubmit or some another supported events (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:form_editing#events) of add/edit/del button to do some additional action on click the buttont or on submit.

You can chose the way which is the best for your requirements.

Oleg
A: 

You can use the grid onPaging event:

This event fires after click on [page button] and before populating the data. Also works when the user enters a new page number in the page input box (and presses [Enter]) and when the number of requested records is changed via the select box. To this event we pass only one parameter pgButton (string) which can be - first,last,prev,next in case of button click, records in case when a number of requested rows is changed and user when the user change the number of the requested page.requested page.

Marcus