Dynamically enable or disable editSettings after Grid has rendered

After an ejGrid has already rendered, is there a way to dynamically disable and/or enable back editing of the grid?

1 Reply

VA Venkatesh Ayothi Raman Syncfusion Team August 30, 2018 06:32 AM UTC


Hi Chris, 

Thanks for using Syncfusion products. 

As from your query, we suspect that would you like to enable/disable the Grid editing. If so, we suggest you to enable/disable the allowAdding and allowEditing property in Grid like as follows, 
Code example

document.getElementById('btn').addEventListener('click', (args:any)=>{ 
 
  if(grid.editSettings.allowAdding && grid.editSettings.allowEditing ){ 
        //disable the editing 
      grid.editSettings.allowAdding = false; 
      grid.editSettings.allowEditing=false; 
       
  } 
  else{ 
 //enable the editing 
      grid.editSettings.allowAdding = true; 
      grid.editSettings.allowEditing=true; 
  } 
}) 



If we misunderstood your requirement, then could you please provide more information about your requirement? 

Note: Please confirm whether you are using Essential JavaScript1 or Essential JavaScript2. Please refer to the following Help documentation for Essential JavaScript 2, 

  

Regards, 
Venkatesh Ayothiraman. 


Loader.
Up arrow icon