I have included the code provided by Oleg in this link.It works perfectly to set the size of the column depending on its content. The only problem I am facing right now is this that when I set "editble: true" for a column value, the span is also getting displayed along with the element.This span was added to the individual cells to acquire the width of the text present in the cells.now to edit the coloumn the column value that is displayed is:
<span class="mywrapping">text</span>
Please help.
You are right. It seems to me now that i would be more effective to include wrapping
<span>
only temporary to measure the width of the cell. In the case the wrapping span will not stay in cells and no problems which you described will be ever seem more.The demo provides modified version of the implementation "autowidth" behavior in the grid. It uses the following code
UPDATED. Alternatively one can use
autoWidthColumns
plugin which I posted asjQuery.jqGrid.addColumn.js
here. In the case one needs just to include bothjQuery.jqGrid.setColWidth.js
andjQuery.jqGrid.autoWidthColumns.js
and to create the grid using$("#gridid").jqGrid("autoWidthColumns").jqGrid({/*option*/});
instead of the standard$("#gridid").jqGrid({/*option*/});
.The demo uses the
autoWidthColumns
plugin.