Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It seems to me that the answer to your question you will find <a href="https://stackoverflow.com/questions/3405029/jqgrid-disable-form-fields-when-editing/3405961#3405961">here</a> and <a href="https://stackoverflow.com/questions/3899630/jqgrid-add-dialog/3899847#3899847">here</a> (look at the example also).</p> <p><strong>UPDATED</strong>: I don't know commertial version of jqGrid. If you don't solve your prblem you should post your question better in the forum <a href="http://www.trirand.net/forum/default.aspx" rel="nofollow noreferrer">http://www.trirand.net/forum/default.aspx</a>.</p> <p>If I understand your code correct you can try to remove definition of the attributes <code>readonly</code> and <code>disabled</code> (<code>JQGridEditFieldAttribute</code>) from the <code>EditFieldAttributes</code>. Instead of that you can try to do following</p> <p>If you want to show readonly fields 'username' and 'domain' in the edit dialog you can do following</p> <pre><code>jQuery("#myGrid").jqGrid('navGrid','#myGrid-pager', { }, //options { recreateForm: true, // edit options beforeShowForm: function(form) { $('#username',form).attr('readonly','readonly'); $('#domain',form).attr('readonly','readonly'); } }); </code></pre> <p>or without the usage of <code>recreateForm: true</code> option:</p> <pre><code>jQuery("#myGrid").jqGrid('navGrid','#myGrid-pager', { }, //options { // edit options beforeShowForm: function(form) { $('#username',form).attr('readonly','readonly'); $('#domain',form).attr('readonly','readonly'); } }, { // add options beforeShowForm: function(frm) { $('#username',form).removeAttr('readonly'); $('#domain',form).removeAttr('readonly'); } }); </code></pre> <p>If you want not to show the fields 'username' and 'domain' in the edit dialog you can do</p> <pre><code>jQuery("#myGrid").jqGrid('navGrid','#myGrid-pager', { }, //options { recreateForm: true, // edit options beforeShowForm: function(form) { $('#username',form).hide(); $('#domain',form).hide(); } }); </code></pre> <p>It should work in the free version of the jqGrd, but because you use <code>SetUpGrid</code> which setup ome settings of jqGrid navigation bar (like <code>grid.ToolBarSettings.ShowEditButton = true</code>). You use also</p> <pre><code>grid.ClientSideEvents.GridInitialized = "initGrid" </code></pre> <p>I am not sure what you can do inside of <code>initGrid</code> function. Probably you should define some additional callbackes instead of calling of <code>jQuery("#myGrid").jqGrid('navGrid', ...);</code>. Look at <a href="http://www.trirand.net/documentation/aspnet/_2s20v9uux.htm" rel="nofollow noreferrer">http://www.trirand.net/documentation/aspnet/_2s20v9uux.htm</a> and <a href="http://www.trirand.com/blog/phpjqgrid/docs/jqGrid/jqGridRender.html#methodsetNavOptions" rel="nofollow noreferrer">http://www.trirand.com/blog/phpjqgrid/docs/jqGrid/jqGridRender.html#methodsetNavOptions</a></p>
 

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