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
Issues when specifying rowNum as a string in 4.5.2
03/09/2013
13:23
Avatar
snobo
Member
Members
Forum Posts: 34
Member Since:
05/03/2009
sp_UserOfflineSmall Offline

In version 4.5.2 (don't know about other 4.5.x versions), if you specify rowNum as a string (like "100" instead of 100), the specified number of records per page (rowNum) is not selected in the rowList drop-down. The grid still governs the specified number of records correctly, but no OPTION of SELECT.ui-pg-selbox is marked as selected, which leads to confusion whenever rowNum is not equal to rowList[0]. See screenshot for demo.

Image Enlarger

I know, it would be natural to dismiss it as a non-essential problem and simply suggest specifying rowNum as an integer. However, in all my applications I remember user settings (like number of records per page, current page, etc) in cookies. So, the problem is actually caused by the fact that getGridParam('rowNum') returns a string, not the integer (so "100" instead of 100), and this is what I store in the cookies and read/apply for the grid on next page visit. Before 4.5.x, it was never a problem because rowNum could be specified with a string with no side-effects. Not anymore.

03/09/2013
19:30
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Helo,

Thanks for this investigation.

As from 4.5 we make the comaparations more strong  - i.e we replace == with ===.

In your case if you set rowNum as string you should set rowList array values as string.

Regards

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.

03/09/2013
19:37
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Also you can then get the rowNum this way

parseInt(getGridParam('rowNum'),10);

In your previous case the returned value is always string since the select box values (rowList) are strings when they are builded in the select, not in the array.

Regards

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:
38 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