Forum
16:50
05/10/2009
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
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
02:11
Moderators
08/10/2009
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
03:33
Moderators
30/10/2007
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.
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66