Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 28th, 2012  |  syntax: None  |  size: 1.31 KB  |  views: 400  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. jqgrid change cell value and stay in edit mode
  2. editoptions: {
  3.     dataEvents: [
  4.         {
  5.             type: 'blur',
  6.             fn: function(e) {
  7.                 var newCodeValue = $(e.target).val();
  8.                 // get the information from any source about the
  9.                 // description of based on the new code value
  10.                 // and construct full new HTML contain of the "description"
  11.                 // cell. It should include "<input>", "<select>" or
  12.                 // some another input elements. Let us you save the result
  13.                 // in the variable descriptionEditHtml then you can use
  14.  
  15.                 // populate descriptionEditHtml in the "description" edit cell
  16.                 if ($(e.target).is('.FormElement')) {
  17.                     // form editing
  18.                     var form = $(e.target).closest('form.FormGrid');
  19.                     $("#description.FormElement",form[0]).html(descriptionEditHtml);
  20.                 } else {
  21.                     // inline editing
  22.                     var row = $(e.target).closest('tr.jqgrow');
  23.                     var rowId = row.attr('id');
  24.                     $("#"+rowId+"_description",row[0]).html(descriptionEditHtml);
  25.                 }
  26.             }
  27.         }
  28.     ]
  29. }
  30.        
  31. editrules = new
  32. {
  33. custom = true,
  34. custom_func = function( val, col ) { ... }
  35.  },