How to get component from dialog ?

I've a grid in Index.cshtml. I implemented a custom dialog for editting. I would change a textbox's state according to the radiobutton value in edit dialog. I got radiobutton change function successfully but it occurs a execption while trying to get compentent instance with documentGetElementById("Something").ej2_instance[0]; How can i get partialview's component from it's main page and that partialview is contained in a dialog.

   
       
           
           
           
               
               
               
               
               
               
               
           
       
   





1 Reply

SK Sujith Kumar Rajkumar Syncfusion Team March 2, 2020 12:26 PM UTC

Hi Tümer, 
 
Greetings from Syncfusion support. 
 
You can achieve your requirement by getting the textbox’s instance from the dialog element in the radio button’s change event and then using its enabled property to enable/disable the textbox as demonstrated in the below code snippet, 
 
// First radio button’s change event 
function onEnable(args) { 
        // Get the textbox instance from the dialog element and enable it 
        var dialogObj = this.element.closest('.e-dialog'); 
        dialogObj.querySelector("#textbox").ej2_instances[0].enabled = true; 
} 
 
// Second radio button’s change event 
function onDisable(args) { 
        // Get the textbox instance from the dialog element and disable it 
        var dialogObj = this.element.closest('.e-dialog'); 
        dialogObj.querySelector("#textbox").ej2_instances[0].enabled = false; 
} 
 
We have prepared a sample based on this for your reference which you can find below, 
 
 
Please get back to us if you require any further assistance. 
 
Regards, 
Sujith R 


Loader.
Up arrow icon