Hello,
I have a page that populates a RadGrid on load. The end user has the option to check a box within one or more grid rows. Upon click of a button, I want to initiate concurrent Ajax requests (one for each row) and allow the page to update (each row) based on when these concurrent requests complete -- which should happen at different times, i.e., it will take varying times for the command to complete for each row.
I have increased the RequestQueueSize on my AjaxManager control to 1000 (I am reading that the real number is considerably lower, i.e, around 4). That said, it still appears that each request is only made after the previous is complete. Here is my javascript that makes the ajax request. I basically iterate over the grid rows, find some relevant controls (a checkbox representing the user selection and an image to show a spinner icon) and then make the request.
function doCommand(button, args) {
var grid = $find('<%=myGrid.ClientID %>');
var masterTable = grid.get_masterTableView();
var items = masterTable.get_dataItems();
for (var n = 0; n < items.length; n++) {
var row = items[n];
var chkBox = row.findElement("chkCheckStatus");
var img = row.findElement("myImg");
if (null != chkBox) {
if (chkBox.checked) {
var selectedID = row.getDataKeyValue("ID");
if (null != img) {
img.src = "i/loader.gif";
}
var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
ajaxManager.ajaxRequest("cmd/" + n + "/" + selectedID);
}
}
else {
window.status = "Didn't find the control!";
}
}
}
I handle the ajax call in the RadAjaxManager1_AjaxRequest server side method. All of this works.
Is there any way for me to fire off many of these requests (sequentially as I iterate the grid rows) and then see the results come in as the commands complete, e.g., row 5 might finish before row 1 because the server side processing for row 5 took longer than row 1?
I have a page that populates a RadGrid on load. The end user has the option to check a box within one or more grid rows. Upon click of a button, I want to initiate concurrent Ajax requests (one for each row) and allow the page to update (each row) based on when these concurrent requests complete -- which should happen at different times, i.e., it will take varying times for the command to complete for each row.
I have increased the RequestQueueSize on my AjaxManager control to 1000 (I am reading that the real number is considerably lower, i.e, around 4). That said, it still appears that each request is only made after the previous is complete. Here is my javascript that makes the ajax request. I basically iterate over the grid rows, find some relevant controls (a checkbox representing the user selection and an image to show a spinner icon) and then make the request.
function doCommand(button, args) {
var grid = $find('<%=myGrid.ClientID %>');
var masterTable = grid.get_masterTableView();
var items = masterTable.get_dataItems();
for (var n = 0; n < items.length; n++) {
var row = items[n];
var chkBox = row.findElement("chkCheckStatus");
var img = row.findElement("myImg");
if (null != chkBox) {
if (chkBox.checked) {
var selectedID = row.getDataKeyValue("ID");
if (null != img) {
img.src = "i/loader.gif";
}
var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
ajaxManager.ajaxRequest("cmd/" + n + "/" + selectedID);
}
}
else {
window.status = "Didn't find the control!";
}
}
}
I handle the ajax call in the RadAjaxManager1_AjaxRequest server side method. All of this works.
Is there any way for me to fire off many of these requests (sequentially as I iterate the grid rows) and then see the results come in as the commands complete, e.g., row 5 might finish before row 1 because the server side processing for row 5 took longer than row 1?