0

Edit action button is added to jqGrid row using code below. After editing if Save action button is clicked, nothing happens, Save button remains active. Save takes some time and it looks like click is ignored. Users clicks save button again and again.

How to provide immediate feedback after Save button is clicked and before save is finished: change save button icon to saving animation, remove possibility to click it again, show saving message ? jqueryUI is used.

colModel: [{"fixed":true,"label":" change ","name":"_actions","width":($.browser.webkit == true? 37+15: 32+15)
    ,"align":"center","sortable":false,"formatter":"actions",
"formatoptions":{"keys":true,"delbutton":false,"onSuccess":function (jqXHR) {actionresponse = jqXHR;return true;}
    ,"afterSave":function (rowID) {
    cancelEditing($('#grid'));afterRowSave(rowID,actionresponse);actionresponse=null; }
    ,"onEdit":function (rowID) {
      if (typeof (lastSelectedRow) !== 'undefined' && rowID !== lastSelectedRow)
        cancelEditing($('#grid'));
        lastSelectedRow = rowID;
        }
    }}

Update

FireFox makes grid inactive (grays out) properly if saved in both ways in inline edit without any code. So it seems like IE issue.

How to gray out jqGrid in IE 9 also ?

Andrus
  • 26,339
  • 60
  • 204
  • 378

1 Answers1

1

If I understand you correct your problem is not problem of 'actions' formatter. The same problem you have in inline editing if the user just press "Enter" and the row should be saved on the server. There are no direct event which will be fire before the ajax request to the server.

Nevertheless there are different indirect possibilities to receive control and to display the "Saving..." message for the user. The simplest way is to use serializeRowData to display the message. You should not forget to close the "Saving..." div in both errorfunc and successfunc methods.

Oleg
  • 220,925
  • 34
  • 403
  • 798
  • thank you. I updated question about implementing FF behaviour in IE. Maybe it is possible to use it. I also tried to use stadard jqUery ajax show/hide events by method to those properties using ajaxOptions in to `jQuery.extend(jQuery.jgrid.defaults` but those events are not fired. – Andrus Sep 07 '11 at 10:54
  • @Andrus: You asked in your question to provide "immediate feedback" for some kind of "saving animation". It's not the same as with `loadui: "block"`. You should examine your code for some manipulation with `"#lui_"+$t.p.id` div which you could do. – Oleg Sep 07 '11 at 11:06
  • I'm sorry for unclear question. I added better question to http://stackoverflow.com/questions/7333943/how-to-gray-out-jqgrid-in-save-in-inline-edit-in-ie-like-firefox-does . – Andrus Sep 07 '11 at 12:34