Edit mode & Double Click

Hi there,
I have a Grid  displaying Documents with allowEditing = true and the Edit button added to the toolbar

I want to override the default behaviour of the DoubleClickEvent which switches the selected row to edit mode, instead I have added my own double click event where the selected document gets downloaded.

Instead of inline editing, or the default Dialog, on the Edit button click I want to display my own dialog for editing.

The Edit button now display the Document Details form for editing.

And the double-click event now downloads the document for the user BUT it does leave the Grid in in-line editing mode which I don't want.
In my double-click event I have tried setting args.cancel = true; and also calling DocumentsGrid.endEdit();
In the double-click event though for DocumentsGrid.isEdit it is returning false so calling endEdit() is having no effect.

So in short in the double click event I really need to cancel the edit mode

I hope that I have explained the problem clearly

Many thanks James

5 Replies 1 reply marked as answer

RR Rajapandi Ravi Syncfusion Team February 3, 2021 12:14 PM UTC

Hi James, 

Greetings from syncfusion support 

We have analyzed your query and we could see that you like to not allow the editing of a record on double click. You can achieve your requirement by setting allowEditOnDblClick is false in the editSettings of the Grid. If allowEditOnDblClick is set to false, Grid will not allow editing of a record on double click. Please refer the below code example for more information. 

 
var grid = new ej.grids.Grid({ 
    dataSource: data, 
    editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, allowEditOnDblClick: false }, 
    columns: [ 
        .  .  .  .  .  .  .  . 
        .  .  .   .  .  .  .  . 
    ], 
    height: 315 
}); 
grid.appendTo('#Grid'); 
 


Regards, 
Rajapandi R 


Marked as answer

JC James Carter February 3, 2021 12:20 PM UTC

Hi Rajapandi,
many thanks - I wasn't aware of that property as I couldn't see it on any examples I have found.
Your solution worked so I am very grateful!!

James


ZI Zinavo February 3, 2021 12:30 PM UTC

Load the minified version of the jQuery Editable plugin after loading jQuery library
Call the function editable() to make an element editable
Customize the trigger event to start editing
Enable/disable the touch support
Exit the edit mode when pressing Enter key


RR Rajapandi Ravi Syncfusion Team February 4, 2021 01:52 PM UTC

Hi James, 

Thanks for the update 

We are happy to hear that our suggested solution was working fine at your end. 

Please get back to us if you need further assistance.  

Regards,  
Rajapandi R 



RR Rajapandi Ravi Syncfusion Team February 4, 2021 01:52 PM UTC

Hi Priya, 

By default, the Syncfusion EJ2 Grid is a pure JavaScript component. And our EJ1 Grid is only jQuery dependent. Since your query is about jQuery, We need some information for our clarification. So please confirm whether you are using EJ1 or EJ2 Grid in your application and also confirm if you are using any other syncfusion components. 

Regards, 
Rajapandi R 


Loader.
Up arrow icon