3

OK, I am using jqgrid to only display a subset of information.

I want to use a custom button in the nav layer to navigate to a new page where the user can enter a new record.

i.e. I want a button that says (New record" which, when clicked loads a new pagewhich contains my record input form and code.

I can create the bvutton fine, but I can't seem to find the right way to get it to call a function which loads a new page.

Any ideas??

Simon S
  • 217
  • 6
  • 17

2 Answers2

5

I use such a code to add a button to the nav layer:

Html:

<table id='mygrid'> ... </table> <!-- grid -->
<div id='mygrid-panel' class='scroll'></div> <!-- nav layer -->

JS:

$("#mygrid").navButtonAdd('#mygrid-panel', {
  caption: "New record",
  title: "Click here to add new record",
  buttonicon: "ui-icon-plusthick",
  onClickButton: function() {
     // perform something...
  },
  position: "first"
});

Hope I understand you correctly what you want.

Genius
  • 1,784
  • 14
  • 12
  • Fabulous, worked perfectly! The mistake I was making was to put a call to a function in the parameter, not a function itself... Doh!! – Simon S Feb 10 '11 at 12:57
0

Look at the old answer. Probably it is what you need?

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798