0

I have the following code

editOptions: {
    beforeShowForm: function () {
        var myGrid = $('#list'),
        selRowId = myGrid.jqGrid('getGridParam', 'selrow'),
        IsIssued = myGrid.jqGrid('getCell', selRowId, 'Status');
        // alert(IsIssued);
        if (IsIssued == 'true') {
            alert("asd")
            return [false];
        }
        else
            return [true, "ll"];
    },

I want that if the

(IsIssued == 'true')

then do not show the Edit Form. Is it possible? Because it is always showing me the Edit form.

Oleg
  • 220,925
  • 34
  • 403
  • 798
Mir Gulam Sarwar
  • 2,588
  • 2
  • 25
  • 39

1 Answers1

2

The answer describes how you can close Add/Edit form directly after it will be opened. You can use either beforeShowForm or afterShowForm in the same way because both have no direct way to deny opening of the form.

In my opinion you should consider other options which could be more understandable from the point of view of the user. You can disable Edit button of the navigator bar on selection of rows which should be not editing. The demo from the old answer demonstrates the approach. Alternatively you can hide Edit button on selection of the rows which should be non-editable. The demo from the answer demonstrates this.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • thanks Oleg.It works and i have been searching for you before.Could u please look at my this question http://stackoverflow.com/questions/19630241/jqgrid-multiselect-column-loading-data-from-server – Mir Gulam Sarwar Nov 13 '13 at 09:53
  • @janina: You are welcome! Sorry, but I'm busy now - I have to do my main job. :-) Probably later... – Oleg Nov 13 '13 at 10:03
  • Ok...But please look at it later.I think only you can solve that problem – Mir Gulam Sarwar Nov 13 '13 at 10:24