[jQuery] Re: jqGrid inline edit - cannot save or cancel if only one row

2008-09-08 Thread nelsonmichael

Thanks Tony, that seems to work.

I also switched to using the double click handler and cleared the last
selected value if they double click the same row to save their
changes.

ondblClickRow: function(id) {
  if (id) {
var grid = jQuery('#grid');
if(id !== lastsel) {
  grid.saveRow(lastsel)
.editRow(id, true);
  lastsel = id;
}
else {
  grid.saveRow(lastsel);
  lastsel = -1;
}
  }
},

- Michael

On Sep 4, 12:20 am, Tony [EMAIL PROTECTED] wrote:
 Hello,
 I do not think so.
 This behavior is from a onSelectRow event.
 In the example page it check for the current and last selected row.
 If you have only one row this is really true. To overcome this we
 should change a logic in
 onSelectRow something like:
 var last_selected_row;
 

 onSelectRow : function(row_id){
    if(row_id != null) {
       if(row_id == last_selected_row) {
           // do here what you want
       } else {
          // do other things here or maybe edit it
          jQuery(...).editRow(row_id, true);
       }
    }

 }

 It is your chioce to do what you want.

 Best Regards
 Tony
 On Sep 4, 1:46 am, Michael Nelson [EMAIL PROTECTED] wrote:

  Hello,

  jqGrid inline edit is working fine, unless there is only a single row 
  returned from the database. In that case, neither enter nor escape or 
  clicking elsewhere on the page will take that row out of edit mode.

  Any suggestions?

  thanks,
  Michael    


[jQuery] Re: jqGrid inline edit - cannot save or cancel if only one row

2008-09-04 Thread Tony

Hello,
I do not think so.
This behavior is from a onSelectRow event.
In the example page it check for the current and last selected row.
If you have only one row this is really true. To overcome this we
should change a logic in
onSelectRow something like:
var last_selected_row;


onSelectRow : function(row_id){
   if(row_id != null) {
  if(row_id == last_selected_row) {
  // do here what you want
  } else {
 // do other things here or maybe edit it
 jQuery(...).editRow(row_id, true);
  }
   }
}

It is your chioce to do what you want.

Best Regards
Tony
On Sep 4, 1:46 am, Michael Nelson [EMAIL PROTECTED] wrote:
 Hello,

 jqGrid inline edit is working fine, unless there is only a single row 
 returned from the database. In that case, neither enter nor escape or 
 clicking elsewhere on the page will take that row out of edit mode.

 Any suggestions?

 thanks,
 Michael