Capture when batchManager.saveTableChanges completed updates

1 Answer 27 Views
Grid
Arkadiusz
Top achievements
Rank 1
Arkadiusz asked on 09 Feb 2022, 01:56 PM

Hello!

Using RadGrid client side batch editing.

Is there a way to capture when the updates are complete when using the saveTableChanges?  Adding a callback function maybe?

I need to display a "saving" layer/message to let users know something is happening and prevent them from interacting with the grid.

Here is my code snippet:

                    var batchManager = grid1.get_batchEditingManager();
                    showLoadingPanel(true, 'Saving...');
                    batchManager.saveTableChanges(tables) ;
                    showLoadingPanel(false);

I would like to be able to ShowLoadingPanel before saving the table changes and hide it after the changes have been saved.

Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Attila Antal
Telerik team
answered on 14 Feb 2022, 10:41 AM | edited on 14 Feb 2022, 10:43 AM

Hello Arkadiusz,

The Grid will do a PostBack upon saving changes. If you enable AJAX through the RadAjaxManager and add a RadAjaxLoadingPanel, that will be displayed while the Grid does the update and there is no need to implement an additional CallBack.

Example Markup code:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel>

<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" Width="800px" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemDataBound="RadGrid1_ItemDataBound" OnBatchEditCommand="RadGrid1_BatchEditCommand">
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="OrderID" ClientDataKeyNames="OrderID" EditMode="Batch" CommandItemDisplay="Top">
    </MasterTableView>
</telerik:RadGrid>

 

Here is an online demo: Batch Editing - https://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx 

While the Grid is doing the server-side operation to save the changes, the loading panel will cover it and no further interactions can be performed until it is finished.

Example

 

Related articles:

 

Regards,
Attila Antal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Arkadiusz
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Share this question
or