Forum
09:53
07/06/2009
I typically configure the rowList option for all grids in our application with the following value:
properties.rowList = [10,20,50,100,'All'];
This allows users to display all items without putting a hard limit on the number of rows. Although the rowList option doesn't explictly say that it requires an array of numeric values, there are several places in the code that assume rowNum will be a number. It seems more of these have been added over time.
In jqGrid 3.4, I was able to use the rowList above with no changes to the the jqGrid code and I did not receive any errors. Upon upgrading to jqGrid 3.5 I had to make the following slight modification to the updatepager method, but this approach still worked.
updatepager =
function(rn) {
var cp, last, base,bs, from,to,tot,fmt;
if(isNaN(ts.p.rowNum)){
base = 0;
}
else{
base = (parseInt(ts.p.page)-1)*parseInt(ts.p.rowNum);
}
With the upgrade to 3.6, it appears that there are more places in the code that would need to be updated.
Would it be possible to do one of the following:
1) add code to support nonnumeric value for rowList option (this seems like it would be harder and possibly less desirable)
OR
2) add another parameter rowListLabels or something like this or another mechanism that would allow the label for the select options to be set. This would allows us to specify an arbitrary high number like 1000000 and give it the label of 'All' (this seems like an easy change) Of course, I could write some code to go set this label manually after the pager is rendered, which is what i will probably do in the short term, but i thought i would throw it out there as a possible enhancement.
Thanks for considering the change.
13:21
10/08/2009
Hello!
I agree with you. The same requirement have the most customers. The usage of "-1" is not allowed and can't be used, but one can use some large enough value and change the corresponding text value only for the user. For example I used mostly
pager: '#pager'
in the jqGrid definition and includes the following line after the grid creation:
It's a workaround, but it improves the visibility of the grid.
Best regards
Oleg
09:35
24/01/2012
May I suggest an improvement?
Instead of setting an arbitrary value, which is always wrong, you can set as a sentinel value 0 for 'All' and manage server-side, correctly. On the other hand, often in paging systems, it works without having to do anything.
pager: '#pager
12:45
10/08/2009
Hello fabamb,
I don't think that one should include in the code of jqGrid any changes which break the current server code. Your suggestion require changes on the server side because the code SELECT TOP(0) will work not good. On the other side if you use "SQL Server Management Studio" for example it uses per default TOP(1000) in all your selects of the tables. It's good because mostly you will not look through all returened rows and examine only some first rows. So I think that the usage of some large enough value like 5000 will be better. One can include the value as a new jqGrid option together with the text 'All' and make it configuratable. In the way one will receive full flexibility, but still don't break existing server code. So all users can update to the new version of jqGrid without additional compatibility problems.
Best regards
Oleg
Most Users Ever Online: 715
Currently Online:
39 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