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

how to only trigger ajax updates some of the time

1 Answer 68 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Sheryl Landon
Top achievements
Rank 1
Sheryl Landon asked on 19 Aug 2008, 05:54 PM
We have a treeview and a grid on a page.  I have the ajax manager set up as follows:
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
    <UpdatedControls> 
         <telerik:AjaxUpdatedControl ControlID="RepositoryTree"/>  
         <telerik:AjaxUpdatedControl ControlID="PortfolioGrid"/>  
    </UpdatedControls> 
</telerik:AjaxSetting> 
<telerik:AjaxSetting AjaxControlID="PortfolioGrid">  
    <UpdatedControls> 
    <telerik:AjaxUpdatedControl ControlID="PortfolioGrid" /> 
    </UpdatedControls> 
</telerik:AjaxSetting> 
<telerik:AjaxSetting AjaxControlID="RepositoryTree">  
    <UpdatedControls> 
    <telerik:AjaxUpdatedControl ControlID="RepositoryTree" /> 
    <telerik:AjaxUpdatedControl ControlID="PortfolioGrid" /> 
    </UpdatedControls> 
</telerik:AjaxSetting> 
 

This does work, but when operations are done on the treeview (RepositoryTree), the grid (PortfolioGrid) is always updated too, when in actuality, there are only certain operations that require the grid to be updated (for example, drag/dropping an item from the treeview to the grid).  So on updates to the treeview, I always want the treeview updated, but only sometimes do I want the grid updated.

But, I've been unable to figure out how to manually trigger the ajax call to update the grid upon a drop, if I remove the last "updatedControl" line from the declaration above like this:
<telerik:AjaxSetting AjaxControlID="RepositoryTree">  
    <UpdatedControls> 
    <telerik:AjaxUpdatedControl ControlID="RepositoryTree" /> 
    </UpdatedControls> 
</telerik:AjaxSetting>

I've tried adding ajaxManager.ajaxRequestWithTarget or ajaxManager.ajaxRequest 
calls to specifically update the grid, but they do nothing, perhaps because other ajax activity is already going on (the primary RepositoryTree work is happening via Ajax)?  Perhaps I haven't found the right place to add the api calls for ajax on the Grid?  In this example, we do have a serverside method to process the drop on the grid in response to the OnNodeDrop event.  Seems like I would have to make Grid ajax refresh request after this event returns to the client?  How would I do that?

Thanks,
Sheryl

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 20 Aug 2008, 10:31 AM
Hi Sheryl Landon,

Please review the following help topic, which elaborates on similar matter. Test some of the provided approaches and let us know if this helps.

Kind regards,
Maria Ilieva
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
Sheryl Landon
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or