Forum



10:19

23/07/2009

Hi,
I've already posted this in another topic called Negative record numbers because I'm having the same issue, but unfortunately my question has not been answered and I posted the issue 6 days ago, so I'm assuming somehow my post has been missed so here goes again ...
I have all the grids set up to use the auto scrolling feature which calls back to the server for more data when you scroll down the grid. When the grid initially loads the data, the server side routine that receives: page, rows, _search, sidx, sord, nd, filters as the query string and receives page=1 which is correct. Then when I scroll passed the frist page (20 records) the value for page is set to 2, which is also correct. If I scroll further the value for page is 2 again, instead of 3. And once its starts to do that the record numbers go negative (i.e. View -9 - 20 of 649). I've tried various different setiings of rowNum but nothing seems to work.
All the grids in my application inherit defaults like so:
$.jgrid.defaults = $.extend($.jgrid.defaults, {
datatype: 'json',
mtype: 'POST',
height: 'auto',
imgpath: '/Scripts/themes/ui-darkness/images',
jsonReader: {
root: "Rows",
page: "Page",
total: "Total",
records: "Records",
repeatitems: false,
userdata: "UserData",
id: "Id"
},
autowidth: true,
height: 'auto',
loadui: "block",
rowNum: 20,
//rowList: [10, 20, 30],
rownumbers: true,
scroll: 1,
multiselect: false,
height: 400,
viewrecords: true,
loadError: function(xhr, status, error) {
if (error !== "")
alert("Error loading data, invalid response from server. " + "(" + status + ")");
},
toolbar: [true, "top"],
sortable: true,
onSelectRow: function(rowid, status) {
RowId = rowid;
},
onSelectAll: function(aRowids, status) {
GALLERY_WEB.selectAll = status;
},
gridComplete: function() {
if (GALLERY_WEB.selectAll) {
rows = $('.entity_grid').jqGrid('getRowData');
$('.entity_grid').jqGrid('resetSelection');
for (var x = 0; x < rows.length; x++) {
$('.entity_grid').jqGrid('setSelection', rows[x].rn);
}
var gridID = $('.entity_grid').attr('id');
$('#cb_' + gridID).attr('checked', true);
}
}
});
And the grid that displays the incorrect behaviour is defined like so:
GALLERY_WEB.grid_def_Stock = {
url: 'GetListData/',
primaryKey: 'StockNumberID',
pager: "#pager",
toppager: true,
sortname: 'StockNumberID',
sortorder: "desc",
viewrecords: true,
caption: "Stock",
footerrow: true,
userDataOnFooter: true,
colNames: [
...... column names .......
],
colModel: [
...... column definitions .......
]
};
Have you any idea whats going wrong?
Thanks,
Simon
22:25

Moderators
30/10/2007

Hello,
Obviously this is a problem form the server response not from the grid.
Search this forum and you will find a lot of therads regarding this instead to wait 6 days for the answer!!!.
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.
16:51

23/07/2009

Hi Tony,
I don't think is this a problem from the server. In my grid I have multi-line rows and from what I can gather at /blog/?page_id=393/help/multiline-rows-breaks-dynamic-scrolling-grids/&value=multiple%20lines&type=3&include=1&search=1 This appears to break dynamic scrolling (scroll:1). When I make my grid only single lines per row it then I didn't get any negative row/record numbers.
One of the main things I need to do in my app is display an image in one of the grid columns (I have a custom formatter that displays it) but this of course causes the grid to have multi-line rows.
I looked at the list of changes you did for 3.6.5 but I didn't see this issue mentioned. I really like the dynamic scroll and would love to be able to use it. I've used it on all my other grids in my application and would love to use it in this one with the mult-line rows to keep everything the same for the user.
Is this still a problem or is there a work-around you can think of?
Regards,
Simon
17:30

23/07/2009

Hi Tony,
Ok, worked out how to handle this problem and still show my image and still have dynamic scrolling. Originally I had multi-line rows but the height of rows was different because some some rows have an image and some don't. I simply amended the css for the row to be a fixed height.
.ui-jqgrid tr.jqgrow td.wrap {
white-space: normal !important;
height:100px;
padding-top:2px;
}
The row/record numbers are now correct.
Hope this might help someone else.
Regards,
Simon
Most Users Ever Online: 715
Currently Online:
150 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