views:

444

answers:

1

Hi guyz,

I'm trying to add next/prev buttons in the default add in form of a jqgrid. Do you have any idea or example to help me? I could add my own buttons, but I'd like to call the same function as framework to navigate...

Thanks in advance.

Cyril

+2  A: 

The previous/next buttons are explicitly disabled by jqGrid when using the "Add" form.

From the jqGrid source code:

if (rowid=="new") {
  rowid = "_empty";
  p.caption=p.addCaption;
} else {
  p.caption=p.editCaption;
};

...

if(rowid=="_empty") { $("#pData, #nData","#"+frmtb+"_2").hide(); } else { $("#pData, #nData","#"+frmtb+"_2").show(); }

Basically this code hides the buttons ("#pData" and "#nData") if a new row is being added. If you want this functionality on an add form you will have to code it yourself.

You might be able to leverage some of the jqGrid code that is already there for this purpose in Edit mode, although be careful if you go down that route as these buttons must have been disabled for a reason.

Justin Ethier