Advertisement
Guest User

Untitled

a guest
Jun 28th, 2012
803
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  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. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement