I have a jqgrid where there are 19 columns, I want to display full column headers and have a horizontal scroll bar (only when the the header columns exceed the mainWid
I suppose that the problem which you have exists because of misunderstanding of different parameters of jqGrid which defines column width. To tell the trust there are many scenarios of the width choosing and you are not the only person who don't full understand the possibilities of choosing width of grid and columns in jqGrid.
You wrote
I have a jqgrid where there are 19 columns, I want to display full column headers and have a horizontal scroll bar.
To implement the requirements you need do following
autowidth: true
option of jqGrid.shrinkToFit: false
option of jqGrid.width
property in every column of colModel
. If you don't specify any width
value for the column the default value width: 150
You should choose the width which you really need to see. The width value will be not changed by jqGrid because you use shrinkToFit: false
.width
option of jqGrid. In the case the grid width will be the sum of the widths of all columns of the grid.fixGridWidth
from loadComplete
. I suppose you will not need the function at all.I don't use JPanel plugin and don't see any advantage of the plugin comparing to jQuery UI Accordion widget. Probably there are some issues specific for JPanel plugin. Nevertheless I suppose that you should remove I can't test my suggestions in your environment, but I hope it is very close to what you need. Some common remarks to your code:width="100%"
attribute from the element which you will use as grid.
pagination
, edit
, add
or del
in jqGrid. You should remove the parameters.data: orsDbRelease
parameter to jqGrid and remove the usage of addRowData
in the loop and reloadGrid
after the loop. If you use data
parameter the grid will be filled more quickly and will have already correct pagination.align
in items of the colModel
is already 'left' (see the value in the column "Default" in the table from the page of documentation). So you can remove the property align:"left"
from every column.sorttype
property for all non-text column in the grid. It will make the sort order of the corresponding column correctly. Probably the usage of different formatter
properties can additionally improve the visibility of the grid. See the documentation for more details.