Forum


07:52

18/12/2008

Hello all,
I am having trouble with an evergrowing (width wise) table.
I am working out the size of the parent div and then applying that value to the width parameter of jqGrid() - this works fine with 1 column but as I add more columns the total table size is growing by 2 or 3 px at a time.
I have played with the forceFit and shrinkToFit options but just cant get the table to stay restricted to its original size.
My jqGrid code:
$("#list").jqGrid(
{
url : 'dtg.php?tablename=' + tableName + '&fields=' + colnames,
datatype : 'json',
colNames : colnames,
colModel : colmodel,
mtype : 'GET',
pager : $('#pager'),
height : gridHeight,
width : gridWidth, // size of parent div
shrinkToFit : false,
imgpath: 'includes/js/themes/basic/images'
}).navGrid('#pager',{refresh:true, search : true, edit: false, add: false, del:false, position : "left"});
As you can see I am building the columns dynamically.. how do I restrict the total width of the table without the 2 or 3px addition.
03:46

Moderators
30/10/2007

Hello,
Read the docs what is grid width. Also to overcome this you can remove the padding and border properties from the table data.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
131 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66