We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to prevent edit next cell in batch mode?

Hi Syncfusion workers.

I have a doubt about the batch edit mode of the ejgrid:

When I finish the edit of a cell, the next cell automatically enter in edit mode.

My question is. Is there a form to prevent that funcionality? i.e. I edit the name, but after press Enter key, the cell is changed to normal mode and I want to edit anoter cell, the user have to click the next row.

I do not know if I explained? 
Thank you so much


6 Replies

CA César Alejandro Guerrero Nava November 22, 2018 01:50 AM UTC

And I forgot to question:

Is there a form that when I press Enter key and a modal appears the edited cell doesn´t finish until y press a button in the modal?

Thank you so much.


VN Vignesh Natarajan Syncfusion Team November 22, 2018 10:21 AM UTC

Hi César, 

Thanks for contacting Syncfusion Support. 

Query #:-  Is there a form to prevent that funcionality?  
 
By using BatchEdit Mode, you can made changes in each of the cell in Grid and save whole edited records  into Grid by clicking on save icon which acts like Excel behavior. If you want to save each cell after made changes by pressing Enter Key, you can follow the Knowledge Base document “How to save changes immediately after editing a cell in batchEditing”. Please refer to the KB link:- 


If above solution does not resolve your query, Please share us the following details. 

1. Exact scenario you need to achieve. 
2. Screenshot/Video Demo to demonstrate your requirement. 

Regards, 
Vignesh Natarajan 








 



CA César Alejandro Guerrero Nava November 23, 2018 06:52 PM UTC

I think I didn´t explain:

My goal is when the user click a cell, Enter key in edit mode (batch mode).  So far so good, the problem is when I press Enter key and ends the edit mode, automatically the next cell enter in edit mode, and I have a method that show a popup and with the values in that modal,  modify another cell in the same row...but due to the move of the end edit, cause an error in the aplication.

My request is: Can I stop that move to the next cell when I finish the edited cell? The end is edit cell only when I click and finish when I press Enter key.

Do you need more details about the scenario? Thank you so much, your suport is a big help for the developers.




VN Vignesh Natarajan Syncfusion Team November 26, 2018 11:14 AM UTC

Hi Cesar, 
 
Thanks for the update 
 
From your query, we suspect that you need to prevent the next row cell from editing while pressing the enter key. We have achieved your requirement using CellEdit event and getBatchChanges() method of ejGrid. Refer the below code example 
 
   <ej:Grid ID="OrdersGrid" runat="server" AllowPaging="True"> 
        <Columns> 
            .                  .                  .                  .             .  
        </Columns> 
        <EditSettings AllowEditing="True" AllowAdding="True" AllowDeleting="True" EditMode="Batch"></EditSettings> 
        <ToolbarSettings ShowToolbar="True" ToolbarItems="add,edit,delete,update,cancel"></ToolbarSettings> 
        <ClientSideEvents CellEdit="celledit" /> 
    </ej:Grid> 
    <script type="text/javascript"> 
        function celledit(args) { 
            if (this.getBatchChanges().changed.length) { 
                var index = this.model.dataSource.findIndex(x=>x.OrderID == this.getBatchChanges().changed[0].OrderID) 
                if (args.cell.closest("tr").index() != index) 
                    args.cancel = true; // to cancel the editing 
            }   
        } 
    </script> 
 
For your convenience we have prepared a sample which can be downloaded from below link 
 
 
Refer our help documentation for your reference 
 
 
 
Please get back to if you have any queries. 
 
Regards, 
Vignesh Natarajan  



CA César Alejandro Guerrero Nava November 27, 2018 05:15 PM UTC

Thank you so much.

I try your strategy and its works...but i can´t edit in another cells. Finally I decide to change the edit mode to normal and I don´t have problem with that form.

Once more time thank you.


VN Vignesh Natarajan Syncfusion Team November 28, 2018 07:38 AM UTC

Hi César, 

Thanks for the update. 

We are glad to hear that your query has been resolved.  

Please get back to us if you have further queries. 

Regards, 
Vignesh Natarajan 


Loader.
Live Chat Icon For mobile
Up arrow icon