0

Is there any way, in jqgrid, to redefine the function to call when the "add" button of the navgrid?

The only thing I've found is to add a new button redefining "onclickbutton" property , and I've looked at code, but I think that is impossible, isn't it?

Thanks in advance,

Community
  • 1
  • 1
Marc
  • 1,359
  • 1
  • 15
  • 39

1 Answers1

2

In the code which you referenced you can find the line of code. So is you defines addfunc option of navGrid you can implement your own implementation of "Add" button.

Alternatively you can just use add: false option of navGrid and then uses navButtonAdd to add your custom button which looks exactly like "Add" button.

Oleg
  • 220,925
  • 34
  • 403
  • 798
  • Thanks, I had implemented the second option, but now I'll try the first one and I'll say something. – Marc Oct 10 '12 at 13:42
  • @Marc: You are welcome! It's important to place `addfunc` option in the correct place as `navGrid`: it should be in the same object where `edit: true` are defined: see `parameters` part of [navGrid](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:navigator#definition) options (really `parameters` part and not `prmAdd` part of the options). – Oleg Oct 10 '12 at 13:54