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_Related Related Topics sp_TopicIcon
typing bug with max/min in addJSONData and addXmlData
19/12/2011
19:47
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tony,

in addJSONData and addXmlData there are typing bug (the lines 1212 and 1383):

ts.p.lastpage = Math.min( ts.p.page, Math.ceil(gl/ rn) );

or

ts.p.lastpage = Math.min( ts.p.page, Math.ceil(len/ rn) );

should be fixed to

ts.p.lastpage = Math.max( ts.p.page, Math.ceil(gl/ rn) );

or

ts.p.lastpage = Math.max( ts.p.page, Math.ceil(len/ rn) );

Probobly even better to go back to the original lines

ts.p.lastpage = Math.ceil(gl/rn);

and

ts.p.lastpage = Math.ceil(len/rn);

To reproduce the bug one can just fill the grid having loadonce: true option with many pages of data. If the page parameter of the JSON data are set for example to 1 (the first page schould be displayed), then the lastpage will be set to 1, corresponds to the above described bug, instead of Math.ceil(len/rn) which correspond to the number of read records.

It's bug from my old suggestion. After the line 1117 with

if (gl > 0 && ts.p.page <= 0) { ts.p.page = 1; }

and the line 1286 with

if (len > 0 && ts.p.page <= 0) { ts.p.page = 1; }

were included in the jqGrid code the real problem which should fix ts.p.lastpage = Math.max( ts.p.page, Math.ceil(gl/ rn) ); will be eliminiet. Sorry.

Best regards
Oleg 

20/12/2011
12:25
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello Oleg,

No need to say Sorry. I must say Thank you.

Just released the 4.3.1

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.

20/12/2011
13:07
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Congratulation!

It's good to publish releases with bug fixes.

Best regards
Oleg

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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