This is a migrated thread and some comments may be shown as answers.

AjaxRequests get dropped

2 Answers 53 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Ivaylo
Top achievements
Rank 1
Ivaylo asked on 27 Sep 2010, 05:53 PM
Hi,

I am using a Rad Grid control inside a user control. I have to support automatic inserts and edits - the insert is implemented by clicking a button in the command item template, and the editing is done by double-clicking the row that contains the item. I have hooked it up with the RowDoubleClick event in the ClientEvents tag and have implemented a custom javascript logic that keeps track of the edited items and triggers ajax requests to the server using a RadAjaxManager. I would like to be able to commit any pending changes to the currently edited item, if I double-click on another one (and have only one active editor).

the code for this looks like

function RowDblClick(sender, eventArgs) {
        requestCommit(); // commits any changes to the server to be recorded.
        // initialize items that keep the currently selected row's data.
    }

function requestCommit() {
        var result = false;
         .....
         // if updating
         manager.ajaxRequest(...);// pass the data to the server to perform update
          // else if inserting
         manager.ajaxRequest(...);// pass the data to the server to perform insert
         // other code skipped for clarity
         return result; // result is true if request attempt was made
    }

function GridKeyPress(sender, eventArgs) {
        var c = eventArgs.get_keyCode();
        if (c == 13) {
            requestCommit();
        }
    }

This code works fine when I press the enter key - the data is successfully  submitted. However, I want to submit it when I doubleclick on another row - unfortunately nothing happens - Firebug says that the request was aborted. This happens on FF, IE7, 8 and chrome (I did not test it elsewhere). When I add an alert tag in the requestCommit method before it returns, all works fine.

Regards,
Ivaylo Slavov

2 Answers, 1 is accepted

Sort by
0
Accepted
Cori
Top achievements
Rank 2
answered on 27 Sep 2010, 10:01 PM
Could the issue be that you are initiating a ajax request before the previous one completes or are you executing them one after the other, ensuring the previous one complete before executing the next? If the first situation is true, I would suggest increasing the request queue size, I forget the actual property name, but it should contain queue in it. That way mulitple ajax requests will queued one after the other and executed after each one completes.

I hope that helps.
0
Ivaylo
Top achievements
Rank 1
answered on 28 Sep 2010, 09:27 AM
Thanks Cori, it seems that the request size of the RadAjaxManager was the issue.
Tags
Ajax
Asked by
Ivaylo
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Ivaylo
Top achievements
Rank 1
Share this question
or