0

I am using Jqgrid version 4.4.0. My grid is little complex grid with inline editing. on select of row I make row editable based on condition. Below is the code for making row editable.

$("#list1").jqGrid('editRow', id, true, null,null,null,null, successfunc );

In the grid's navbutton I have "View record" button. On click of view button, View form shows all the field. View records gives option to edit editable fields. I want to restrict user view only here rather editing. When I searched jqgrid wiki it shows no Events are associated with this "View Records" button. I also tried to customize using beforeShowForm: function(formid){}. But no luck. Please suggest how to achieve this ? Thanks in advance.

Jake1164
  • 12,291
  • 6
  • 47
  • 64
Shrikant
  • 1
  • 1
  • 3

1 Answers1

1

You can use beforeShowForm with "View" button from the navigator button. See examples here for example.

Moreover I would recommend you to use parameters of editRow in object form:

$("#list1").jqGrid('editRow', id, {
    keys: true,
    successfunc: successfunc
});

It makes the code more readable in my opinion because one don't need cont the position of every parameter.

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