Dialog template edit not working

Hi,


I am using the datagrid dialog template feature but cannot get edit button to work correctly. I have attached a sample project. Please help.


Thanks,

Mike


Attachment: grid_Custom_sample1546497361_88dd56ee.zip

1 Reply

VN Vignesh Natarajan Syncfusion Team March 21, 2022 04:15 PM UTC

Hi Michael,  
 
Thanks for contacting Syncfusion support.  
 
Query: “I am using the datagrid dialog template feature but cannot get edit button to work correctly. I have attached a sample project 
 
We are able to reproduce the reported issue in the provided sample. This is because there require some delay between the selecting the record and start editing it which does not exist. We have resolved the issue by introducing the time delay before selecting a record and start editing it using startEdit() method.  
 
Refer the below code example. 
 
function buttonClick(args) {         
        // Grid instance 
        var gridObj = document.getElementById('Grid').ej2_instances[0]; 
        // Closest Grid row cell element is retrieved from the target element 
        var targetRowCell = args.target.closest('.e-rowcell'); 
        // Current row details 
        var rowInfo = gridObj.getRowInfo(targetRowCell); 
 
        setTimeout(function(){ 
            gridObj.selectRow(rowInfo.rowIndex); 
            gridObj.startEdit(); 
         },0) 
    } 
   
Please get back to us if you have further queries.  
 
Regards, 
Vignesh Natarajan 


Loader.
Up arrow icon