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
True scrolling Rows loads data too often
21/02/2010
01:53
Avatar
frodeo
Member
Members
Forum Posts: 15
Member Since:
13/11/2009
sp_UserOfflineSmall Offline

I have a grid based on the True scrolling Rows demo, ie "Scroll:1". I set the buffer to for instance 50 (rowNum:50) and have 20 visible rows (height:xxx). The problem is that the first 10 times I click the down-button on the scrollbar the grid asks the server for an update (and I get the "Loading ..." message). After the 10 initial loads the buffer is used correctly.

Anybody else seeing this bug? Is there a plan for it to be fixed?

Frode Oldervoll

22/02/2010
02:54
Avatar
wolis
Member
Members
Forum Posts: 5
Member Since:
22/02/2010
sp_UserOfflineSmall Offline

Hi Frode,

I have not seen this behaviour when experimenting with scroll: 1.

I use a default definition like this:

  jQuery.extend(
   jQuery.jgrid.defaults, {
    altRows:true,
    rowNum:40,
    rowList:[],
    sortorder: 'asc',
    datatype: 'json',
    viewrecords: true,
    autowidth: true,
    hoverrows: true,
    shrinkToFit: false,
    gridview: false,
    loadui: 'enable',
    multiselect: false,
    sortable: true,
    scroll: 1
   }
  );

The jqGrid is resizable but generally only 10 rows show. Each time I scroll down so that the first blank row is visible, it does one request for more data.

09/04/2010
20:30
Avatar
frodeo
Member
Members
Forum Posts: 15
Member Since:
13/11/2009
sp_UserOfflineSmall Offline

I still have problems with scroll:1  – the first 9 times I click the down-arrow in the scrollbar the grid loads data from the server. I use the exact same script as in the "True scrolling Grid" example, and the data returned from the server is almost equal to the data returned from bigset.php.

I see the following when I debug the code (from grid.base.js):

populateVisible: function() {

256 if (grid.timer) clearTimeout(grid.timer);
257 grid.timer = null;
259 var dh = $(grid.bDiv).height();
260 if (!dh) return;
261 var table = $("table:first", grid.bDiv);
262 var rows = $("> tbody > tr:visible:first", table);
263 var rh = rows.outerHeight() || grid.prevRowHeight;
264 if (!rh) return;
265 grid.prevRowHeight = rh;
266 var rn = p.rowNum;
267 var scrollTop = grid.scrollTop = grid.bDiv.scrollTop;
268 var ttop = Math.round(table.position().top) – scrollTop;
269 var tbot = ttop + table.height();
270 var div = rh * rn;
271 var page, npage, empty;
272 if (ttop <= 0 && tbot < dh &&
273 (p.lastpage==null||parseInt((tbot + scrollTop + div – 1) / div,10) < p.lastpage))
275 npage = parseInt((dh – tbot + div – 1) / div,10);
276 if (tbot >= 0 || npage < 2 || p.scroll === true) {
277 page = Math.round((tbot + scrollTop) / div) + 1;
278 ttop = -1;
279 } else {
280 ttop = 1;
283 if (ttop > 0) {
284 page = parseInt(scrollTop / div,10) + 1;
285 npage = parseInt((scrollTop + dh) / div,10) + 2 – page;
286 empty = true;
289 if (npage) {
The first 9 times scrollTop has the following values: 14, 28, 42, 56, 70, 84, 98, 112, 126.
while table.position().top() is 129, tbot is approx 1700 and dh is 255. This results in a positive value for ttop (line 268).
The 10th time scrollTop is 140, which results in ttop = -10. Then the if-test in line 283 is false, npage is undefined and the if-test in line 289 is false. Which again results in the server call not beeing performed.
I don't know the exact logic behind this, but it explains why I get a server call the first 9 times the scrollbar is clicked. What is wrong here?
Regards
Frode Oldervoll
10/04/2010
14:59
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello Frode,

Thanks for this. I just fix some things when we are with scroll:1. The fix is in GitHub.

If you want you can test it. Hope that at end the problem is fixed. You can test it.

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

15/04/2010
10:31
Avatar
frodeo
Member
Members
Forum Posts: 15
Member Since:
13/11/2009
sp_UserOfflineSmall Offline

I still have the same problem after applying the patch.

Regards
Frode Oldervoll

16/04/2010
16:24
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Could you please provide a link to the problem. If you do this please include the nonminified (i.e development) version from GitHub.

Thank you.

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

19/04/2010
15:16
Avatar
Klaus
Member
Members
Forum Posts: 68
Member Since:
18/11/2009
sp_UserOfflineSmall Offline

Hello,

look at this post: http://www.trirand.com/blog/?p.....-problems/

... using a very little scrollTimeout should solve the problem.

Kind regards,
Klaus.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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