Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I was having the same issue. I solved this issue by appending 4 lines of code in GridComplete. these 4 lines will change the style of td's of content area [first row td's style modification is enough]. This is an issue in jqgid. Which is actually setting the td's inside the '' but this style is not reflected in the td's of content area. While developing jqgrid they assumed that entire columns width will be effected by changing widths of one row's tds but they only changed for '' which is the persisting issue here.</p> <p>Set column widths in the ColModel:</p> <pre><code>colModel: [ { name: 'Email', index: 'Email', editable: true, edittype: 'custom', width: 220, editoptions: { custom_element: function(value, options) { return EmailAddressCustomElement(value, options); }, custom_value: function(elem) { var inputs = $("input", $(elem)[0]); return inputs[0].value; } } }, { name: 'LocationAndRole', index: 'LocationAndRole', editable: true, align: "left", edittype: "button", width: 170, editoptions: { value: 'Edit Location And Role', dataEvents: [{ type: 'click', fn: function(e) { ShowUsersLocationAndRoles(e); } }] } }, </code></pre> <p>Add the below code in the gridComplete event:</p> <pre><code>gridComplete: function() { var objRows = $("#list_accounts tr"); var objHeader = $("#list_accounts .jqgfirstrow td"); if (objRows.length &gt; 1) { var objFirstRowColumns = $(objRows[1]).children("td"); for (i = 0; i &lt; objFirstRowColumns.length; i++) { $(objFirstRowColumns[i]).css("width", $(objHeader[i]).css("width")); } } } </code></pre> <p>I hope the above code will help you in solving the issue.</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