Note that there are some explanatory texts on larger screens.

plurals
  1. POEditing rows mixing inline edit and form edit
    text
    copied!<p>In my jqGrid I'm using both inline editing and form editing.</p> <p>One of my columns should not be editable in inline editing so I put the attribut editable to false in my colModel, but this column should be visible in form editing (readonly when editing and editable when adding).</p> <p>Here is what I have tried :</p> <pre><code>colModel:[{name:'bordereau',index:'BORDEREAU',width:60,align:'center',title:false,editable:false,editoptions: { readonly: true },editrules:{required:true},sortable:true,search:true}, function addRowForm(){ grid.editGridRow("new",{ width:'auto', height:'auto', reloadAfterSubmit:true, recreateFilter:true, beforeInitData: function() { grid.jqGrid('setColProp','bordereau',{editable:true}); grid.jqGrid('setColProp','bordereau',{editoptions: {readonly: false}}); }, afterShowForm: function() { $("#editmod"+gridId).css("top",Math.round(((hauteurFenetreUtilisable)/2)-($("#editmod"+gridId).height()/2))+"px"); $("#editmod"+gridId).css("left",Math.round(((largeutFenetreUtilisable)/2)-($("#editmod"+gridId).width()/2))+"px"); grid.jqGrid('setColProp','bordereau',{editable:false}); grid.jqGrid('setColProp','bordereau',{editoptions: {readonly: true}}); $("#TblGrid_listeVar2 tr:visible:odd").addClass("jqgrow ui-row-ltr odd"); }, onclickPgButtons : function (which, formid, numeroBordereau) { }, onClose: function() { }, afterComplete: function() { } }); } function editRowForm(numeroBordereau){ grid.restoreRow(numeroBordereau); resetGridVar(); grid.editGridRow(numeroBordereau,{ width:'auto', height:'auto', reloadAfterSubmit:true, recreateFilter:true, beforeInitData: function() { grid.jqGrid('setColProp','bordereau',{editable:true}); }, afterShowForm: function() { $("#editmod"+gridId).css("top",Math.round(((hauteurFenetreUtilisable)/2)-($("#editmod"+gridId).height()/2))+"px"); $("#editmod"+gridId).css("left",Math.round(((largeutFenetreUtilisable)/2)-($("#editmod"+gridId).width()/2))+"px"); $("#TblGrid_listeVar2 tr:visible:odd").addClass("jqgrow ui-row-ltr odd"); grid.jqGrid('setColProp','bordereau',{editable:false}); }, onclickPgButtons : function (which, formid, numeroBordereau) { }, onClose: function() { }, afterComplete: function() { } }); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload