This is a migrated thread and some comments may be shown as answers.
Problem with paging when cancelling dataBinding event
0 Answers 12 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Niels
Top achievements
Rank 1
Niels asked on 14 Oct 2011, 08:33 AM
There seems to be a bug in the grid when the Ajax dataBinding event is cancelled when going to another page. Internally the grid has gone to the new page but when the ajax call to get the new page data is cancelled with e.preventDefault internally the grid won't go back to the old page.

Example of this bug can been seen in the Batch Editting demo when the following is done:
1. Start demo
2. Check a value in the grid
3. Use pager to go to page 2
4. Cancel the dialog about lost changes (grid stays on page 1)
5. Hit Refresh icon
6. OK the dialog about lost changes and...

Presto: page 2 is shown.

problem is line 2 in de pageTo function of the grid (line 976 of telerik.grid.js (Q2-2011). 

pageTo: function (page) {
    this._pagingInProgress = true;
    this.currentPage = page;
    if (this.isAjax())
        this.ajaxRequest();
    else
        this.serverRequest();
},

In the line this.currentPage is always set to new page number. So even when dataBinding is cancelled (or goes wrong for whateven reason) the currentPage has the value of the new page.

Kind regards,

Niels Schneider


Tags
Grid
Asked by
Niels
Top achievements
Rank 1
Share this question
or