I have a grid with a value in a predefined field, I want to do it is to click edit a row want to change the value of one of the fields in the FormEdit.
The ColModel is:
colModel:[
{name:'id',index:'ID', width:50, hidden:true, search:false, editable:false,resizable:false},
{name:'product',index:'product', align:"center", width:20, search:false, editable:false,resizable:false},
{name:'volume',index:'volume', align:"center", hidden:false, width:15, search:false, editable:true}
],
I would establish volume = 1 when open the edit form, and i do like this...
ondblClickRow: function(id){
jQuery("#products").jqGrid('editGridRow', id, {
recreateForm:true,
beforeShowForm: function(form) {
$('#tr_volume',form).show();
$("#tr_volume",form).val('1');
},
reloadAfterSubmit:false, closeOnEscape:true, closeAfterAdd:true, closeAfterEdit:true,
editable:true, editrules:{edithidden:true,required:true,number:true,minValue:1}
})
But it's not working for me, what is wrong?