Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Grid size bigger than columns size
08/04/2010
14:24
Avatar
noelg
Member
Members
Forum Posts: 6
Member Since:
25/01/2010
sp_UserOfflineSmall Offline

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¡¡

13/04/2010
14:11
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

13/04/2010
15:15
Avatar
noelg
Member
Members
Forum Posts: 6
Member Since:
25/01/2010
sp_UserOfflineSmall Offline

Hello Tony,

Thanks for your answer, it worked!

Again, hope you the best¡¡

Regards

Alvaro

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information