2

I use jqGrid in my webpage. Can anyone help me to perform any action when each time the navigator buttons clicked in the navigator of the gird? also when entering the page number in the page number textbox. I tried using onPaging: function(), but I am not sure how to use it as I am new to this jqGrid. Thank you in advance.

I need to perform the action once the grid is loaded with data completely after clicking on any of the navigator buttons. for example,

    alert("Hi there!!");

I need to perform. glad to get idea from Someone...

Matt
  • 25,467
  • 18
  • 120
  • 187
yuva 443
  • 163
  • 1
  • 2
  • 11

1 Answers1

1

If you need to execute some action after "the grid is loaded with data completely" then you should use loadComplete callback instead of onPaging. If the page will be changed the grid will be reloaded and loadComplete callback will be called at the end.

Oleg
  • 220,925
  • 34
  • 403
  • 798
  • thank you for the answer Oleg..but as I mentioned I am new to this jqGrid; it will be helpful if you can let me know some code wise example for the 'loadComplete' action which will be performed exactly after everytime the next/previous button is clicked and the grid is loaded with data completely. Thank you again, Oleg.! – yuva 443 Jun 17 '13 at 13:25
  • @yuva443: You are welcome! Look at [the demo](http://www.ok-soft-gmbh.com/jqGrid/SelectiveSubGridNotRowId.htm) from [the answer](http://stackoverflow.com/a/4538656/315935) for example. In general **there are no difference between loading the grid and the loading of the next grid of the page**. `loadComplete` callback will be called just after every loading. Initial loading is also loading of one page (the page number 1). – Oleg Jun 17 '13 at 13:44
  • Thanks a lot Oleg; I am almost done with your help now. Actually before you posted this answer I referred another answer of yours which was about onMouseover action in the grid. My work has to be completed all with the clicks inside the grid; hence I utilized that one!! ;) I'll try this one also..thankz again..from now I will ask you only whatever doubts am getting in programming..!! :P have a great day, Oleg.. – yuva 443 Jun 17 '13 at 15:38
  • @yuva443: You are welcome! Sorry, but I don't understand from your last comment what is your current problem. Could you reformulate your question (your current problem) more clear? – Oleg Jun 17 '13 at 17:28
  • I mean all set for now, Oleg; no problems; thank you !! and I mean that YOU ARE GREAT!! – yuva 443 Jun 17 '13 at 17:48
  • @Oleg What if the loadonce is true? – Deepak Mishra Aug 21 '17 at 11:11
  • @DeepakMishra: Could you describe more details what you mean? What scenario you try to implement? Which version of jqGrid you use and from which fork of jqGrid ([free jqGrid](https://github.com/free-jqgrid/jqGrid), commercial [Guriddo jqGrid JS](http://guriddo.net/?page_id=103334) or an old jqGrid in version <=4.7)? It's unclear for me what you want to do `onPaging` or *after* the page is loaded or updated. – Oleg Aug 21 '17 at 11:23