Grid change edit mode Dialog/Inline

Good morning I am trying to make a change in the edit settings of the grid for the following case:
-When creating a new record I want to display the edition in Dialog Mode with a template, while I want to do the editing on the grid, that is, the normal edition mode.

I have been performing several tests, I have changed the editing mode in the actionBegin of the grid, but the first time I press the edit button it passes me through the actionComplete and generates the dialog.

The second time I click edit if it does it in the Grid itself but it does not generate the input fields correctly.

My code JS:
   function actionBegin(args) {

        var gridLineas = document.querySelector('#Grid-Lineas').ej2_instances[0];

        if (args.requestType === 'beginEdit') {
            gridLineas.editSettings.mode =  'Normal';
           
        }
        else if (args.requestType === 'add') {
            gridLineas.editSettings = { mode: 'Dialog', template :'#dialogtemplate' };

        }
    }


2 Replies 1 reply marked as answer

DI diego replied to diego June 8, 2020 09:53 AM UTC

Good morning I am trying to make a change in the edit settings of the grid for the following case:
-When creating a new record I want to display the edition in Dialog Mode with a template, while I want to do the editing on the grid, that is, the normal edition mode.

I have been performing several tests, I have changed the editing mode in the actionBegin of the grid, but the first time I press the edit button it passes me through the actionComplete and generates the dialog.

The second time I click edit if it does it in the Grid itself but it does not generate the input fields correctly.

My code JS:
   function actionBegin(args) {

        var gridLineas = document.querySelector('#Grid-Lineas').ej2_instances[0];

        if (args.requestType === 'beginEdit') {
            gridLineas.editSettings.mode =  'Normal';
           
        }
        else if (args.requestType === 'add') {
            gridLineas.editSettings = { mode: 'Dialog', template :'#dialogtemplate' };

        }
    }


Good afternoon, is what I have said possible? I can't find a solution to this problem, thanks.


RS Rajapandiyan Settu Syncfusion Team June 9, 2020 01:54 PM UTC

Hi diego, 

Greetings from syncfusion support. 

Query : When creating a new record I want to display the edition in Dialog Mode with a template, while I want to do the editing on the grid, that is, the normal edition mode. 

Based on your query we could see that you want to dynamically change the edit mode in the grid. when adding a record in a grid you need dialog template (mode dialog) and when editing you need inline edit form ( mode-normal ) in the grid. 

In EJ2 Grid, we don’t have the support to dynamically change the edit mode from dialog with template to normal edit. Please get back to us if you need further assistance on this. 

Regards, 
Rajapandiyan S 


Marked as answer
Loader.
Up arrow icon