0

Please see the link below,

http://www.logicatrix.com/example/records.html

In this table there are many columns included , so what i want is to get fit the whole table into drawn gray border i.e. div element with class name bms-dashboard-body. with a horizontal scroll bar just like an excel sheet has on the right bottom corner a small one. is it possible to create liquid layout of this jqgrid table ?

if someone has another approach , to fit the this table then i don't mind.

Hunt
  • 8,215
  • 28
  • 116
  • 256

2 Answers2

0

you can get horizontal scroll bar with static or auto size fields by wrapping the grid and pager with a div and run a small script,
you can see the jsfiddle-example, or just go like so:

<div id="grid_container">
  <table id="list"></table>
  <div id="pager"></div>
</div>

and run this script:

$('#grid_container div:not(.ui-jqgrid-titlebar)').width("100%");    

my example is using the script from trirand.com but iv tried it on their newest release and it worked just fine.
hope i've helped.

Yakir Manor
  • 4,687
  • 1
  • 32
  • 25
0

The parameter autoWidth:true should be written as autowidth:true.

Moreover you can set grid height and width with respect of setGridHeight and setGridWidth methods (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods). The best place to do this probably inside of the loadComplete event handler.

Oleg
  • 220,925
  • 34
  • 403
  • 798
  • Using autowidth:true is causing problem because if i specify width of cloumns in a colModel then few of my cells are getting crushed :( – Hunt Aug 31 '10 at 12:17
  • At least the value `autoWidth` is unknown for jqGrid and will be just ignored. There are different approach to place long information in jqGrid. See http://stackoverflow.com/questions/1730061/wrapping-text-lines-in-jqgrid and http://stackoverflow.com/questions/3097498/render-a-newline-in-my-data-inside-a-jqgrid-cell/3097678#3097678. But in the most cases cutting of information and displaying the full texts as tooltips are enough. – Oleg Aug 31 '10 at 12:44