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 Height mess grid content alignment
13/11/2009
16:50
Avatar
sanchitos
Member
Members
Forum Posts: 14
Member Since:
05/10/2009
sp_UserOfflineSmall Offline

Hi, thanks again for JqGrid that is awesome.

First. Using version 3..5, happening on IE and FireFox.

I have the following problem, I couldn't explain myself well enough, so i will show you the screenshot

Image Enlarger

In the first picture i do a search that only show me 2 records. My grid height is of 90px, as you see the content can be handled by the grid without using the scrollbar, but it seems that the content is center aligned.

Instead when the search fill the grid with enough records, so the scroll is enabled, the alignment is just perfect.

This is happening when i search, if the grid is filled up just from the beginning the alignment is fine.

The code:

    //definicion del grid
        $(document).ready(function() {
            jQuery(NOMBRE_GRID).jqGrid({
                url: '/BuscadorClasesPuestos/Buscar',
                datatype: 'json',
                mtype: “POST”,
                height: 90,
                width: 370,
                //autowidth: true,
                colNames: ['Id', 'Nombre'],
                colModel: [
                      { name: 'id_clase_puesto', index: 'id_clase_puesto', width: 100, align: 'left' },
                      { name: 'nombre', index: 'nombre', width: 250, align: 'left' }
                  ],
                rowNum: tamanoPagina,
                rowList: [5, 10, 15, 20],
                pager: jQuery(NOMBRE_AREA_PAGINACION),
                sortname: 'nombre',
                sortorder: “asc”,
                viewrecords: true,
                pager: jQuery(NOMBRE_AREA_PAGINACION),
                caption: ''
            });
        });

When i hit the search button i'm doing this

$(NOMBRE_GRID).setGridParam({ url: “/BuscadorClasesPuestos/Buscar/” + id, page: 1 }).trigger(”reloadGrid”);

Any help will be appreciated, thank you

14/11/2009
02:11
Avatar
Rumen[Trirand]
Moderator
Members

Moderators
Forum Posts: 81
Member Since:
08/10/2009
sp_UserOfflineSmall Offline

Hello,

Yes, the problem is that once a scrollbar is shown, it takes some space off the grid. By default this space is 18px. So the solution is to always have 18px reserved for that - this is controlled by the scrollOfset option, e.g.

 $(document).ready(function() {
            jQuery(NOMBRE_GRID).jqGrid({
                url: '/BuscadorClasesPuestos/Buscar',
                datatype: 'json',

scrollOffset: 18,

You can also experiment with height in percentages. jqGrid accepts 100% as valid height, so in some cases you may be better of with height 100% and paging, instead of scrolling.

Regards,

Rumen Stankov

jqGrid Team

Trirand ASP.NET WebForms & MVC components based on jQuery & ThemeRoller

http://www.trirand.net

19/11/2009
15:20
Avatar
sanchitos
Member
Members
Forum Posts: 14
Member Since:
05/10/2009
sp_UserOfflineSmall Offline

Thank you, but setting the scrollOffset didn't worked out.

Any way, I set the paging so it actually fit the page.

Thank you again.

21/11/2009
03:33
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I think that there is another reason which make this happen maybe the elements at left to the grid.

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
53 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