I have jqgrid
with inline editing mode
. What I want to accomplish is when changing cell value, another cell value to be changed too.
What I have for now is:
ondblClickRow: function (id) {
var selR = $(this).getRowData(id);
$("#" + $(selR.Inflow).attr("id")).keypress(function () {
$(obj.grid).jqGrid("setCell", id, "Inflow", "123321");
});
}
With this try the cell value is changed but edit mode is disabled after invoking setCell
. I want to change it but to stay in edit mode. Any ideas ?
I would recommend you to define dataEvents
property of editoptions
of the first column. You can bind change
event handler which you define inside of dataEvents
. It allows you to monitor the changing of the first column. To access the second column inside of the change
event handler you can use jQuery.val
method, where you use id selector. You need just to know that ids of all fields on inline editing are build based on the rowid (the id of outer <tr>
element) appended with underscore ("_"
) and the name on the column. The "UPDATED 3" part of the answer provides the demo which do the changes in more common case. To get the rowid from the Event
object e
you can use $(e.target).closest("tr.jqgrow").attr("id")
.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments