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
Negative RowNumbers
30/10/2009
11:23
Avatar
Mark C
Guest
Guests

Using 3.6Beta, load on scroll feature with autosearch (same as bigset.php). 40521 records.

rownum=100

I get negative rownumbers and the view 1 to x is also negative when the result set is like 15 records.

rownum=30

same again but result set is 3 records or less.

I have checked all the start/count/limit/page/totalpages and they all look fine. Using example code. I did trun the pager on to check the page value and it does goto 0 when this happens.

Any ideas?

Regards

Mark C

30/10/2009
11:29
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello

What you set rownum or rowNum – there is difference between these

Regards

Tony

P.S. The example is quite the same, but it works OK.

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.

30/10/2009
11:32
Avatar
Mark C
Guest
Guests

To be Honest, i really just need the bottom bar to say:  Viewing X records, where X starts at 40521 and each time user presses a ket X becomes the recordcount as the function View 1 of 100 -  40512 is redundant in loading by scroller.

Is it this possible with a paramter or do i need to simply get the count and redo my own footer.

Regards

Mark C

30/10/2009
11:39
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Look at language file - recordtext, in your case replace (or pass it in grid as parameter)

recordtext: "View {0} - {1} of {2}",

with

recordtext: "View {2}",

Enjoy

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.

12/01/2010
12:48
Avatar
Marinos
Guest
Guests

I have the same problem (version 3.6.2).

In my case, when I scroll to the next set of records (true scrolling is on), it says: View -4 – 9 of 9.
No error message so far. 

The actual problem this causes is the error message 'Invalid argument' in jquery.js.
The cause of this error message is line 682 in grid.base.js. The following statement is executed on this line: $(”>div:first”,ts.grid.bDiv).css({height : height}).
The second 'height' is a variable with value: “-160px”.

When you try to set a height with a negative value, the error 'Invalid argument' pops up.
(Only Internet Explorer generates an error message, Firefox just shows a negative value)

My grid has the following parameters (and a few irrelevant ones):
scroll: true,
rowNum: 5,
height:80, (about three records fit on one screen)

The database contains 9 records.

Do you have any ideas on how to solve this?

13/01/2010
18:36
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Check your server response what page number return.

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.

18/01/2010
14:57
Avatar
Marinos
Guest
Guests

Thanks for the quick reply.

I double checked the server settings. They seem to match the descriptions in /jqgridwiki/doku.php?id=wiki:retrieving_data.
The following response data is communicated:

Page load, only the headers are shown, no data yet:
Request: _search=false&nd=1263818383153&rows=5&page=1&sidx=UserName&sord=desc
Response: {”page”:1,”total”:0,”records”:0,”rows”:0}
Text in the pager: No records to show

After typing the search query with the first 5 rows:
Request: q=&_search=false&nd=1263818565548&rows=5&page=1&sidx=UserName&sord=desc
Response: {”page”:1,”total”:2,”records”:10,”rows”: .. [5 rows of data]
Text in the pager: Record 1 to 5 of total 10 

Request after scrolling. Total of 15 rows are shown:
Request: q=&_search=false&nd=1263818791205&rows=10&page=1&sidx=UserName&sord=desc
Response: {”page”:1,”total”:2,”records”:10,”rows”:.. [10 rows of data]
Text in the pager: Record -4 to 10 of total 10

The server returns the pagenumber which was requested in the querystring.
This jqGrid instance also has the following setting: .datatype=”json”
The database contains 10 records now.

19/01/2010
11:41
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Could you please post the grid configuration?

Thanks.

Best Regrds

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/01/2010
12:29
Avatar
Marinos
Guest
Guests

The grid settings:

var gridSettings = {
url: '/Users/List',
datatype: “json”,
altclass: 'alternateRow', //The class that is used for alternate rows. You can construct your own class and replace this value. This option is valid only if altRows options is set to true
altRows: true, //Set a zebra-striped grid
resizeclass: “resizable”, //Assigns a class to columns that are resizable so that we can show a resize handle only for ones that are resizable
loadtext: “Loading!!”, //The text which appear when requesting and sorting data. This parameter is located in language file
loadui: “enable”, //This option controls what to do when an ajax operation is in progress.
multiselect: true, //If this flag is set to true a multi selection of rows is enabled. A new column at left side is added. Can be used with any datatype option.
multiboxonly: false, //the multiselection is done only when the checkbox is clicked (Yahoo style). Clicking in any other row (suppose the checkbox is not clicked) deselects all rows and the current row is selected
rownumbers: false, //A column is added to count the number of available rows
scroll: true,
colNames: ['userid', 'Username', 'Student', 'Email'],
colModel: [
{ name: 'Id', index: 'Id', width: 200, hidden: true },
{ name: 'UserName', index: 'UserName', width: 200 },
{ name: 'Name', index: 'Name', width: 200 },
{ name: 'Email', index: 'Email', width: 200, resizable: true }
],
sortable: true, //When enabled this option allow column reordering with mouse.
 rowNum: 9,
height: 300,
autowidth: true, //The grid width is recalculated automatically to the width of the parent element. 
forceFit: true, //The adjacent column (to the right) will resize so that the overall grid width is maintained
autoencode: true, //When set to true encodes (html encode) the incoming (from server) and posted data (from editing modules). By example < will be converted to &lt;
sortname: 'UserName', //Initial sorting column
sortorder: “desc”, //Sorting order of default column

pager: true,
rowList: [5, 10, 20], //An array to construct a select box element in the pager in which we can change the number of the visible rows. 
viewrecords: true, //defines whether we want to display the number of total records from the query in the pager bar
pgtext: “Zie {0} van {1}”, //Show information about current page status. The first value is the current loaded page. The second value is the total number of pages
recordtext: “Rec {0} tot {1} van totaal {2}”, //Represent information that can be shown in the pager.
contextMenu: [{name:'Open',url:'/Users/Edit/'},{name:'Tewerkstelling bewerken',url:''},{name:'Rol bewerken',url:''}],
grid: $(”#test1″)
};

19/01/2010
13:30
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks.

This problem is fixed, but in GitHub. In order to resolve currently set the rowNum parameter to value greater or equal to 10.

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/01/2010
16:14
Avatar
Marinos
Guest
Guests

Thank you very much, Tony!

The grid works now, even with less than 10 rows. Smile

When using the grid, I noticed that the zebra effect is not correct. I created a new topic for this. The grid configuration is unchanged: 

http://www.trirand.com/blog/?p.....on/#p14053

11/05/2010
19:14
Avatar
SimonL
Member
Members
Forum Posts: 39
Member Since:
23/07/2009
sp_UserOfflineSmall Offline

Hi Tony,

I spotted this post and hoped it would help me because I'm having the same problem. But I'm using version 3.6.4. I have several grids in my application and all but one are working correctly. They scroll correctly and pass the correct data back to the server.

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

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

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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