javascript - jqGrid modal edit save only changed data and marked edited row? -


i use jqgrid 4.9.3-pre - free jqgrid oleg. edit data using model window "form editing". data server. datatype: "json" loadonce: false, paging of data don't use use standard table. call "form editing" ondblclickrow.

    ondblclickrow: function(rowid) {   $(this).jqgrid('setselection', rowid)            .jqgrid("editgridrow", rowid, {      recreateform: true,     width: 1000,     height: "auto"});     } 

two questions:

  1. mark row when has been edited. enter image description here
  2. when edit data , press button save. how send data has been modified data server?

i find question interesting , created the demo, demonstrates 1 of possible implementation of making edited field of form editing. results looks on picture below

enter image description here

the corresponding code inside of beforeshowform callback:

beforeshowform: function ($form) {     var $self = $(this),         mymarker = "<span class='mychanged-item fa fa-lg fa-arrow-circle-o-left' style='display:none;border-radius:6px;background-color:lightgreen;'></span>";     $form.find(".formelement").focusout(function () {         var colname = $(this).attr("name"),             rowid = $form.find("input[name='" + $self[0].id + "_id" + "']")                     .val(),             oldvalue = $self.jqgrid("getcell", rowid, colname),             $mymarker = $(this).closest("td")                         .next("td")                         .find("span.mychanged-item");         if ($(this).val() !== oldvalue) {             $mymarker.css("display", "");     // show         } else {             $mymarker.css("display", "none"); // hide         }     }).each(function () {         $(this).closest("td")             .after("<td style='width:15px'>" + mymarker + "</td>");     }); } 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -