Forum


14:24

25/01/2010

Hi everyone,
I have a problem here (I'm sure it's an easy thing, but I can't find the solution).
I create my grid this way:
jQuery("#grid_Primaria").jqGrid({
url: 'w72Prueba.do?action=populatePrimaria',
ajaxGridOptions : {async:false},
datatype: 'clientSide',
editurl:'clientArray',
width: 940,
loadui:'disable',
altRows:true,
mtype: 'POST',
colNames: ['Descripcion','AlumnadoA', 'GruposA', 'AlumnadoB','GruposB', 'AlumnadoD','GruposB','Identificador','Total','Id_Aula'],
colModel: [
{ name:'Descripcion',index: '1',width:300, align:'center' },
{ name:'AlumnadoA', index: '2',width:120, editable: true, align: 'center', editoptions:{style:'text-align: center;',size:6,maxlength: 5,onchange: "calculaTotal(id)",onfocus:"obtenerValor(id)"} },
{ name:'GruposA', index: '3',width:120, editable: true, align: 'center', editoptions:{style:'text-align: center;',size:6,maxlength: 5,onchange: "calculaTotal(id)",onfocus:"obtenerValor(id)"} },
{ name:'AlumnadoB', index: '4',width:120, editable: true, align: 'center', editoptions:{style:'text-align: center;',size:6,maxlength: 5,onchange: "calculaTotal(id)",onfocus:"obtenerValor(id)"} },
{ name:'GruposB', index: '5',width:120, editable: true, align: 'center', editoptions:{style:'text-align: center;',size:6,maxlength: 5,onchange: "calculaTotal(id)",onfocus:"obtenerValor(id)"} },
{ name:'AlumnadoD', index: '6',width:120, editable: true, align: 'center', editoptions:{style:'text-align: center;',size:6,maxlength: 5,onchange: "calculaTotal(id)",onfocus:"obtenerValor(id)"} },
{ name:'GruposD', index: '7',width:120, editable: true, align: 'center', editoptions:{style:'text-align: center;',size:6,maxlength: 5,onchange: "calculaTotal(id)",onfocus:"obtenerValor(id)"} },
{ name:'Identificador',index:'8',hidden:true},
{ name:'Total',index:'9',hidden:true},
{ name:'Id_Aula',index:'10',hidden:true}
],
rowNum: 30,
height: 400,
loadComplete : function (xhr){
//numero de filas que tiene el grid
var numeroFilas=eval('('+xhr.responseText+')');
setEditable ("#grid_Primaria",numeroFilas);
},
onSelectRow: function(id){
if(id && id!==lastSel){
lastSel=id;
}
}
});
It works fine, but there's a problem with widths. The grid has a 940px width, but when it is displayed there's always a blank gap (some kind of blank column), so columns never fit the grid width.
I would appreciate any help or suggestions,
Thanks¡¡
14:11

Moderators
30/10/2007

Hello,
Set the following parameter
height: 'auto',
or
scrollOffset : 0,
Look at grid documentation
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:
55 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