
Hi,
I have datasource1 which would return result immediately is bound to grid1 , and datasource2 which uses a long running query (~10 seconds) bound to grid2. Both grids are on the same page.
here is the normal flow from chrome console:
datasource1 request started
datasource2 request started
datasource1 request ended
datasource2 request ended
But sometimes datasource2 would block datasource1 (request status = 'Pending' in chrome dev tab), and would return before datasource1:
datasource1 request started
datasource2 request started
datasource2 request ended
datasource1 request ended
Since datasource2 is taking 10seconds, datasource1 would not return until datasource2 is done with request.
to troubleshoot the issues I spread my backend actions (MVC actions) to different controllers and removed any reference to session/cockie but that did not help.
Thank you.
Madani
5 Answers, 1 is accepted
The Grid`s DataSource will make standard AJAX requests and the behavior that you are describing is expected. If you want to ensure that the second Grid will request the data after the first Grid data is received, you can set the AutoBind property of the second Grid to false and call the "read" method of its DataSource within the dataBound event of the first Grid (with a global flag variable to ensure if the logic is executed only once, unless you need to execute it after each request of the first grid).
Hope this helps.
Regards,
Konstantin Dikov
Progress Telerik

Thanks Konstantin,
I am not caring about which data source return before the other.I want to ensure that data sources can request data at the same time (after document.ready is called).My understanding is that data sources run asynchronous, meaning that multiple request can run at the same time without any blocking.Are you saying that this is not possible ?
Madani
The requests are async and the Grid will start rendering the data on the success of the AJAX request. However, the actual rendering will not be an async operation and the order of which the Grid data will be rendered will depend on which of the requests will be returned first:
Regards,
Konstantin Dikov
Progress Telerik

I am not satisfied with your answer.I am talking about one data source request blocking another data source request regardless of the grid control.We all understand that one data source would return data before the other, but the problem i am describing here is that one data source read request is blocking another data source read request.The second data source read request is not initiated until the first one finish fetching data.Please see the attached image where the red line describes the delay caused by the blocking.
Thanks
If you inspect the "Network" tab in the browser while running the dojo example from my previous post you will notice that both requests are running simultaneously. I am attaching a screenshot from the dojo.
On a side note, your first post described different behavior and different problem from the one shown in the last image. Could you please elaborate how you are determining the current flow of the requests?
Regards,
Konstantin Dikov
Progress Telerik