Hi, how can i get the action (what button was clicked) when a button is clicked in the pager?(edit, del, add...)
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:
- 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 ofnavGrid
to switch off standard buttons. - You can use
addfunc
,editfunc
anddelfunc
if you want replace the default add/edit/del functions. - You can use
onclickSubmit
orafterSubmit
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.
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.